Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/vec1/test/vec1ivf.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / vec1 / test / vec1ivf.test` 63 lines ยท 1413 bytes Raw Blame History 1 # 2026-01-17 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 6 # May you do good and not evil. 7 # May you find forgiveness for yourself and forgive others. 8 # May you share freely, never taking more than you give. 9 # 10 #*********************************************************************** 11 # 12 # 13 14 source [file join [file dirname [info script]] vec1_common.tcl] 15 set testprefix vec1flat 16 vec1_load db 17 18 19 do_execsql_test 1.0 { 20 CREATE VIRTUAL TABLE v1 USING vec1(v); 21 WITH s(i) AS ( 22 SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<1000 23 ) 24 INSERT INTO v1(v) SELECT random_vector(32) FROM s; 25 INSERT INTO v1(cmd, arg) VALUES('rebuild', ( 26 SELECT vec1_train(v, '{nbucket:24, codesize:0}') FROM v1 27 )); 28 } 29 30 db close 31 sqlite3 db test.db 32 vec1_load db 33 34 do_execsql_test 1.1 { 35 SELECT length(v) FROM v1 LIMIT 1 36 } {128} 37 38 #------------------------------------------------------------------------- 39 reset_db 40 vec1_load db 41 42 do_execsql_test 2.0 { 43 CREATE VIRTUAL TABLE v2 USING vec1(v); 44 WITH s(i) AS ( 45 SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<1000 46 ) 47 INSERT INTO v2(v) SELECT random_vector(7) FROM s; 48 } 49 50 breakpoint 51 do_execsql_test 2.1 { 52 INSERT INTO v2(cmd, arg) VALUES('rebuild', ( 53 SELECT vec1_train(v, '{nbucket:24, codesize:0}') FROM v2 54 )); 55 } 56 57 set v [db one { SELECT v FROM v2 WHERE rowid = 499 }] 58 59 do_execsql_test 2.1 { 60 } 61 62 finish_test 63