Skip to content

Add stubs for dj-database-url #7972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"stubs/commonmark",
"stubs/cryptography",
"stubs/dateparser",
"stubs/dj-database-url",
"stubs/docutils",
"stubs/Flask-SQLAlchemy",
"stubs/fpdf2",
Expand Down
1 change: 1 addition & 0 deletions stubs/dj-database-url/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "0.5.*"
22 changes: 22 additions & 0 deletions stubs/dj-database-url/dj_database_url.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Any
from typing_extensions import TypedDict

DEFAULT_ENV: str
SCHEMES: dict[str, str]

class _DBConfigBase(TypedDict):
NAME: str

class _DBConfig(_DBConfigBase, total=False):
USER: str
PASSWORD: str
HOST: str
PORT: str
CONN_MAX_AGE: int
OPTIONS: dict[str, Any]
ENGINE: 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: ...