# see https://github.com/asg017/sqlite-vec/issues/135
import sqlite3
import sqlite_vec
import streamlit as st
db = conn = sqlite3.connect(":memory:")
db.execute("CREATE TABLE movie(title, year, score)")
conn.enable_load_extension(True)
# sqlite_vec.load(db)
import os
path = os.path.abspath(os.path.dirname(sqlite_vec.__file__))
ext_path = os.path.join(path, "vec0")
st.write(os.listdir(path))
# ok, tries to load vec0 and fails, then vec0.so and succeeds
conn.load_extension(ext_path)
# finds vec0, and tries to find sqlite3_vec_init
conn.load_extension(ext_path)
st.write("Run")