BrianAnderson-BAJL/BAJL-Flow

Variable names can't contain a . (period / dot)

Opened this issue · 2 comments

When using the Database plugin and selecting records a field name could contain a . (period / dot). Variable names use the dot for selecting sub variables. "flow_start.data.word" is a valid variable name. We need to support dots inside of variable names.

Example:
SELECT GameBoards.Id, GameBoardsWords.Id
FROM GameBoards
LEFT JOIN GameBoardsWords ON (GameBoardsWords.GameBoardsId = GameBoards.Id)

Database fields become Variable names in flows. This currently won't work.

There is a work around for the Database issue. You need to rename the fields in the SELECT statement.

SELECT GameBoards.Id AS GbId, GameBoardsWords.Id AS GbwId
FROM GameBoards
LEFT JOIN GameBoardsWords ON (GameBoardsWords.GameBoardsId = GameBoards.Id)

Variable names look like this:
flow_start.data.json.name
Think I will wrap variable names with periods in it with parentheses like this:
flow_start.data.(json.name)
So if parentheses are encountered in the variable name it will know to ignore all periods inside the parentheses

I debated with myself what characters to use to wrap. I considered the following: [...], {...}, '...', "...", <...>, (...)
There is no particular reason why I selected parentheses, I just liked it best.