pub struct ExportStatement {
pub database: Option<Ident>,
pub path: Literal,
pub parenthesized: bool,
pub options: ThinVec<CopyOption>,
pub meta: Meta,
}Expand description
A DuckDB EXPORT DATABASE ['<db>' TO] '<path>' [<copy-options>] statement: write
the catalogue as a directory of CREATE/INSERT/COPY scripts plus data files.
The two grammar forms (DuckDB ExportStmt) are EXPORT DATABASE '<path>' <copy_options> and EXPORT DATABASE <db> TO '<path>' <copy_options> — the
named-database form threads the catalogue name through a required TO before the
path (EXPORT DATABASE db '<path>' without TO is a parser error, probed on
1.5.4). The presence of database therefore reconstructs the TO
on render — a Some is the <db> TO '<path>' spelling, a None the bare
'<path>' — so no separate to surface tag is carried.
The options reuse the PostgreSQL COPY option axis verbatim: DuckDB’s grammar
gives ExportStmt the same copy_options production COPY uses (a legacy
space-separated copy_opt_list or a parenthesized generic list), so the
options list is CopyOptions and parenthesized
records which spelling was written — exactly CopyStatement’s pair. Unlike COPY
there is no leading WITH (EXPORT DATABASE '<path>' WITH (...) is a parser error,
probed on 1.5.4), so the parenthesized form renders bare (...). Non-generic: the
path is a string literal and CopyOption carries no extension nodes, so — like
DetachStatement — this node needs no X. Gated together with its
ImportStatement inverse by
UtilitySyntax::export_import_database.
Fields§
§database: Option<Ident>The catalogue (database) name of the EXPORT DATABASE <db> TO '<path>' form;
None is the bare EXPORT DATABASE '<path>' form. A Some reconstructs the
required TO on render.
path: LiteralThe destination directory path — a string literal (DuckDB Sconst).
parenthesized: boolWhether the parenthesized (opt, ...) option-list spelling was used (the
surface tag); false is the legacy space-separated list (FORMAT is not in
that fixed set, but HEADER/CSV/DELIMITER '...' are). Irrelevant when
options is empty, where neither spelling renders — mirroring
CopyStatement::parenthesized.
options: ThinVec<CopyOption>Copy options in source order; see CopyOption. Empty when none were written.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl Clone for ExportStatement
impl Clone for ExportStatement
Source§fn clone(&self) -> ExportStatement
fn clone(&self) -> ExportStatement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExportStatement
impl Debug for ExportStatement
Source§impl<'de> Deserialize<'de> for ExportStatement
impl<'de> Deserialize<'de> for ExportStatement
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>,
impl Eq for ExportStatement
Source§impl Hash for ExportStatement
impl Hash for ExportStatement
Source§impl PartialEq for ExportStatement
impl PartialEq for ExportStatement
Source§impl Render for ExportStatement
impl Render for ExportStatement
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl Serialize for ExportStatement
impl Serialize for ExportStatement
impl StructuralPartialEq for ExportStatement
Auto Trait Implementations§
impl Freeze for ExportStatement
impl RefUnwindSafe for ExportStatement
impl Send for ExportStatement
impl Sync for ExportStatement
impl Unpin for ExportStatement
impl UnsafeUnpin for ExportStatement
impl UnwindSafe for ExportStatement
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.