/ All posts
- RENAME TABLE does not parse stored values
We don't currently allow composing component / schema item names from expressions. Mostly not because we cannot do so - we can, our SQL statements are dynamic enough for component / field / index / constraint names to be determined at runtime - but rather because the syntax seems a little too permitting, maybe we should restrict it in some way.
We are fine with just:
RENAME TABLE @a @b;
...but less fine with:
RENAME TABLE 'name' 'my' + @value + currentDate() + askUserForPostfix('hi');
...because it is very unclear from the above that the old name is 'name' and the rest is the new name, the space that separates the old name from the new name just gets lost in the noise.
Maybe we should have a construct like RENAME TABLE $(...), probably with something other than $, which would indicate that in this particular place we are composing an identifier from an expression.