You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Quote a table name. For example, `foo.bar` becomes `"foo"."bar".
* @param {string} table the name of the table which may contain a database reference
* @returns The quoted table name.
*/
functionquoteTableName(table){
constpieces=table.split('.');
returnpieces.map(p=>`"${p}"`).join('.');
}
but I noticed we actually handle 'quoting' in several different places in mosaic-sql, so I'm not sure what the preferred way of addressing this (globally?) would be:
aggregates.js has unquoted
Query.js has unquote and isDoubleQuoted
ref.js has quoteTableName
The text was updated successfully, but these errors were encountered:
willium
changed the title
Creating a table should automatically escape it with quotes
Creating a table should automatically escape the name with quotes
May 4, 2024
It'd be great if a table name was escape with quotes automatically during creation.
mosaic/packages/sql/src/load/create.js
Line 11 in 5fe204e
I was going to send a PR for this by exporting
quoteTableName
fromref.js
:mosaic/packages/sql/src/ref.js
Lines 38 to 46 in 5fe204e
but I noticed we actually handle 'quoting' in several different places in mosaic-sql, so I'm not sure what the preferred way of addressing this (globally?) would be:
unquoted
unquote
andisDoubleQuoted
quoteTableName
The text was updated successfully, but these errors were encountered: