mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
36 lines
1.4 KiB
Python
36 lines
1.4 KiB
Python
from contextlib import ContextDecorator
|
|
from typing import Any, Callable, Optional, Union, ContextManager
|
|
|
|
from django.db import ProgrammingError
|
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
|
|
|
|
|
class TransactionManagementError(ProgrammingError): ...
|
|
|
|
def get_connection(using: Optional[str] = ...) -> DatabaseWrapper: ...
|
|
def get_autocommit(using: Optional[str] = ...) -> bool: ...
|
|
def set_autocommit(autocommit: bool, using: None = ...) -> Any: ...
|
|
def commit(using: None = ...) -> Any: ...
|
|
def rollback(using: None = ...) -> Any: ...
|
|
def savepoint(using: None = ...) -> str: ...
|
|
def savepoint_rollback(sid: str, using: None = ...) -> None: ...
|
|
def savepoint_commit(sid: Any, using: Optional[Any] = ...) -> None: ...
|
|
def clean_savepoints(using: Optional[Any] = ...) -> None: ...
|
|
def get_rollback(using: None = ...) -> bool: ...
|
|
def set_rollback(rollback: bool, using: Optional[str] = ...) -> None: ...
|
|
def on_commit(func: Callable, using: None = ...) -> None: ...
|
|
|
|
class Atomic(ContextDecorator):
|
|
using: Optional[str] = ...
|
|
savepoint: bool = ...
|
|
def __init__(self, using: Optional[str], savepoint: bool) -> None: ...
|
|
def __enter__(self) -> None: ...
|
|
def __exit__(
|
|
self, exc_type: None, exc_value: None, traceback: None
|
|
) -> None: ...
|
|
|
|
def atomic(
|
|
using: Optional[Union[Callable, str]] = ..., savepoint: bool = ...
|
|
) -> ContextManager[Atomic]: ...
|
|
def non_atomic_requests(using: Callable = ...) -> Callable: ...
|