Skip to main content

ExportQuery

Struct ExportQuery 

Source
pub struct ExportQuery { /* private fields */ }
Expand description

Builder for constructing EXPORT SQL statements.

Exasol EXPORT statements transfer data from tables or queries to external destinations via HTTP transport using CSV format.

Implementations§

Source§

impl ExportQuery

Source

pub fn from_table(table: &str) -> Self

Create an export query from a table.

§Arguments
  • table - The name of the table to export from.
§Example
Source

pub fn from_query(sql: &str) -> Self

Create an export query from a SQL query.

§Arguments
  • sql - The SQL query whose results to export.
§Example
Source

pub fn schema(self, schema: &str) -> Self

Set the schema for a table export.

This method only has an effect when exporting from a table, not from a query.

§Arguments
  • schema - The schema name.
Source

pub fn columns(self, cols: Vec<&str>) -> Self

Set the columns to export from a table.

This method only has an effect when exporting from a table, not from a query.

§Arguments
  • cols - The column names to export.
Source

pub fn at_address(self, addr: &str) -> Self

Set the HTTP address for the export destination.

The protocol (http:// or https://) will be determined automatically based on whether a public key is set.

§Arguments
  • addr - The address in the format “host:port”.
Source

pub fn with_public_key(self, fingerprint: &str) -> Self

Set the public key fingerprint for TLS encryption.

When set, the export will use HTTPS and include a PUBLIC KEY clause.

§Arguments
  • fingerprint - The SHA-256 fingerprint of the public key.
Source

pub fn file_name(self, name: &str) -> Self

Set the output file name.

Default is “001.csv”. The compression extension will be appended automatically if compression is enabled.

§Arguments
  • name - The file name.
Source

pub fn column_separator(self, sep: char) -> Self

Set the column separator character.

Default is ‘,’.

§Arguments
  • sep - The separator character.
Source

pub fn column_delimiter(self, delim: char) -> Self

Set the column delimiter character.

Default is ‘“’.

§Arguments
  • delim - The delimiter character.
Source

pub fn row_separator(self, sep: RowSeparator) -> Self

Set the row separator.

Default is LF (Unix-style line endings).

§Arguments
  • sep - The row separator.
Source

pub fn encoding(self, enc: &str) -> Self

Set the character encoding.

Default is “UTF-8”.

§Arguments
  • enc - The encoding name.
Source

pub fn null_value(self, val: &str) -> Self

Set a custom NULL value representation.

By default, NULL values are exported as empty strings.

§Arguments
  • val - The string to use for NULL values.
Source

pub fn delimit_mode(self, mode: DelimitMode) -> Self

Set the delimit mode.

Default is Auto.

§Arguments
  • mode - The delimit mode.
Source

pub fn compressed(self, compression: Compression) -> Self

Set the compression type.

The appropriate file extension will be added automatically.

§Arguments
  • compression - The compression type.
Source

pub fn with_column_names(self, include: bool) -> Self

Set whether to include column names in the output.

Default is false.

§Arguments
  • include - Whether to include column names.
Source

pub fn build(&self) -> String

Build the EXPORT SQL statement.

§Returns

The complete EXPORT SQL statement as a string.

Trait Implementations§

Source§

impl Clone for ExportQuery

Source§

fn clone(&self) -> ExportQuery

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ExportQuery

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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<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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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