Closed subframe7536 closed 7 months ago
Hi, thanks for your request.
The function .all()
returns an array and the length of the array equals changes
. So if you can live without lastInsertRowid
, this would be a solution. If you need lastInsertRowid
as well, I do not have quick a solution.
For the moment and unless there are more requests in this direction, I will not implement anything to solve this.
Thanks for your reply!
Finally i implement it by checking if sql string has returning
. If true, call db.all(sql, params)
to get rows and db.get('select last_insert_rowid() as id').id
to get lastInsertRowid
find another way right now: call db.all(sql, params)
to get rows and db.run('select 1')
to get changes
and lastInsertRowid
Happy you found a solution. db.get('select last_insert_rowid() as id').id
is nice 🙂
Thanks for your great work!
I'm writing a dialect for Kysely, that needs get
lastInsertRowid
,changes
and rows when the sql havereturing
, but in my current(v0.8.0) try:maybe expose a new API or just expose
sqlite.changes()
?