elliotchance / vsql

✌️ Single-file or PostgreSQL-server compatible transactional SQL database written in pure V.
https://vsql.readthedocs.io
MIT License
291 stars 18 forks source link

sequences: Fix transaction isolation #157

Closed elliotchance closed 1 year ago

elliotchance commented 1 year ago

Previously the sequence definition and the value were stored in the same record. However, the value needs to be persistent outside of any transaction isolation. To work around this, the definition could not be rolled back with the transaction to prevent the value from also being rolled back.

This separates the next value so we no longer have this caveat, but it requires a bump in the DB comparability version.