vals-productions/sqlighter

Include transactions

Closed this issue · 6 comments

Could you please include ``transactions` for the database queries as well.

They are, actually, supported. I added convenience methods, though.

@vals-productions is each executeChange() and executeSelect() a transaction?

Is it possible to combine more than one queries in one transaction?

All queries are autocommitted by default. But if you use beginTransaction/rollback/commmitTransaction, then you can group.

I included an example in the demo

Just to get you right. When I do not do anything beside two queries the are automatically wrapped in a transaction. Right?

if you execute two sequential queries without specifying transaction boundaries, they represent two individual transactions. I.e. if the second one fails, the first one does not roll back.

But if you enclose your queries into beginTransaction / commit or rollback transaction, then they either both succeed or both fail/rollback

thank you