-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB.literal :symbol should not quote "symbol" #2119
Comments
This is expected behavior, as Sequel quotes identifiers by default (to handle symbols that are also SQL keywords, among other reasons). Use |
Thank you. Anyway the comments in
are missleading ... wrong IMHO. Regards. |
Well, they aren't necessarily wrong. Some adapters disable identifier quoting, and the actual literal value depends on the adapter. In most example SQL examples in the Sequel documentation, identifiers are shown unquoted. However, I don't have an issue expanding this example. |
Updated the documentation in 150e754 |
Complete Description of Issue
Hi,
trying to create a table with this code into postgres database
results in an error because CURRENT_DATETIME gets quoted, so digging into the source code I come to
Proxy the literal call to the dataset.
and with my poor ruby skills is the farthest I could get.
Could't find where #literal gets implemented. ( can you please enlighten me? )
Sorry for my bad english.
Simplest Possible Self-Contained Example Showing the Bug
DB.literal :symbol => "\"symbol\""
(should be "symbol")Full Backtrace of Exception (if any)
No response
SQL Log (if any)
No response
Ruby Version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]
Sequel Version
Tested with 5.63.0 and 5.76.0
The text was updated successfully, but these errors were encountered: