Replies: 3 comments 1 reply
-
UPDATE
struct Execute {
// Message type ('O').
uint8 mtype = 0x4f;
// Length of message contents in bytes,
// including self.
uint32 message_length;
// A set of message headers.
uint16 num_headers;
Header headers[num_headers];
// Data I/O format.
uint8<IOFormat> io_format;
// Expected result cardinality.
uint8<Cardinality> expected_cardinality;
// Command text.
string command_text;
// Argument data descriptor ID.
uuid input_typedesc_id;
// Output data descriptor ID.
uuid output_typedesc_id;
+
+ // Session state descriptor ID.
+ uuid state_typedesc_id;
// Encoded argument data.
bytes arguments;
+
+ // Encoded state data.
+ bytes state_data;
};
|
Beta Was this translation helpful? Give feedback.
-
UPDATE 2State is still needed in struct Parse {
// Message type ('P').
uint8 mtype = 0x50;
// Length of message contents in bytes,
// including self.
uint32 message_length;
// A set of message headers.
uint16 num_headers;
Header headers[num_headers];
// A bit mask of allowed capabilities.
uint64<Capability> allowed_capabilities;
// A bit mask of query options.
uint64<CompilationFlag> compilation_flags;
// Implicit LIMIT clause on returned sets.
uint64 implicit_limit;
// Data output format.
uint8<OutputFormat> output_format;
// Expected result cardinality.
uint8<Cardinality> expected_cardinality;
// Command text.
string command_text;
+
+ // State data descriptor ID.
+ uuid state_typedesc_id;
+
+ // Encoded state data.
+ bytes state_data;
};
struct Execute {
// Message type ('O').
uint8 mtype = 0x4f;
// Length of message contents in bytes,
// including self.
uint32 message_length;
// A set of message headers.
uint16 num_headers;
Header headers[num_headers];
// A bit mask of allowed capabilities.
uint64<Capability> allowed_capabilities;
// A bit mask of query options.
uint64<CompilationFlag> compilation_flags;
// Implicit LIMIT clause on returned sets.
uint64 implicit_limit;
// Data output format.
uint8<OutputFormat> output_format;
// Expected result cardinality.
uint8<Cardinality> expected_cardinality;
// Command text.
string command_text;
+
+ // State data descriptor ID.
+ uuid state_typedesc_id;
+
+ // Encoded state data.
+ bytes state_data;
// Argument data descriptor ID.
uuid input_typedesc_id;
// Output data descriptor ID.
uuid output_typedesc_id;
// Encoded argument data.
bytes arguments;
}; |
Beta Was this translation helpful? Give feedback.
-
UPDATE 3We would like to drop the asynchronous We will add a new message
This message will be sent when: 1.
|
Beta Was this translation helpful? Give feedback.
-
This is superseded by #4009.
Server Notifications of Session State Type
On connection, the server will send a
ParameterStatus
message with namesession_state_description
, and value as described in:The same
ParameterStatus
message will also be pushed to all active connections when an DDL command that affects the session state type is applied successfully, like acreate global
command.Theoretically the client could use this message to build encoders/decoders so as to read or manipulate the session state, but the official client bindings are not yet doing anything with this message.
Server Responses with Session State
All server
CommandComplete
messages will send two extra fields as the most recent session state:The exact encoding of
DataElement.data
is defined by the session state type descriptor. The session state is a free object like this:The client is supposed to store (overwrite if exist) the
state_typedesc_id
andstate_data
per connection, and sends them together with the nextParse
orExecute
message, please see below.When a DDL command is successfully applied, it may modify session state fields that already have data in the current session, for example:
In this case, instead of returning
CommandComplete
, the server will instead return a new message:error_code
is set to a new error typeStateSerializationError
. This message means the DDL command is applied successfully, but the state cannot be serialized. The client could either choose to drop the connection (official client binding behavior), or update the state according to the type descriptor in theParameterStatus
message and move on.Client Requests with Session State
The client will send two extra fields in messages
Parse
andExecute
:state_typedesc_id
andstate_data
should be set to the most recently received state data from the server inCommandComplete
messages. In case when the client doesn't have a stored state, or doesn't want to send a message with state data,state_typedesc_id
can be set to a special ID of zero:00000000-0000-0000-0000-000000000000
, indicating an empty/default state.On receiving these messages, the server would check the
state_typedesc_id
against the current one of the current database. On mismatch, the server will send anErrorResponse
message with a new error type:StateMismatchError
. The client is safe to retry with an updated state, or simply drop the connection with an error (current official client bindings behavior).Capabilities in Official Client Bindings
The client bindings shall provide
withGlobals()
API for setting globals. At the same time, EdgeQL commandSET GLOBAL
should be forbidden in official client bindings. In RFC 1010,set global
requires the capabilitysession config
, but that is also used byconfigure session
commands. So we'd probably need a new capability forset global
andreset global
commands, likesession global
or so.Beta Was this translation helpful? Give feedback.
All reactions