WillAyd opened a new issue, #1158:
URL: https://github.com/apache/arrow-adbc/issues/1158
Might be something I am overlooking with how to begin/end transactions, but
I was surprised to see this difference in behavior across drivers:
```python
from adbc_driver_postgresql import dbapi as pg_dbapi
from adbc_driver_sqlite import dbapi as sqlite_dbapi
sqlite_uri = "file::memory"
with sqlite_dbapi.connect(sqlite_uri) as conn:
with conn.cursor() as cur:
cur.execute("CREATE TABLE test_trans (A INT, B TEXT)")
conn.commit()
with conn.cursor() as cur:
cur.execute("INSERT INTO test_trans (A,B) VALUES (1, 'blah')")
conn.rollback()
with conn.cursor() as cur:
cur.execute("SELECT count(*) FROM test_trans")
print(f"Number of sqlite rows inserted was {cur.fetchone()}")
conn.commit()
with conn.cursor() as cur:
cur.execute("DROP TABLE test_trans")
conn.commit()
pg_uri = "postgresql://postgres:postgres@localhost:5432/pandas"
with pg_dbapi.connect(pg_uri) as conn:
with conn.cursor() as cur:
cur.execute("CREATE TABLE test_trans (A INT, B TEXT)")
conn.commit()
with conn.cursor() as cur:
cur.execute("INSERT INTO test_trans (A,B) VALUES (1, 'blah')")
conn.rollback()
with conn.cursor() as cur:
cur.execute("SELECT count(*) FROM test_trans")
print(f"Number of postgres rows inserted was {cur.fetchone()}")
conn.commit()
with conn.cursor() as cur:
cur.execute("DROP TABLE test_trans")
conn.commit()
```
prints:
```sh
Number of sqlite rows inserted was (0,)
Number of postgres rows inserted was (1,)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]