pub struct CopyQueryParams {
pub sql: String,
pub target_table: String,
pub mode: String,
pub target_database: Option<String>,
pub temp_attach: Option<Vec<AttachSpec>>,
}Expand description
Parameters for the copy_query tool. Runs a read-only SELECT / WITH
/ VALUES statement and lands the result into a target table.
The inner sql may reference tables in the primary workspace
(unqualified) as well as tables in any attachment by its fully
qualified form — e.g. src.public.customers. The destination is
resolved via target_database (main workspace by default).
Fields§
§sql: StringRead-only SQL statement whose result rows will be inserted into
target_table. Must begin with SELECT, WITH, or VALUES.
EXPLAIN / SHOW are rejected because their output shape isn’t
row-compatible with a target table.
target_table: StringUnqualified destination table name. Always lands in the
public schema of the database identified by target_database.
mode: StringHow to reconcile with any existing target table:
"create"— error if the target already exists; create from the query’s result schema viaCREATE TABLE AS."append"— error if the target does not exist; rows are appended viaINSERT INTO ... SELECT."replace"— drop (if any) and recreate, atomically.
target_database: Option<String>Alias of the destination database. None and "local" both
mean the server’s primary workspace. Any other value must refer
to an attachment registered with writable: true.
temp_attach: Option<Vec<AttachSpec>>Optional list of databases to attach for the duration of this call only. Detached automatically even if the query fails. Aliases used here must not already be in use.
Trait Implementations§
Source§impl Debug for CopyQueryParams
impl Debug for CopyQueryParams
Source§impl<'de> Deserialize<'de> for CopyQueryParams
impl<'de> Deserialize<'de> for CopyQueryParams
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 CopyQueryParams
impl JsonSchema for CopyQueryParams
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 moreAuto Trait Implementations§
impl Freeze for CopyQueryParams
impl RefUnwindSafe for CopyQueryParams
impl Send for CopyQueryParams
impl Sync for CopyQueryParams
impl Unpin for CopyQueryParams
impl UnsafeUnpin for CopyQueryParams
impl UnwindSafe for CopyQueryParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request