asynctnt
Submodules
Attributes
Classes
Functions
|
connect shorthand. See |
Package Contents
- 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
- __slots__ = ('_host', '_port', '_username', '_password', '_fetch_schema', '_auto_refetch_schema',...
- _host = '127.0.0.1'
- _port = 3301
- _username = None
- _password = None
- _fetch_schema = False
- _initial_read_buffer_size = None
- _encoding = 'utf-8'
- _connect_timeout = 3.0
- _reconnect_timeout = 0.3333333333333333
- _request_timeout = -1.0
- _ping_timeout = 5.0
- _transport = None
- _protocol: asynctnt.iproto.protocol.Protocol | None = None
- _state
- _state_prev
- _disconnect_waiter = None
- _reconnect_task = None
- _connect_lock
- _disconnect_lock
- _ping_task = None
- _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__() Connection [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.
- 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
- stream() asynctnt.stream.Stream [source]
Create new stream suitable for interactive transactions
- property features: asynctnt.iproto.protocol.IProtoFeatures
Lookup available Tarantool features - https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_iproto/feature/ :return:
- 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.MPInterval(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)[source]
- year: int
- month: int
- week: int
- day: int
- hour: int
- min: int
- sec: int
- nsec: int
- adjust: Adjust
- class asynctnt.Response[source]
- errmsg: str | None
- error: IProtoError | None
- encoding: bytes
- autoincrement_ids: List[int] | None
- body: List[BodyItem] | None
- params_count: int
- property sync: int
- property code: int
- property return_code: int
- property schema_id: int
- property stmt_id: int
- property rowcount: 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]