Fixes to create db script
This commit is contained in:
parent
0ba9342f5d
commit
3b8fa9d8f2
1 changed files with 3 additions and 1 deletions
|
|
@ -21,10 +21,12 @@ def get_sqlalchemy_database_url(
|
||||||
port = globalConfig.db_port,
|
port = globalConfig.db_port,
|
||||||
):
|
):
|
||||||
"""Get the SQLAlchemy database URL based on parameters."""
|
"""Get the SQLAlchemy database URL based on parameters."""
|
||||||
db_path = (Path(db_path) / db_name).absolute()
|
|
||||||
if db_type == "sqlite":
|
if db_type == "sqlite":
|
||||||
|
db_path = (Path(db_path) / db_name).absolute()
|
||||||
return f"sqlite+aiosqlite:///{db_path}" # SQLite uses file path
|
return f"sqlite+aiosqlite:///{db_path}" # SQLite uses file path
|
||||||
elif db_type == "duckdb":
|
elif db_type == "duckdb":
|
||||||
|
db_path = (Path(db_path) / db_name).absolute()
|
||||||
return f"duckdb+aiosqlite:///{db_path}"
|
return f"duckdb+aiosqlite:///{db_path}"
|
||||||
elif db_type == "postgresql":
|
elif db_type == "postgresql":
|
||||||
# Ensure optional parameters are handled gracefully
|
# Ensure optional parameters are handled gracefully
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue