pub enum Request {
Hello {
min_version: u32,
max_version: u32,
core_version: String,
plugin: Option<PluginId>,
},
Describe {},
Validate {
options: Map<String, Value>,
},
Open {
connection: Map<String, Value>,
read_only: bool,
},
Execute {
sql: String,
row_limit: Option<u64>,
},
Check {
sql: String,
},
Write {
path: String,
format: String,
options: Map<String, Value>,
result_sets: Vec<ResultSetMeta>,
template: Option<Value>,
},
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 {},
}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.
Open
Source: open a session. All later execute/check requests run on it.
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.
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>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.