libsql-experimental-python
libsql-experimental-python copied to clipboard
libSQL API for Python (experimental)
If I have enabled some extensions in libsql server, then my replica should have it too.
Consider the following example: ```python import os import libsql_experimental as libsql print(F"syncing with {os.getenv('LIBSQL_URL')}") connection = libsql.connect("hello.db", sync_url=os.getenv("LIBSQL_URL"), auth_token=os.getenv("LIBSQL_AUTH_TOKEN")) connection.sync() connection.execute("CREATE TABLE my_table(rowid INTEGER PRIMARY KEY AUTOINCREMENT, text TEXT);") connection.commit()...
For e.g. I tried to insert a table which already existed. The exception message: ```python Traceback (most recent call last): File "writes_no_sync.py", line 9, in connection.execute( ValueError: Write delegation: `status:...
Create a new db with extensions enabled: ``` $ turso db create --group --enable-extensions ``` Following fails with: ```python import os import libsql_experimental as libsql print(F"syncing with {os.getenv('LIBSQL_URL')}") connection =...
I want do something like this: ```python import libsql_experimental as libsql url = os.getenv("LIBSQL_URL") auth_token = os.getenv("LIBSQL_AUTH_TOKEN") con = libsql.connect(url=url, auth_token=auth_token) ```
The following just freezes the app so badly that even `Ctrl-C` doesn't work if there's nothing listening to the `sync_url`: ``` import libsql_experimental con = libsql_experimental.connect("hello.db", sync_url="http://localhost:8080", auth_token="") con.sync() ```
I want to be able to do something like this: ```python import os import libsql_experimental as libsql import sqlite_vss 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.enable_load_extension(True) sqlite_vss.load(conn)...
``` $ pip install libsql-experimental Collecting libsql-experimental Downloading libsql_experimental-0.0.19.tar.gz (22 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error...
Hitting this in https://github.com/lincolnloop/django-libsql It stems from https://github.com/django/django/blob/4.2/django/db/backends/sqlite3/_functions.py#L41 The relevant part of the traceback is: ``` File "/Users/pete/projects/lincolnloop/django-libsql/src/django_libsql/base.py", line 29, in get_new_connection register_functions(conn) File "/Users/pete/projects/lincolnloop/django-libsql/django/django/db/backends/sqlite3/_functions.py", line 42, in register connection.create_function,...
The PyO3 lets us implement `async` Python APIs. Let's see if there's enough interest from people to implement that.