Format: {scheme}://{user}:{password}@{host}:{port}/{database}?{parameters}
SQLite accepts the following three formats:
- in-memory database:
sqlite://:memory:
- relative path:
sqlite:///db.sqlite3
- absolute path:
sqlite:////var/run/sqlite.db
- 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 ~yaenv.db.add_scheme
.
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
Env.db() <yaenv.core.Env.db>
db.parse() <yaenv.db.parse>