module tarantool.response
¶
Request response types definitions.
- class tarantool.response.Response(conn, response)¶
Represents a single response from the server in compliance with the Tarantool protocol. Responsible for data encapsulation (i.e. received list of tuples) and parsing of binary packets received from the server.
- Parameters:
conn¶ (
Connection
) – Request sender.
- Raise:
- count(value)¶
Refer to
collections.abc.Sequence
.- Raises:
- property data¶
- Type:
Contains the list of tuples for SELECT, REPLACE and DELETE requests and arbitrary data for CALL.
- index(*args)¶
Refer to
collections.abc.Sequence
.- Raises:
- property return_code¶
- Type:
If the request was successful, the value of is
0
. Otherwise, it contains an error code. If the value is non-zero,return_message
contains an error message.
- property return_message¶
- Type:
The error message returned by the server in case of non-zero
return_code
(empty string otherwise).
- property strerror¶
Refer to
tnt_strerror()
.
- class tarantool.response.ResponseExecute(conn, response)¶
Represents an SQL EXECUTE request response.
- Parameters:
conn¶ (
Connection
) – Request sender.
- Raise:
- property affected_row_count¶
The number of changed rows for responses to DML requests and
None
for DQL requests.
- property autoincrement_ids¶
A list with the new primary-key value (or values) for an INSERT in a table defined with PRIMARY KEY AUTOINCREMENT (NOT result set size).
- count(value)¶
Refer to
collections.abc.Sequence
.- Raises:
- property data¶
- Type:
Contains the list of tuples for SELECT, REPLACE and DELETE requests and arbitrary data for CALL.
- index(*args)¶
Refer to
collections.abc.Sequence
.- Raises:
- property return_code¶
- Type:
If the request was successful, the value of is
0
. Otherwise, it contains an error code. If the value is non-zero,return_message
contains an error message.
- property return_message¶
- Type:
The error message returned by the server in case of non-zero
return_code
(empty string otherwise).
- property strerror¶
Refer to
tnt_strerror()
.
- class tarantool.response.ResponseProtocolVersion(conn, response)¶
Represents an ID request response: information about server protocol version and features it supports.
- Parameters:
conn¶ (
Connection
) – Request sender.
- Raise:
- count(value)¶
Refer to
collections.abc.Sequence
.- Raises:
- property data¶
- Type:
Contains the list of tuples for SELECT, REPLACE and DELETE requests and arbitrary data for CALL.
- index(*args)¶
Refer to
collections.abc.Sequence
.- Raises:
- property return_code¶
- Type:
If the request was successful, the value of is
0
. Otherwise, it contains an error code. If the value is non-zero,return_message
contains an error message.
- property return_message¶
- Type:
The error message returned by the server in case of non-zero
return_code
(empty string otherwise).
- property strerror¶
Refer to
tnt_strerror()
.
- tarantool.response.unpacker_factory(conn)¶
Build unpacker to unpack request response.
- Parameters:
conn¶ (
Connection
) – Request sender.- Return type: