dasch-swiss/sipi

lua sqlite prepare statement not working?

ubunibas opened this issue · 2 comments

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?

found the bug and fixed it. Will add some test and then make a pull request...