Fixes to create db script

This commit is contained in:
Vasilije 2024-02-20 17:41:40 +01:00
parent 35426c3354
commit 0ba9342f5d
2 changed files with 4 additions and 4 deletions

View file

@ -9,8 +9,8 @@ config = config.load()
class NetworkXGraphDB:
"""A class to manage a graph database using NetworkX"""
graph_path = (Path(config.base_path) / config.graph_name).absolute()
def __init__(self, filename=graph_path):
# graph_path = (Path(config.db_path) / config.graph_name).absolute()
def __init__(self, filename="cognee_graph.pkl"):
self.filename = filename
try:
self.graph = self.load_graph() # Attempt to load an existing graph

View file

@ -14,14 +14,14 @@ RETRY_DELAY = 5
def get_sqlalchemy_database_url(
db_type = globalConfig.db_type,
db_name = globalConfig.db_name,
base_path = globalConfig.db_path,
db_path = globalConfig.db_path,
user = globalConfig.db_user,
password = globalConfig.db_password,
host = globalConfig.db_host,
port = globalConfig.db_port,
):
"""Get the SQLAlchemy database URL based on parameters."""
db_path = (Path(base_path) / db_name).absolute()
db_path = (Path(db_path) / db_name).absolute()
if db_type == "sqlite":
return f"sqlite+aiosqlite:///{db_path}" # SQLite uses file path
elif db_type == "duckdb":