asynctnt
Subpackages
Submodules
Package Contents
Classes
Functions
|
connect shorthand. See |
Attributes
- class asynctnt.Connection(*, host: str = '127.0.0.1', port: int | str = 3301, username: str | None = None, password: str | None = None, fetch_schema: bool = True, auto_refetch_schema: bool = True, connect_timeout: float = 3.0, request_timeout: float = -1.0, reconnect_timeout: float = 1.0 / 3.0, ping_timeout: float = 5.0, encoding: str | None = None, initial_read_buffer_size: int | None = None)[source]
Bases:
asynctnt.api.Api
- property fingerprint: str
- property host: str
Tarantool host
- property port: int
Tarantool port
- property username: str | None
Tarantool username
- property password: str | None
Tarantool password
- property fetch_schema: bool
fetch_schema flag
- property auto_refetch_schema: bool
auto_refetch_schema flag
- property encoding: str
Connection encoding
- property reconnect_timeout: float
Reconnect timeout value
- property connect_timeout: float
Connect timeout value
- property request_timeout: float
Request timeout value
- property version: tuple | None
Protocol version tuple. ex.: (1, 6, 7)
- property state: ConnectionState
Current connection state
- Return type:
- property is_connected: bool
Check if an underlying connection is active
- property is_fully_connected: bool
Check if connection is fully active (performed auth and schema fetching)
- property schema_id: int | None
Tarantool’s current schema id
- property schema: asynctnt.iproto.protocol.Schema | None
Current Tarantool schema with all spaces, indexes and fields
- property initial_read_buffer_size: int
initial_read_buffer_size value
- __slots__ = ('_host', '_port', '_username', '_password', '_fetch_schema', '_auto_refetch_schema',...
- _set_state(new_state: ConnectionState)[source]
- protocol_factory(connected_fut: asyncio.Future, loop: asyncio.AbstractEventLoop, cls: Type[asynctnt.iproto.protocol.Protocol] = protocol.Protocol)[source]
- async connect() Connection [source]
Connect coroutine
- close()[source]
Same as disconnect, but not a coroutine, i.e. it does not wait for disconnect to finish.
- async __aenter__()[source]
Executed on entering the async with section. Connects to Tarantool instance.
- async __aexit__(exc_type, exc_val, exc_tb)[source]
Executed on leaving the async with section. Disconnects from Tarantool instance.
- stream() asynctnt.stream.Stream [source]
Create new stream suitable for interactive transactions
- async asynctnt.connect(**kwargs) Connection [source]
connect shorthand. See
asynctnt.Connection
for kwargs details- Returns:
asynctnt.Connection
object
- class asynctnt.Db[source]
- property stream_id: int
- class asynctnt.Field[source]
- name: str | None
Field name
- type: str | None
Field type
- collation: str | None
Field collation value
- is_nullable: bool | None
If field may be null
- is_autoincrement: bool | None
Is Autoincrement
- span: str | None
- class asynctnt.IProtoError[source]
- trace: List[IProtoErrorStackFrame]
- class asynctnt.IProtoErrorStackFrame[source]
- error_type: str
- file: str
- line: int
- message: str
- err_no: int
- code: int
- fields: Dict[str, Any]
- class asynctnt.Response[source]
- property sync: int
- property code: int
- property return_code: int
- property schema_id: int
- property stmt_id: int
- property rowcount: int
- errmsg: str | None
- error: IProtoError | None
- encoding: bytes
- autoincrement_ids: List[int] | None
- body: List[BodyItem] | None
- params_count: int
- class asynctnt.Schema[source]
- id: int
- spaces: Dict[str | int, SchemaSpace]
- class asynctnt.SchemaIndex[source]
- iid: int
Index id
- sid: int
Space id
- name: str | None
- index_type: str | None
- unique: bool | None
- class asynctnt.SchemaSpace[source]
- sid: int
- owner: int
- name: str | None
- engine: str | None
- field_count: int
- flags: Any | None
- indexes: Dict[int | str, SchemaIndex]