We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import random import libsql_experimental as libsql conn = libsql.connect(":memory:") dims = 4 conn.execute(f""" CREATE TABLE vectors ( vector_id INTEGER PRIMARY KEY, vector F32_BLOB({dims}) ) """) conn.execute("CREATE INDEX vector_idx ON vectors(libsql_vector_idx(vector))") data = [] for primary in range(10): vector = ','.join(str(random.random()) for _ in range(dims)) data.append((primary, f"[{vector}]")) conn.executemany(""" INSERT INTO vectors values (?, ?) """, data) print(conn.execute("SELECT COUNT(*) FROM vectors").fetchall()) print(conn.execute("SELECT * FROM vectors").fetchall())
In this program, count(*) returns 0, even though the table has 10 rows. If you comment out the 'CREATE INDEX' line, the correct answer of 10 is given.
Using libsql-experimental 0.0.41
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In this program, count(*) returns 0, even though the table has 10 rows.
If you comment out the 'CREATE INDEX' line, the correct answer of 10 is given.
Using libsql-experimental 0.0.41
The text was updated successfully, but these errors were encountered: