I'm new to bettersql3lite, I tried reading the documentation here: https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/api.md
and I couldn't figure out this bug.
I am trying to run a select statement in javascript as follows:
const stmt = db.prepare('select * from table where token = ?').get(token);
where token is an int initialized to be 5000 in this example. db corresponds to the line
const db = require('./database')
Whenever I try running this code and printing out what stmt is, stmt is undefined.
When I try running the same sql query,
select * from table where token = 5000
, in a database browser, I do get a record returned to me as desired. I'm not sure why the above javascript code isn't working for me, I use it the same way, with strings in place of token, and it behaves as expected (i.e the variable is initialized when there is something in the database that would be returned). I don't know if strings are the issue, but I'm really confused as to why the above line does not work. Any help is appreciated.