pub enum Request {
Show 16 variants
Hello {
min_version: u32,
max_version: u32,
core_version: String,
plugin: Option<PluginId>,
},
Describe {},
Validate {
options: Map<String, Value>,
template: Option<Value>,
},
ValidateConnection {
connection: Map<String, Value>,
unresolved: Vec<String>,
},
Open {
connection: Map<String, Value>,
read_only: bool,
sandbox: bool,
},
Execute {
sql: String,
row_limit: Option<u64>,
},
Check {
sql: String,
},
Catalog {
tables: Vec<String>,
schemas: Vec<String>,
},
Write {
path: String,
format: String,
options: Map<String, Value>,
result_sets: Vec<ResultSetMeta>,
font_requests: bool,
template: Option<Value>,
},
Fonts {
paths: Vec<String>,
error: Option<String>,
repeated: bool,
},
ResultSetEnd {},
Finish {},
Deliver {
local_path: Option<String>,
remote_path: Option<String>,
files: Vec<DeliveryFile>,
connection: Map<String, Value>,
options: Map<String, Value>,
message: Option<Message>,
},
Load {
name: String,
},
Close {},
Cancel {},
}Expand description
Core → plugin.
Variants§
Hello
Always first. The plugin picks a version in both ranges or replies version_mismatch.
Fields
Describe
Describe the connection fields a profile output for this plugin takes (used by dre init)
and the options a report’s config block for it takes.
Validate
Check one config block of options (a format’s output: keys, a destination entry’s keys)
without doing anything. Replies validated.
Fields
ValidateConnection
Source or destination (protocol 1): check a profile entry’s connection settings without
connecting: the declared fields’ generic checks, then the plugin’s own rules. Keys in
unresolved (an unset env_var()) arrive as null and count as set, unchecked. Replies
validated, with warnings for unknown keys.
Open
Source: open a session. All later execute/check requests run on it.
Fields
Execute
Source: run one statement. Replies result (then Arrow frames, then result_end) or
no_result.
Check
Source: verify one statement without executing it. Replies ok or error.
Catalog
Source advertising catalog: discover accessible relations through native metadata.
Write
Format: write result sets to path. Followed, per result set, by Arrow frames (at least one,
carrying the schema) and a result_set_end, then finish. Replies written.
Fields
result_sets: Vec<ResultSetMeta>Fonts
Reply to a font request within a write; retains the write request id. repeated is set
when core already gave this font’s error earlier in the run, so the person has been
told once and the format needn’t warn again.
ResultSetEnd
Finish
Deliver
Destination: deliver a local file, or with files (only to a plugin advertising
multi_file) every file of one output at once. Exactly one of local_path/files is set,
unless message is: then files (possibly empty) holds the files to attach to it, and is
sent only to a plugin advertising message. options are the destination entry’s plugin
options, rendered by core. Replies delivered.
Fields
files: Vec<DeliveryFile>Load
Source: load rows into a temporary table on the session, named after name. Followed by
Arrow frames (at least one, carrying the schema) and a result_set_end. Replies loaded.
Only sent to plugins advertising load.
Close
End the conversation; the plugin exits 0.
Cancel
Protocol 1: stop the request whose id the envelope carries. It has no reply of its own:
the request replies error with kind cancelled, or its usual reply if it finished
first. A cancel for a request that isn’t running is ignored.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Request
impl<'de> Deserialize<'de> for Request
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Request
impl JsonSchema for Request
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more