-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The example fails as follows if you remove the local database:
(.env) penberg@vonneumann libsql-experimental-python % python3 examples/sync_write.py
syncing with libsql://python-penberg.aws-eu-west-1.turso.io
thread '<unnamed>' panicked at /Users/penberg/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libsql-0.9.3/src/sync.rs:703:9:
generation should be > 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
File "/Users/penberg/src/tursodatabase/libsql-experimental-python/examples/sync_write.py", line 16, in <module>
conn.sync()
pyo3_runtime.PanicException: generation should be > 0
A call to sync()
helps but should not be needed:
diff --git a/examples/sync_write.py b/examples/sync_write.py
index 853aa83..12f05ee 100644
--- a/examples/sync_write.py
+++ b/examples/sync_write.py
@@ -10,6 +10,7 @@ import libsql_experimental as libsql
print(F"syncing with {os.getenv('LIBSQL_URL')}")
conn = libsql.connect("hello.db", sync_url=os.getenv("LIBSQL_URL"),
auth_token=os.getenv("LIBSQL_AUTH_TOKEN"))
+conn.sync()
conn.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER);")
conn.execute("INSERT INTO users(id) VALUES (1);")
conn.commit()
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working