Skip to main content

Request

Enum Request 

Source
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

§min_version: u32
§max_version: u32
§core_version: String
§plugin: Option<PluginId>

The plugin core wants served, for an executable that provides several. A package that doesn’t provide it replies error; without it, the package serves its first.

§

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

§options: Map<String, Value>
§template: Option<Value>

Format: what the plugin needs to check the output’s template too. For the html and pdf formats, {"file": <absolute path or null>, "project_root", "queries": [...]}. Optional; older plugins ignore it.

§

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.

Fields

§connection: Map<String, Value>
§unresolved: Vec<String>
§

Open

Source: open a session. All later execute/check requests run on it.

Fields

§connection: Map<String, Value>
§read_only: bool
§sandbox: bool

Core’s dre query: the session must not reach files, programs or the network beyond the database (protocol 1, optional; older plugins ignore it).

§

Execute

Source: run one statement. Replies result (then Arrow frames, then result_end) or no_result.

Fields

§row_limit: Option<u64>
§

Check

Source: verify one statement without executing it. Replies ok or error.

Fields

§

Catalog

Source advertising catalog: discover accessible relations through native metadata.

Fields

§tables: Vec<String>
§schemas: Vec<String>
§

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

§path: String
§format: String
§options: Map<String, Value>
§result_sets: Vec<ResultSetMeta>
§font_requests: bool

Core can answer need_fonts during this write. Absent on older cores.

§template: Option<Value>
§

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.

Fields

§paths: Vec<String>
§repeated: bool
§

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

§local_path: Option<String>
§remote_path: Option<String>
§connection: Map<String, Value>
§options: Map<String, Value>
§message: Option<Message>
§

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.

Fields

§name: String
§

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 Clone for Request

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Request

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Request

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Request

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Request

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Request

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.