improved version

This commit is contained in:
Maxim Kurnikov
2018-07-29 20:06:41 +03:00
parent c180555415
commit 89bb6eac75
160 changed files with 1007 additions and 607 deletions

View File

@@ -27,5 +27,5 @@ class BaseDatabaseCreation:
suffix: None = ...
) -> None: ...
def serialize_db_to_string(self) -> str: ...
def set_as_test_mirror(self, primary_settings_dict: Dict[str, Union[str, int, None, Dict[str, None]]]) -> None: ...
def set_as_test_mirror(self, primary_settings_dict: Dict[str, Optional[Union[str, int, Dict[str, None]]]]) -> None: ...
def test_db_signature(self) -> Tuple[str, str, str, str]: ...

View File

@@ -5,18 +5,27 @@ from datetime import (
timedelta,
)
from decimal import Decimal
from django.contrib.auth.models import (
Group,
User,
)
from django.contrib.sites.models import Site
from django.core.management.color import Style
from django.db import DefaultConnectionProxy
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.db.backends.utils import CursorWrapper
from django.db.models.base import Model
from django.db.models.expressions import Expression
from django.db.models.fields import Field
from django.db.models.sql.compiler import SQLCompiler
from typing import (
Any,
List,
Optional,
Set,
Tuple,
Type,
Union,
)
@@ -35,15 +44,15 @@ class BaseDatabaseOperations:
decimal_places: Optional[int] = ...
) -> Optional[str]: ...
def adapt_ipaddressfield_value(self, value: Optional[str]) -> Optional[str]: ...
def adapt_timefield_value(self, value: Optional[Union[time, datetime]]) -> Optional[str]: ...
def adapt_unknown_value(self, value: Union[Decimal, time, date, int]) -> Union[str, int]: ...
def adapt_timefield_value(self, value: Optional[Union[datetime, time]]) -> Optional[str]: ...
def adapt_unknown_value(self, value: Union[date, time, int, Decimal]) -> Union[str, int]: ...
def autoinc_sql(self, table: str, column: str) -> None: ...
def binary_placeholder_sql(self, value: Optional[memoryview]) -> str: ...
def combine_expression(self, connector: str, sub_expressions: List[str]) -> str: ...
def compiler(self, compiler_name: str) -> Any: ...
def compiler(self, compiler_name: str) -> Type[SQLCompiler]: ...
def convert_durationfield_value(
self,
value: Optional[Union[float, int]],
value: Optional[float],
expression: Expression,
connection: DatabaseWrapper
) -> Optional[timedelta]: ...
@@ -70,7 +79,11 @@ class BaseDatabaseOperations:
def savepoint_create_sql(self, sid: str) -> str: ...
def savepoint_rollback_sql(self, sid: str) -> str: ...
def sequence_reset_by_name_sql(self, style: None, sequences: List[Any]) -> List[Any]: ...
def sequence_reset_sql(self, style: Style, model_list: Any) -> List[Any]: ...
def sequence_reset_sql(
self,
style: Style,
model_list: Union[Set[Type[Model]], List[Type[Model]], Set[Type[Union[Group, User]]], List[Type[Site]]]
) -> List[Any]: ...
def set_time_zone_sql(self) -> str: ...
def tablespace_sql(self, tablespace: str, inline: bool = ...) -> str: ...
def time_extract_sql(self, lookup_type: None, field_name: None): ...

View File

@@ -37,12 +37,12 @@ class BaseDatabaseSchemaEditor:
def _create_index_name(
self,
table_name: str,
column_names: Union[Tuple[str, str, str], Tuple[str], List[str]],
column_names: Union[Tuple[str, str, str], List[str], Tuple[str]],
suffix: str = ...
) -> str: ...
def _create_index_sql(
self,
model: Any,
model: Type[Model],
fields: Any,
*,
name = ...,
@@ -52,7 +52,11 @@ class BaseDatabaseSchemaEditor:
col_suffixes = ...,
sql = ...
) -> Statement: ...
def _create_unique_sql(self, model: Any, columns: List[str]) -> Statement: ...
def _create_unique_sql(
self,
model: Type[Model],
columns: List[str]
) -> Statement: ...
def _delete_composed_index(
self,
model: Type[Model],
@@ -64,6 +68,6 @@ class BaseDatabaseSchemaEditor:
def _digest(cls, *args) -> str: ...
def _field_indexes_sql(
self,
model: Any,
model: Type[Model],
field: Field
) -> List[Statement]: ...