Open skyatgit opened 1 year ago
Hi @skyatgit
At the moment there's no way to get the number of changes. I'll see about implementing it in the next version.
ok,thanks
Hello @skyatgit
Good news 😄 You can already get the number of changes in the current version of the library by using following query:
db.query("SELECT CHANGES();")
print(db.query_result)
Which will then output the following in the Godot console:
[{CHANGES():0}]
With 0 being replaced with whatever number changes were done in the previous query.
I'll see if there's any merit to implementing some additional wrappers around the sqlite3_total_changes
and sqlite3_changes
-methods, but I assume that the query above already fixes your issue 😄
@2shady4u ok,thank you~ and i think in the next version if the query is not 'select',the query_result return the changes count is a good thing,of course, it depends on your decision
maybe the return value for update_rows
could be made to reflect that? e.g. -1
for error and 0
,1
... for success? Not sure if really necessary though, but would be nice (breaks compatibility)
db.query_result don't show the number of update rows