File: dj_database_url.pyi

package info (click to toggle)
typeshed 0.0~git20221107.4f381af-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,036 kB
  • sloc: python: 3,216; sh: 62; makefile: 13
file content (27 lines) | stat: -rw-r--r-- 841 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from typing import Any
from typing_extensions import TypedDict

DJANGO_VERSION: tuple[str | int, ...] | None  # None if django is not installed
DEFAULT_ENV: str
SCHEMES: dict[str, str]

# From https://docs.djangoproject.com/en/4.0/ref/settings/#databases
class _DBConfig(TypedDict, total=False):
    ATOMIC_REQUESTS: bool
    AUTOCOMMIT: bool
    CONN_MAX_AGE: int
    DISABLE_SERVER_SIDE_CURSORS: bool
    ENGINE: str
    HOST: str
    NAME: str
    OPTIONS: dict[str, Any] | None
    PASSWORD: str
    PORT: str
    TEST: dict[str, Any]
    TIME_ZONE: str
    USER: str

def parse(url: str, engine: str | None = ..., conn_max_age: int = ..., ssl_require: bool = ...) -> _DBConfig: ...
def config(
    env: str = ..., default: str | None = ..., engine: str | None = ..., conn_max_age: int = ..., ssl_require: bool = ...
) -> _DBConfig: ...