Skip to content

Commit 3c3c103

Browse files
committed
sqlite-lines
1 parent 9eeceec commit 3c3c103

File tree

4 files changed

+616
-16
lines changed

4 files changed

+616
-16
lines changed

llama.cpp/embedr/BUILD.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ o/$(MODE)/llama.cpp/embedr/sqlite-vec.a: o/$(MODE)/llama.cpp/embedr/sqlite-vec.o
2525
o/$(MODE)/llama.cpp/embedr/sqlite-csv.o: llama.cpp/embedr/sqlite-csv.c
2626
o/$(MODE)/llama.cpp/embedr/sqlite-csv.a: o/$(MODE)/llama.cpp/embedr/sqlite-csv.o
2727

28+
o/$(MODE)/llama.cpp/embedr/sqlite-lines.o: llama.cpp/embedr/sqlite-lines.c
29+
o/$(MODE)/llama.cpp/embedr/sqlite-lines.a: o/$(MODE)/llama.cpp/embedr/sqlite-lines.o
30+
2831
o/$(MODE)/llama.cpp/embedr/sqlite-lembed.o: llama.cpp/embedr/sqlite-lembed.c
2932
o/$(MODE)/llama.cpp/embedr/sqlite-lembed.a: o/$(MODE)/llama.cpp/embedr/sqlite-lembed.o o/$(MODE)/llama.cpp/llama.cpp.a
3033

@@ -43,6 +46,7 @@ o/$(MODE)/llama.cpp/embedr/embedr: \
4346
o/$(MODE)/llama.cpp/embedr/sqlite3.a \
4447
o/$(MODE)/llama.cpp/embedr/sqlite-csv.a \
4548
o/$(MODE)/llama.cpp/embedr/sqlite-vec.a \
49+
o/$(MODE)/llama.cpp/embedr/sqlite-lines.a \
4650
o/$(MODE)/llama.cpp/embedr/sqlite-lembed.a
4751

4852
$(LLAMA_CPP_EMBEDR_OBJS): private CCFLAGS += -DSQLITE_CORE

llama.cpp/embedr/embedr.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "llama.cpp/embedr/sqlite-vec.h"
77
#include "llama.cpp/embedr/sqlite-lembed.h"
88
#include "llama.cpp/embedr/sqlite-csv.h"
9+
#include "llama.cpp/embedr/sqlite-lines.h"
910
#include "llama.cpp/embedr/shell.h"
1011
#include <string.h>
1112

@@ -29,6 +30,7 @@ int embedr_sqlite3_init(sqlite3 * db) {
2930
rc = sqlite3_vec_init(db, NULL, NULL); assert(rc == SQLITE_OK);
3031
rc = sqlite3_lembed_init(db, NULL, NULL); assert(rc == SQLITE_OK);
3132
rc = sqlite3_csv_init(db, NULL, NULL); assert(rc == SQLITE_OK);
33+
rc = sqlite3_lines_init(db, NULL, NULL); assert(rc == SQLITE_OK);
3234

3335
if(!EMBEDR_MODEL) {
3436
return SQLITE_OK;
@@ -47,22 +49,6 @@ int embedr_sqlite3_init(sqlite3 * db) {
4749
return rc;
4850
}
4951

50-
int register_model(sqlite3 * db, char * modelPath) {
51-
int rc;
52-
sqlite3_stmt * stmt;
53-
rc = sqlite3_prepare_v2(db, "insert into temp.lembed_models(model) values (?) ", -1, &stmt, NULL);
54-
if(rc != SQLITE_OK) {
55-
return rc;
56-
}
57-
sqlite3_bind_text(stmt, 1, modelPath, strlen(modelPath), SQLITE_STATIC);
58-
sqlite3_step(stmt);
59-
rc = sqlite3_finalize(stmt);
60-
if(rc != SQLITE_DONE) {
61-
return rc;
62-
}
63-
return SQLITE_OK;
64-
}
65-
6652
int table_exists(sqlite3 * db, const char * table) {
6753
int rc;
6854
sqlite3_stmt * stmt;

0 commit comments

Comments
 (0)