Database¶
Format: {scheme}://{user}:{password}@{host}:{port}/{database}?{parameters}
SQLite¶
SQLite accepts the following three formats:
in-memory database:
sqlite://:memory:
relative path:
sqlite:///db.sqlite3
absolute path:
sqlite:////var/run/sqlite.db
Schemes¶
mysql:
django.db.backends.mysql
oracle:
django.db.backends.oracle
pgsql:
django.db.backends.postgresql
postgres:
django.db.backends.postgresql
postgresql:
django.db.backends.postgresql
sqlite:
django.db.backends.sqlite3
sqlite3:
django.db.backends.sqlite3
Note
You can add more schemes with add_scheme()
.
Parameters¶
You can define database options as query parameters.
conn_max_age: CONN_MAX_AGE
autocommit: AUTOCOMMIT
atomic_requests: ATOMIC_REQUESTS
search_path: PostgreSQL search path
isolation: PostgreSQL isolation level (
uncommitted
/serializable
/repeatable
/committed
/autocommit
)
Other parameters will be passed to OPTIONS as is.
See also