diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e25e977..14b6172 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -51,7 +51,6 @@ jobs: python-version: "3.12" - run: ./scripts/vendor.sh shell: bash - - run: ls vendor/ - run: make loadable - run: pip install pytest numpy; make test-loadable - uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index 81db11e..83298c9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,6 @@ examples/supabase-dbpedia examples/ann-filtering examples/dbpedia-openai examples/imdb +examples/sotu sqlite-vec.h diff --git a/examples/wasm/wasm.c b/examples/wasm/wasm.c index 0f95eda..933ec92 100644 --- a/examples/wasm/wasm.c +++ b/examples/wasm/wasm.c @@ -1,6 +1,6 @@ #include "sqlite3.h" #include "sqlite-vec.h" -int sqlite3_wasm_extra_init(const char *) { - sqlite3_auto_extension((void (*)(void)) sqlite3_vec_init); +int sqlite3_wasm_extra_init(const char * unused) { + return sqlite3_auto_extension((void (*)(void)) sqlite3_vec_init); } diff --git a/reference.yaml b/reference.yaml new file mode 100644 index 0000000..6920b23 --- /dev/null +++ b/reference.yaml @@ -0,0 +1,121 @@ +sections: + meta: Meta functions + constructor: Vector constructor functions + op: Vector operation functions + distance: Vector distance functions + quantize: Vector quantization functions +functions: + vec_version: + params: [] + section: meta + desc: x + example: x + vec_debug: + params: [] + section: meta + desc: x + example: x + + vec_bit: + params: [] + section: constructor + desc: x + example: x + vec_f32: + params: [] + section: constructor + desc: x + example: x + vec_int8: + params: [] + section: constructor + desc: x + example: x + + vec_add: + params: [] + section: op + desc: x + example: x + vec_length: + params: [] + section: op + desc: x + example: x + vec_normalize: + params: [] + section: op + desc: x + example: x + vec_slice: + params: [] + section: op + desc: x + example: x + vec_sub: + params: [] + section: op + desc: x + example: x + vec_to_json: + params: [] + section: op + desc: x + example: x + + vec_distance_cosine: + params: [] + section: distance + desc: x + example: x + vec_distance_hamming: + params: [] + section: distance + desc: x + example: x + vec_distance_l2: + params: [] + section: distance + desc: x + example: x + + vec_quantize_binary: + params: [] + section: quantization + desc: x + example: x + vec_quantize_i8: + params: [] + section: quantization + desc: x + example: x + vec_quantize_i8: + params: [] + section: quantization + desc: x + example: x + +table_functions: + vec_each: + columns: [rowid, value] + inputs: ["vector"] + desc: + example: + vec_npy_each: + columns: [rowid, vector] + inputs: ["input"] + desc: + example: + +virtual_tables: + vec0: + desc: + example: + +entrypoints: + sqlite3_vec_init: {} + sqlite3_vec_fs_read_init: {} +compile_options: + - SQLITE_VEC_ENABLE_AVX + - SQLITE_VEC_ENABLE_NEON + diff --git a/tests/test-wasm.mjs b/tests/test-wasm.mjs new file mode 100644 index 0000000..9fdeb59 --- /dev/null +++ b/tests/test-wasm.mjs @@ -0,0 +1,10 @@ +async function main() { + const { default: init } = await import("../dist/.wasm/sqlite3.mjs"); + const sqlite3 = await init(); + const vec_version = new sqlite3.oo1.DB(":memory:").selectValue( + "select vec_version()" + ); + console.log(vec_version); +} + +main();