Closed avinassh closed 11 months ago
Hey @avinassh, I don't think this is actually a libSQL bug. You get the same behavior with SQLite too because it defaults to autocommit disabled:
import sqlite3
conn = sqlite3.connect("hello.db")
conn.execute("CREATE TABLE IF NOT EXISTS users_sync (id INTEGER);")
conn.execute("INSERT INTO users_sync(id) VALUES (1);")
% python3 sqlite.py
% sqlite3 hello.db "SELECT * FROM users_sync"
You need to either pass isolation_level=None
as an argument to connect()
or do a conn.commit()
after the insertion.
Doing conn.commit()
worked. Thank you!
If I create a new connection which I also use for embedded replica, with such connection I am not able to make new inserts
sample script:
this outputs:
But when I inspect the same DB in turso shell, I don't see any row inserted. But I do see a new table created:
library version: v0.0.19, also tried with #12 libsql-server: running in fly with extensions enabled, v0.22.4-1700159808
(internal slack thread)