ydb-platform / ydb-sqlalchemy

YQL Dialect for SQLAlchemy
Apache License 2.0
20 stars 6 forks source link

Add transactions support #24

Closed LuckySting closed 8 months ago

LuckySting commented 8 months ago

Description

This PR contains two major changes.

Replacing the ydb session pool with one ydb session SQLAlchemy uses its own ConnectionPool with a priority queue. Connection is the unit of parallelism of this library, which is used for managing transactions and making queries, just like the ydb.Session do, so it must be exactly one session per connection. This session should be closed before the closing of the connection.

Implementing transactions SQLAlchemy providers an ability to configure an isolation level of a transaction and to begin an interactive transaction, as well as commiting and rollbacking them. All now presented isolations level are implemented.

rekby commented 8 months ago

Thanks for the great work :)