MCPcopy Create free account
hub / github.com/feast-dev/feast / _initialize_conn

Function _initialize_conn

sdk/python/feast/infra/online_stores/sqlite.py:711–729  ·  view source on GitHub ↗
(
    db_path: str, enable_sqlite_vec: bool = False
)

Source from the content-addressed store, hash-verified

709
710
711def _initialize_conn(
712 db_path: str, enable_sqlite_vec: bool = False
713) -> sqlite3.Connection:
714 Path(db_path).parent.mkdir(exist_ok=True)
715 db = sqlite3.connect(
716 db_path,
717 detect_types=sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES,
718 check_same_thread=False,
719 )
720 if enable_sqlite_vec:
721 try:
722 import sqlite_vec # noqa: F401
723 except ModuleNotFoundError:
724 logging.warning("Cannot use sqlite_vec for vector search")
725
726 db.enable_load_extension(True)
727 sqlite_vec.load(db)
728
729 return db
730
731
732def _table_id(project: str, table: Any, enable_versioning: bool = False) -> str:

Callers 2

_get_connMethod · 0.85
__init__Method · 0.85

Calls 2

connectMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected