lua sqlite prepare statement not working?
ubunibas opened this issue · 2 comments
ubunibas commented
Concanating the sqlite statement works:
db = sqlite('/home/image_resolver/db/image_resolver.db', 'RO')
qry_str = 'SELECT * FROM image_resolver WHERE image_name = "' .. identifier .. '"'
qry = db << qry_str
row = qry()
print(row)
but preparing the statement returns nil
qry = db << 'SELECT * FROM image_resolver WHERE image_name = ?'
row = qry(identifier)
might there be an issue with lua sqlite prepare statements or do I need another syntax?
lrosenth commented
I'll have a look at it!
Lukas
Am 05.12.2018 um 11:08 schrieb ubunibas <notifications@github.com<mailto:notifications@github.com>>:
Concanating the sqlite statement works:
db = sqlite('/home/image_resolver/db/image_resolver.db', 'RO')
qry_str = 'SELECT * FROM image_resolver WHERE image_name = "' .. identifier .. '"'
qry = db << qry_str
row = qry()
print(row)
but preparing the statement returns nil
qry = db << 'SELECT * FROM image_resolver WHERE image_name = ?'
row = qry(identifier)
might there be an issue with lua sqlite prepare statements or do I need another syntax<https://dhlab-basel.github.io/Sipi/documentation/lua.html#executing-a-query>?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#276>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFN9zK305gtw7INBg9OvTE20z0S4JFPwks5u15sFgaJpZM4ZCZcU>.
lrosenth commented
found the bug and fixed it. Will add some test and then make a pull request...