allow commit() within run_transaction() callback
See original GitHub issueRunning the following yields psycopg2.InternalError: SAVEPOINT not supported except for COCKROACH_RESTART
I believe this is due to https://github.com/cockroachdb/cockroachdb-python/blob/master/cockroachdb/sqlalchemy/transaction.py#L54.
Why do we need savepoint_state.cockroach_restart
? Considering that CockroachDB supports no other savepoint name, why not hard-code it and drop the conditional in the following functions:
https://github.com/cockroachdb/cockroachdb-python/blob/master/cockroachdb/sqlalchemy/dialect.py#L158
Steps to reproduce:
docker run -p 26257:26257 cockroachdb/cockroach:v1.0 start --insecure
Then run the following code: https://gist.github.com/gpaul/648189354975992a2c285143d08be88a
This gives the following output using cockroachdb-python v0.1
:
https://gist.github.com/gpaul/14fa2967c42d4ccf6b223322a7967476
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (9 by maintainers)
Top GitHub Comments
It’s tracked in the main repo as https://github.com/cockroachdb/cockroach/issues/10735 although it’s not currently on the roadmap.
For django, there has been some movement: see the last few comments on https://github.com/cockroachdb/cockroachdb-python/pull/14