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
I've jsut discovered this great tool, which is incredible, except for this ugly ` quote character required when column names are not fully lowercased, which is really awful in our bash scripts...
I wonder if it was possible to have some sort of generic way of quoting columns, that can be automatically converted to the good column quote depending on the DB driver.
The idea is to allow something like SELECT [Id], [Name] FROM something and have it converted automatically to " or `.
Maybe the [...] is not the good solution, if some drivers support it, so we may want to switch to something else like {...} or |...|.
It should be something that can be used for all known DB drivers.
The complex thing is to parse the SQL string to detect what is inside strings and what is not, to perform the replacement only on the SQL part of the query.
What do you think?
The text was updated successfully, but these errors were encountered:
I would like to implement automatic rewriting if no other problems occur, but in reality unexpected problems do occur.
Therefore, I believe that it is best to pass the SQL statements written by the user as is.
In most cases, the database engine used by the user is known, and the user will write SQL statements appropriate for that database.
For example, SQLite3, which is used by many people, uses backquotes, so arguments are enclosed in single quotes and string literals are enclosed in double quotes.
trdsql -driver sqlite3 -ih -oh 'SELECT `Aaa`,`Bbb`,`Ccc`, "literal" as string FROM test.csv'
Hello,
I've jsut discovered this great tool, which is incredible, except for this ugly
`
quote character required when column names are not fully lowercased, which is really awful in our bash scripts...I wonder if it was possible to have some sort of generic way of quoting columns, that can be automatically converted to the good column quote depending on the DB driver.
The idea is to allow something like
SELECT [Id], [Name] FROM something
and have it converted automatically to"
or`
.Maybe the
[...]
is not the good solution, if some drivers support it, so we may want to switch to something else like{...}
or|...|
.It should be something that can be used for all known DB drivers.
The complex thing is to parse the SQL string to detect what is inside strings and what is not, to perform the replacement only on the SQL part of the query.
What do you think?
The text was updated successfully, but these errors were encountered: