forked from CodeGraphContext/CodeGraphContext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase_kuzu.py
More file actions
41 lines (33 loc) · 1.1 KB
/
Copy pathdatabase_kuzu.py
File metadata and controls
41 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# src/codegraphcontext/core/database_kuzu.py
"""
Thread-safe singleton manager for the KùzuDB embedded graph database.
Implementation is delegated to ``database_embedded_kuzu`` (shared with LadybugDB).
"""
from .database_embedded_kuzu import (
EmbeddedBackendSpec,
EmbeddedCompatState,
EmbeddedDriverWrapper,
EmbeddedGraphManager,
EmbeddedRecord,
EmbeddedResultWrapper,
EmbeddedSessionWrapper,
)
KUZU_SPEC = EmbeddedBackendSpec(
backend_id="kuzudb",
python_module="kuzu",
display_name="KùzuDB",
path_env_var="KUZUDB_PATH",
config_key="KUZUDB_PATH",
default_dir="kuzudb",
install_hint="Run 'pip install kuzu'",
)
class KuzuDBManager(EmbeddedGraphManager):
"""Manages the KùzuDB database connection as a singleton."""
BACKEND_SPEC = KUZU_SPEC
_compat_state = EmbeddedCompatState()
# Backward-compatible public names used across tests and CLI helpers.
KuzuDriverWrapper = EmbeddedDriverWrapper
KuzuSessionWrapper = EmbeddedSessionWrapper
KuzuRecord = EmbeddedRecord
KuzuResultWrapper = EmbeddedResultWrapper
_KuzuCompatState = EmbeddedCompatState