Skip to content

Commit

Permalink
revert: Revert back to sqlite-vec from fork now upstream is fixed (#632
Browse files Browse the repository at this point in the history
…) (#697)
  • Loading branch information
alex-mcgovern authored Jan 22, 2025
1 parent 3c6209c commit 9d0abef
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tree-sitter-python = "==0.23.6"
tree-sitter-rust = "==0.23.2"
alembic = "==1.14.1"
pygments = "==2.19.1"
sqlite-vec = "==0.1.6"
sqlite-vec-sl-tmp = "==0.0.4"

[tool.poetry.group.dev.dependencies]
pytest = "==8.3.4"
Expand Down Expand Up @@ -62,7 +62,7 @@ line-length = 100
target-version = "py310"
fix = true
exclude = [
"src/codegate/db/queries.py", # Ignore auto-generated file from sqlc
"src/codegate/db/queries.py", # Ignore auto-generated file from sqlc
]

[tool.ruff.lint]
Expand Down
4 changes: 2 additions & 2 deletions scripts/import_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sqlite3

import numpy as np
import sqlite_vec
import sqlite_vec_sl_tmp

from codegate.inference.inference_engine import LlamaCppInferenceEngine
from codegate.utils.utils import generate_vector_string
Expand All @@ -27,7 +27,7 @@ def __init__(self, jsonl_dir="data", vec_db_path="./sqlite_data/vectordb.db"):
def _get_connection(self):
conn = sqlite3.connect(self.vec_db_path)
conn.enable_load_extension(True)
sqlite_vec.load(conn)
sqlite_vec_sl_tmp.load(conn)
conn.enable_load_extension(False)
return conn

Expand Down
4 changes: 2 additions & 2 deletions src/codegate/storage/storage_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List

import numpy as np
import sqlite_vec
import sqlite_vec_sl_tmp
import structlog

from codegate.config import Config
Expand Down Expand Up @@ -69,7 +69,7 @@ def _get_connection(self):
try:
conn = sqlite3.connect(self.db_path)
conn.enable_load_extension(True)
sqlite_vec.load(conn)
sqlite_vec_sl_tmp.load(conn)
conn.enable_load_extension(False)
return conn
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion tests/vectordb/test_sqlitevec.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.fixture(scope="module")
def mock_sqlite_vec():
with patch("sqlite_vec.load") as mock_load:
with patch("sqlite_vec_sl_tmp.load") as mock_load:
# Mock the vector similarity extension loading
def setup_vector_similarity(conn):
cursor = conn.cursor()
Expand Down

0 comments on commit 9d0abef

Please sign in to comment.