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
Sqlite Compiler wraps columns into string literals, preventing the 'No Such Column' exception from occurring (returning the string literal instead of throwing)
#655
The text was updated successfully, but these errors were encountered:
RFBomb
changed the title
Sqlite Compiler wraps columns into string literals, preventing the 'No Such Column' exception from occurring
Sqlite Compiler wraps columns into string literals, preventing the 'No Such Column' exception from occurring (returning the string literal instead of throwing)
Jan 7, 2023
Take the following database table:
Table: Students
ID (int) - FirstName (string) - LastName (string)
Use the following query:
var qry = new SqlKata.Query("Students").Select("UnknownCol")
You will receive the string literal 'UnknownCol' back as a result.
The resulting query is as follows:
SELECT \"UnknownCol\" FROM \"Students\"
Modifying the above to use brackets instead results in the
No Such Column
exception being thrown properly.SELECT [UnknownCol] FROM [Students]
For reference, I am using DBCommand.ExecuteScalar() to retrieve the value from the database
Reference to my downvoted StackOverflow thread. Because apparently I'm the first one ever to have an issue with string literals.
https://stackoverflow.com/questions/75040657/sqlite-database-returns-nonexistant-column-name-instead-of-exception-due-to-bad
The text was updated successfully, but these errors were encountered: