Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion astrodbkit/astrodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def create_database(connection_string, drop_tables=False, felis_schema=None):

# Schema handling for various database types
if connection_string.startswith("sqlite"):
db_name = connection_string.split("/")[-1]
# Get the full path to the file as otherwise the DB is only created in the working directory
db_name = connection_string.replace("sqlite:///", "")
with engine.begin() as conn:
conn.execute(text(f"ATTACH '{db_name}' AS {schema_name}"))
elif connection_string.startswith("postgres"):
Expand Down
Loading