mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-12 06:51:53 +08:00
Update RunSQL type to include parametrized sql (#1015)
* update RunSQL type to include parametrized sql * fix Black formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
from typing import Any, Mapping, Optional, Sequence, Union
|
from typing import Any, Mapping, Optional, Sequence, Tuple, Union
|
||||||
|
|
||||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||||
from django.db.migrations.state import StateApps
|
from django.db.migrations.state import StateApps
|
||||||
@@ -21,14 +21,16 @@ class SeparateDatabaseAndState(Operation):
|
|||||||
|
|
||||||
class RunSQL(Operation):
|
class RunSQL(Operation):
|
||||||
noop: Literal[""] = ...
|
noop: Literal[""] = ...
|
||||||
sql: Union[str, _ListOrTuple[str]] = ...
|
sql: Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]] = ...
|
||||||
reverse_sql: Optional[Union[str, _ListOrTuple[str]]] = ...
|
reverse_sql: Optional[Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]]] = ...
|
||||||
state_operations: Sequence[Operation] = ...
|
state_operations: Sequence[Operation] = ...
|
||||||
hints: Mapping[str, Any] = ...
|
hints: Mapping[str, Any] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
sql: Union[str, _ListOrTuple[str]],
|
sql: Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]],
|
||||||
reverse_sql: Optional[Union[str, _ListOrTuple[str]]] = ...,
|
reverse_sql: Optional[
|
||||||
|
Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]]
|
||||||
|
] = ...,
|
||||||
state_operations: Sequence[Operation] = ...,
|
state_operations: Sequence[Operation] = ...,
|
||||||
hints: Optional[Mapping[str, Any]] = ...,
|
hints: Optional[Mapping[str, Any]] = ...,
|
||||||
elidable: bool = ...,
|
elidable: bool = ...,
|
||||||
|
|||||||
Reference in New Issue
Block a user