mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 00:07:09 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
86
django-stubs-generated/db/backends/sqlite3/base.pyi
Normal file
86
django-stubs-generated/db/backends/sqlite3/base.pyi
Normal file
@@ -0,0 +1,86 @@
|
||||
import collections
|
||||
from datetime import datetime
|
||||
from sqlite3 import Connection
|
||||
from sqlite3 import dbapi2 as Database
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.base.validation import BaseDatabaseValidation
|
||||
from django.db.backends.sqlite3.client import DatabaseClient
|
||||
|
||||
from .creation import DatabaseCreation
|
||||
from .features import DatabaseFeatures
|
||||
from .introspection import DatabaseIntrospection
|
||||
from .operations import DatabaseOperations
|
||||
|
||||
|
||||
def decoder(conv_func: Callable) -> Callable: ...
|
||||
|
||||
class DatabaseWrapper(BaseDatabaseWrapper):
|
||||
alias: str
|
||||
allow_thread_sharing: bool
|
||||
autocommit: bool
|
||||
client: DatabaseClient
|
||||
close_at: None
|
||||
closed_in_transaction: bool
|
||||
commit_on_exit: bool
|
||||
connection: None
|
||||
creation: DatabaseCreation
|
||||
errors_occurred: bool
|
||||
execute_wrappers: List[Any]
|
||||
features: DatabaseFeatures
|
||||
force_debug_cursor: bool
|
||||
in_atomic_block: bool
|
||||
introspection: DatabaseIntrospection
|
||||
needs_rollback: bool
|
||||
ops: DatabaseOperations
|
||||
queries_log: collections.deque
|
||||
run_commit_hooks_on_set_autocommit_on: bool
|
||||
run_on_commit: List[Any]
|
||||
savepoint_ids: List[Any]
|
||||
savepoint_state: int
|
||||
settings_dict: Dict[str, Optional[Union[Dict[str, None], int, str]]]
|
||||
validation: BaseDatabaseValidation
|
||||
vendor: str = ...
|
||||
display_name: str = ...
|
||||
data_types: Any = ...
|
||||
data_types_suffix: Any = ...
|
||||
operators: Any = ...
|
||||
pattern_esc: str = ...
|
||||
pattern_ops: Any = ...
|
||||
Database: Any = ...
|
||||
SchemaEditorClass: Any = ...
|
||||
client_class: Any = ...
|
||||
creation_class: Any = ...
|
||||
features_class: Any = ...
|
||||
introspection_class: Any = ...
|
||||
ops_class: Any = ...
|
||||
def get_connection_params(self) -> Dict[str, Union[int, str]]: ...
|
||||
def get_new_connection(
|
||||
self, conn_params: Dict[str, Union[int, str]]
|
||||
) -> Connection: ...
|
||||
def init_connection_state(self) -> None: ...
|
||||
def create_cursor(self, name: None = ...) -> SQLiteCursorWrapper: ...
|
||||
def close(self) -> None: ...
|
||||
def disable_constraint_checking(self) -> bool: ...
|
||||
def enable_constraint_checking(self) -> None: ...
|
||||
def check_constraints(
|
||||
self, table_names: Optional[List[str]] = ...
|
||||
) -> None: ...
|
||||
def is_usable(self): ...
|
||||
def is_in_memory_db(self) -> bool: ...
|
||||
|
||||
FORMAT_QMARK_REGEX: Any
|
||||
|
||||
class SQLiteCursorWrapper(Database.Cursor):
|
||||
def execute(
|
||||
self,
|
||||
query: str,
|
||||
params: Optional[
|
||||
Union[List[bool], List[datetime], List[float], Tuple]
|
||||
] = ...,
|
||||
) -> SQLiteCursorWrapper: ...
|
||||
def executemany(
|
||||
self, query: str, param_list: Union[Iterator[Any], List[Tuple[int]]]
|
||||
) -> SQLiteCursorWrapper: ...
|
||||
def convert_query(self, query: str) -> str: ...
|
||||
11
django-stubs-generated/db/backends/sqlite3/creation.pyi
Normal file
11
django-stubs-generated/db/backends/sqlite3/creation.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
from django.db.backends.base.creation import BaseDatabaseCreation
|
||||
|
||||
|
||||
class DatabaseCreation(BaseDatabaseCreation):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
@staticmethod
|
||||
def is_in_memory_db(database_name: str) -> bool: ...
|
||||
def get_test_db_clone_settings(self, suffix: Any): ...
|
||||
def test_db_signature(self) -> Tuple[str, str]: ...
|
||||
31
django-stubs-generated/db/backends/sqlite3/features.pyi
Normal file
31
django-stubs-generated/db/backends/sqlite3/features.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
from typing import Optional
|
||||
|
||||
from django.db.backends.base.features import BaseDatabaseFeatures
|
||||
|
||||
|
||||
class DatabaseFeatures(BaseDatabaseFeatures):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
can_use_chunked_reads: bool = ...
|
||||
test_db_allows_multiple_connections: bool = ...
|
||||
supports_unspecified_pk: bool = ...
|
||||
supports_timezones: bool = ...
|
||||
max_query_params: int = ...
|
||||
supports_mixed_date_datetime_comparisons: bool = ...
|
||||
supports_column_check_constraints: bool = ...
|
||||
autocommits_when_autocommit_is_off: bool = ...
|
||||
can_introspect_decimal_field: bool = ...
|
||||
can_introspect_positive_integer_field: bool = ...
|
||||
can_introspect_small_integer_field: bool = ...
|
||||
supports_transactions: bool = ...
|
||||
atomic_transactions: bool = ...
|
||||
can_rollback_ddl: bool = ...
|
||||
supports_atomic_references_rename: bool = ...
|
||||
supports_paramstyle_pyformat: bool = ...
|
||||
supports_sequence_reset: bool = ...
|
||||
can_clone_databases: bool = ...
|
||||
supports_temporal_subtraction: bool = ...
|
||||
ignores_table_name_case: bool = ...
|
||||
supports_cast_with_precision: bool = ...
|
||||
uses_savepoints: bool = ...
|
||||
can_release_savepoints: bool = ...
|
||||
def supports_stddev(self) -> bool: ...
|
||||
42
django-stubs-generated/db/backends/sqlite3/introspection.pyi
Normal file
42
django-stubs-generated/db/backends/sqlite3/introspection.pyi
Normal file
@@ -0,0 +1,42 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.introspection import (BaseDatabaseIntrospection,
|
||||
FieldInfo, TableInfo)
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.fields import Field
|
||||
|
||||
field_size_re: Any
|
||||
|
||||
def get_field_size(name: str) -> Optional[int]: ...
|
||||
|
||||
class FlexibleFieldLookupDict:
|
||||
base_data_types_reverse: Any = ...
|
||||
def __getitem__(
|
||||
self, key: str
|
||||
) -> Union[Tuple[str, Dict[str, int]], str]: ...
|
||||
|
||||
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
data_types_reverse: Any = ...
|
||||
def get_table_list(self, cursor: CursorWrapper) -> List[TableInfo]: ...
|
||||
def get_table_description(
|
||||
self, cursor: CursorWrapper, table_name: str
|
||||
) -> List[FieldInfo]: ...
|
||||
def get_sequences(
|
||||
self,
|
||||
cursor: CursorWrapper,
|
||||
table_name: str,
|
||||
table_fields: List[Field] = ...,
|
||||
) -> List[Dict[str, str]]: ...
|
||||
def get_relations(
|
||||
self, cursor: CursorWrapper, table_name: str
|
||||
) -> Dict[str, Tuple[str, str]]: ...
|
||||
def get_key_columns(
|
||||
self, cursor: CursorWrapper, table_name: str
|
||||
) -> List[Tuple[str, str, str]]: ...
|
||||
def get_primary_key_column(
|
||||
self, cursor: CursorWrapper, table_name: str
|
||||
) -> Optional[str]: ...
|
||||
def get_constraints(
|
||||
self, cursor: CursorWrapper, table_name: str
|
||||
) -> Dict[str, Dict[str, Union[List[str], bool]]]: ...
|
||||
119
django-stubs-generated/db/backends/sqlite3/operations.pyi
Normal file
119
django-stubs-generated/db/backends/sqlite3/operations.pyi
Normal file
@@ -0,0 +1,119 @@
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.management.color import Style
|
||||
from django.db.backends.base.operations import BaseDatabaseOperations
|
||||
from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
||||
SQLiteCursorWrapper)
|
||||
from django.db.backends.utils import CursorDebugWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import (BaseExpression, Col, Expression, F,
|
||||
SQLiteNumericMixin)
|
||||
from django.db.models.fields import Field
|
||||
from django.utils.datastructures import ImmutableList
|
||||
|
||||
|
||||
class DatabaseOperations(BaseDatabaseOperations):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
cast_char_field_without_max_length: str = ...
|
||||
cast_data_types: Any = ...
|
||||
explain_prefix: str = ...
|
||||
def bulk_batch_size(
|
||||
self,
|
||||
fields: Union[List[Field], List[str], ImmutableList],
|
||||
objs: Union[List[Model], range],
|
||||
) -> int: ...
|
||||
def check_expression_support(
|
||||
self, expression: Union[BaseExpression, SQLiteNumericMixin]
|
||||
) -> None: ...
|
||||
def date_extract_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def date_interval_sql(self, timedelta: timedelta) -> str: ...
|
||||
def format_for_duration_arithmetic(self, sql: str) -> str: ...
|
||||
def date_trunc_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def time_trunc_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def datetime_cast_date_sql(
|
||||
self, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def datetime_cast_time_sql(
|
||||
self, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def datetime_extract_sql(
|
||||
self, lookup_type: str, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def datetime_trunc_sql(
|
||||
self, lookup_type: str, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def time_extract_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def pk_default_value(self) -> str: ...
|
||||
def last_executed_query(
|
||||
self,
|
||||
cursor: Union[SQLiteCursorWrapper, CursorDebugWrapper],
|
||||
sql: str,
|
||||
params: Optional[Union[List[int], List[str], Tuple]],
|
||||
) -> str: ...
|
||||
def quote_name(self, name: str) -> str: ...
|
||||
def no_limit_value(self) -> int: ...
|
||||
def sql_flush(
|
||||
self,
|
||||
style: Style,
|
||||
tables: List[str],
|
||||
sequences: Union[List[Dict[str, str]], Tuple],
|
||||
allow_cascade: bool = ...,
|
||||
) -> List[str]: ...
|
||||
def execute_sql_flush(self, using: str, sql_list: List[str]) -> None: ...
|
||||
def adapt_datetimefield_value(
|
||||
self, value: Optional[Union[datetime, F]]
|
||||
) -> Optional[Union[F, str]]: ...
|
||||
def adapt_timefield_value(
|
||||
self, value: Optional[Union[time, F]]
|
||||
) -> Optional[Union[F, str]]: ...
|
||||
def get_db_converters(self, expression: Expression) -> List[Callable]: ...
|
||||
def convert_datetimefield_value(
|
||||
self,
|
||||
value: Optional[Union[datetime, str]],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[datetime]: ...
|
||||
def convert_datefield_value(
|
||||
self,
|
||||
value: Optional[Union[date, str]],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[date]: ...
|
||||
def convert_timefield_value(
|
||||
self,
|
||||
value: Optional[Union[time, str]],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[time]: ...
|
||||
def get_decimalfield_converter(
|
||||
self, expression: Expression
|
||||
) -> Callable: ...
|
||||
def convert_uuidfield_value(
|
||||
self, value: Optional[str], expression: Col, connection: DatabaseWrapper
|
||||
) -> Optional[UUID]: ...
|
||||
def convert_booleanfield_value(
|
||||
self,
|
||||
value: Optional[int],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[bool]: ...
|
||||
def bulk_insert_sql(
|
||||
self,
|
||||
fields: Union[List[None], List[Field], ImmutableList],
|
||||
placeholder_rows: Union[List[Any], Tuple[Tuple[str]]],
|
||||
) -> str: ...
|
||||
def combine_expression(
|
||||
self, connector: str, sub_expressions: List[str]
|
||||
) -> str: ...
|
||||
def combine_duration_expression(
|
||||
self, connector: str, sub_expressions: List[str]
|
||||
) -> str: ...
|
||||
def integer_field_range(self, internal_type: str) -> Tuple[None, None]: ...
|
||||
def subtract_temporals(
|
||||
self,
|
||||
internal_type: str,
|
||||
lhs: Tuple[str, List[Any]],
|
||||
rhs: Tuple[str, List[str]],
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
40
django-stubs-generated/db/backends/sqlite3/schema.pyi
Normal file
40
django-stubs-generated/db/backends/sqlite3/schema.pyi
Normal file
@@ -0,0 +1,40 @@
|
||||
from typing import Any, Optional, Type, Union
|
||||
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||
atomic_migration: bool
|
||||
collect_sql: bool
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
sql_delete_table: str = ...
|
||||
sql_create_fk: Any = ...
|
||||
sql_create_inline_fk: str = ...
|
||||
sql_create_unique: str = ...
|
||||
sql_delete_unique: str = ...
|
||||
def __enter__(self) -> DatabaseSchemaEditor: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
def quote_value(self, value: Optional[Union[int, str]]) -> str: ...
|
||||
def alter_db_table(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_db_table: str,
|
||||
new_db_table: str,
|
||||
disable_constraints: bool = ...,
|
||||
) -> None: ...
|
||||
def alter_field(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_field: Field,
|
||||
new_field: Field,
|
||||
strict: bool = ...,
|
||||
) -> None: ...
|
||||
def delete_model(
|
||||
self, model: Type[Model], handle_autom2m: bool = ...
|
||||
) -> None: ...
|
||||
def add_field(self, model: Type[Model], field: Field) -> None: ...
|
||||
def remove_field(self, model: Type[Model], field: Field) -> None: ...
|
||||
Reference in New Issue
Block a user