0% found this document useful (0 votes)
6 views1 page

SQLite Engine Connection Strings

The document provides instructions on how to create SQLite database engines using SQLAlchemy with relative and absolute file paths. It specifies that a relative path requires three slashes, while an absolute path includes the full path after the three slashes. Additionally, it mentions how to create an in-memory database by specifying an empty URL.

Uploaded by

eesalazarch
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

SQLite Engine Connection Strings

The document provides instructions on how to create SQLite database engines using SQLAlchemy with relative and absolute file paths. It specifies that a relative path requires three slashes, while an absolute path includes the full path after the three slashes. Additionally, it mentions how to create an in-memory database by specifying an empty URL.

Uploaded by

eesalazarch
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

[Link]

html

Relative file path


this requires three slashes:
===================================================
# sqlite://<nohostname>/<path>
# where <path> is relative:
engine = create_engine('sqlite:///[Link]')

Absolute file path


the three slashes are followed by the absolute path
===================================================
# Windows
engine = create_engine('sqlite:///C:\\path\\to\\[Link]')

# Windows alternative using raw string


engine = create_engine(r'sqlite:///C:\path\to\[Link]')

memory: database
Specify an empty URL
===================================================
engine = create_engine('sqlite://')

You might also like