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
14 changes: 10 additions & 4 deletions stubs/dj-database-url/dj_database_url.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ from typing_extensions import TypedDict
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
USER: str
OPTIONS: dict[str, Any] | None
PASSWORD: str
HOST: str
PORT: str
CONN_MAX_AGE: int
OPTIONS: dict[str, Any]
TEST: dict[str, Any]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be a total=False TypedDict by the looks of it (https://docs.djangoproject.com/en/4.0/ref/settings/#test), but you don't have to do that in this PR if you don't want to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, but filed it mostly under "problems for another day"

TIME_ZONE: str
USER: str

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