-
Notifications
You must be signed in to change notification settings - Fork 18
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
String literals are not escaped (unless used as params) #54
Comments
unit test: import ormin, os, unittest
from db_sqlite import exec
# model.sql contains"create table product(name text)";
importModel sqlite, "model"
removeFile "data.db"
let db = open("data.db", user="", password="", database="")
db.exec readFile("model.sql").sql
test "Special UTF-8 codes are inserted and read correctly":
query:
insert product(name="ó")
let name = query:
select product(name)
limit 1
check name == "ó" |
The utf8 string literal in the sql is escaped, you should use param:
|
Thanks, you're right, but in this case I think it's a bug that you can even pass unquoted literals, so I'll leave this issue open. |
"you can even pass unquoted literals", I don't quite understand, could you be more specific? or take an example. |
I used the wrong term. It's just that there's no reason string literals shouldn't be properly escaped. |
There's a difference in how Ormin treats special UTF-8 character codes in comparison to db_sqlite:
The text was updated successfully, but these errors were encountered: