Source code for asynctnt.iproto.protocol

import asyncio
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union

from asynctnt.iproto.protocol import Adjust

[docs] class Field:
[docs] name: Optional[str]
""" Field name """
[docs] type: Optional[str]
""" Field type """
[docs] collation: Optional[str]
""" Field collation value """
[docs] is_nullable: Optional[bool]
""" If field may be null """
[docs] is_autoincrement: Optional[bool]
""" Is Autoincrement """
[docs] span: Optional[str]
[docs] class Metadata:
[docs] fields: List[Field]
""" List of fields """
[docs] name_id_map: Dict[str, int]
""" Mapping name -> id """
[docs] class SchemaIndex:
[docs] iid: int
""" Index id """
[docs] sid: int
""" Space id """
[docs] name: Optional[str]
[docs] index_type: Optional[str]
[docs] unique: Optional[bool]
[docs] metadata: Optional[Metadata]
[docs] class SchemaSpace:
[docs] sid: int
[docs] owner: int
[docs] name: Optional[str]
[docs] engine: Optional[str]
[docs] field_count: int
[docs] flags: Optional[Any]
[docs] metadata: Optional[Metadata]
[docs] indexes: Dict[Union[int, str], SchemaIndex]
[docs] class Schema:
[docs] id: int
[docs] spaces: Dict[Union[str, int], SchemaSpace]
[docs] class TarantoolTuple:
[docs] def __repr__(self) -> str: ...
[docs] def __index__(self, i: int) -> Any: ...
[docs] def __len__(self) -> int: ...
[docs] def __contains__(self, item: str) -> bool: ...
[docs] def __getitem__(self, item: Union[int, str, slice]) -> Any: ...
[docs] def keys(self) -> Iterator[str]: ...
[docs] def values(self) -> Iterator[Any]: ...
[docs] def items(self) -> Iterator[Tuple[str, Any]]: ...
[docs] def get(self, item: str) -> Optional[Any]: ...
[docs] def __iter__(self): ...
[docs] def __next__(self): ...
[docs] class IProtoErrorStackFrame:
[docs] error_type: str
[docs] file: str
[docs] line: int
[docs] message: str
[docs] err_no: int
[docs] code: int
[docs] fields: Dict[str, Any]
[docs] class IProtoError:
[docs] trace: List[IProtoErrorStackFrame]
[docs] BodyItem = Union[TarantoolTuple, List[Any], Dict[Any, Any], Any]
[docs] class Response:
[docs] errmsg: Optional[str]
[docs] error: Optional[IProtoError]
[docs] encoding: bytes
[docs] autoincrement_ids: Optional[List[int]]
[docs] body: Optional[List[BodyItem]]
[docs] metadata: Optional[Metadata]
[docs] params: Optional[Metadata]
[docs] params_count: int
@property
[docs] def sync(self) -> int: ...
@property
[docs] def code(self) -> int: ...
@property
[docs] def return_code(self) -> int: ...
@property
[docs] def schema_id(self) -> int: ...
@property
[docs] def stmt_id(self) -> int: ...
@property
[docs] def rowcount(self) -> int: ...
[docs] def done(self) -> bool: ...
[docs] def __len__(self) -> int: ...
[docs] def __getitem__(self, i) -> BodyItem: ...
[docs] def __iter__(self): ...
[docs] class PushIterator: def __init__(self, fut: asyncio.Future): ...
[docs] def __iter__(self): ...
[docs] def __next__(self): ...
[docs] def __aiter__(self): ...
[docs] async def __anext__(self): ...
@property
[docs] def response(self) -> Response: ...
[docs] class Db: @property
[docs] def stream_id(self) -> int: ...
[docs] def set_stream_id(self, stream_id: int): ...
[docs] def ping(self, timeout: float = -1): ...
[docs] def call16( self, func_name: str, args=None, timeout: float = -1, push_subscribe: bool = False, ): ...
[docs] def call( self, func_name: str, args=None, timeout: float = -1, push_subscribe: bool = False, ): ...
[docs] def eval( self, expression: str, args=None, timeout: float = -1, push_subscribe: bool = False, ): ...
[docs] def select( self, space, key=None, offset: int = 0, limit: int = 0xFFFFFFFF, index=0, iterator=0, timeout: float = -1, check_schema_change: bool = True, ): ...
[docs] def insert(self, space, t, replace: bool = False, timeout: float = -1): ...
[docs] def replace(self, space, t, timeout: float = -1): ...
[docs] def delete(self, space, key, index=0, timeout: float = -1): ...
[docs] def update(self, space, key, operations, index=0, timeout: float = -1): ...
[docs] def upsert(self, space, t, operations, timeout: float = -1): ...
[docs] def execute( self, query, args, parse_metadata: bool = True, timeout: float = -1 ): ...
[docs] def prepare(self, query, parse_metadata: bool = True, timeout: float = -1): ...
[docs] def begin(self, isolation: int, tx_timeout: float, timeout: float = -1): ...
[docs] def commit(self, timeout: float = -1): ...
[docs] def rollback(self, timeout: float = -1): ...
[docs] class Protocol: @property
[docs] def schema_id(self) -> int: ...
@property
[docs] def schema(self) -> Schema: ...
@property
[docs] def features(self) -> IProtoFeatures: ...
[docs] def create_db(self, gen_stream_id: bool = False) -> Db: ...
[docs] def get_common_db(self) -> Db: ...
[docs] def refetch_schema(self) -> asyncio.Future: ...
[docs] def is_connected(self) -> bool: ...
[docs] def is_fully_connected(self) -> bool: ...
[docs] def get_version(self) -> tuple: ...
[docs] class MPInterval:
[docs] year: int
[docs] month: int
[docs] week: int
[docs] day: int
[docs] hour: int
[docs] min: int
[docs] sec: int
[docs] nsec: int
[docs] adjust: Adjust
def __init__( self, year: int = 0, month: int = 0, week: int = 0, day: int = 0, hour: int = 0, min: int = 0, sec: int = 0, nsec: int = 0, adjust: Adjust = Adjust.NONE, ): ...
[docs] def __eq__(self, other) -> bool: ...
[docs] class IProtoFeatures:
[docs] streams: bool
[docs] transactions: bool
[docs] error_extension: bool
[docs] watchers: bool
[docs] pagination: bool
[docs] space_and_index_names: bool
[docs] watch_once: bool
[docs] dml_tuple_extension: bool
[docs] call_ret_tuple_extension: bool
[docs] call_arg_tuple_extension: bool