pub struct ImportQuery { /* private fields */ }Expand description
Builder for constructing Exasol IMPORT SQL statements.
The ImportQuery builder allows you to configure all aspects of an IMPORT statement including the target table, columns, CSV format options, and error handling.
§Multi-file Import
For parallel imports, use with_files() instead of at_address() and file_name():
use exarrow_rs::query::import::{ImportQuery, ImportFileEntry};
let entries = vec![
ImportFileEntry::new("10.0.0.5:8563".to_string(), "001.csv".to_string(), None),
ImportFileEntry::new("10.0.0.6:8563".to_string(), "002.csv".to_string(), None),
];
let query = ImportQuery::new("my_table")
.with_files(entries)
.build();Implementations§
Source§impl ImportQuery
impl ImportQuery
Sourcepub fn new(table: &str) -> Self
pub fn new(table: &str) -> Self
Create a new ImportQuery builder for the specified table.
§Arguments
table- The name of the target table to import into
Sourcepub fn columns(self, cols: Vec<&str>) -> Self
pub fn columns(self, cols: Vec<&str>) -> Self
Set the columns to import into.
If not specified, all columns in the table will be used.
§Arguments
cols- List of column names
Sourcepub fn at_address(self, addr: &str) -> Self
pub fn at_address(self, addr: &str) -> Self
Sourcepub fn with_public_key(self, fingerprint: &str) -> Self
pub fn with_public_key(self, fingerprint: &str) -> Self
Set the public key fingerprint for TLS verification.
When set, HTTPS will be used and the PUBLIC KEY clause will be added.
§Arguments
fingerprint- SHA-256 fingerprint of the server’s public key
Sourcepub fn column_separator(self, sep: char) -> Self
pub fn column_separator(self, sep: char) -> Self
Sourcepub fn column_delimiter(self, delim: char) -> Self
pub fn column_delimiter(self, delim: char) -> Self
Set the column delimiter character for quoting.
§Arguments
delim- Delimiter character (default ‘“’)
Sourcepub fn row_separator(self, sep: RowSeparator) -> Self
pub fn row_separator(self, sep: RowSeparator) -> Self
Sourcepub fn null_value(self, val: &str) -> Self
pub fn null_value(self, val: &str) -> Self
Sourcepub fn compressed(self, compression: Compression) -> Self
pub fn compressed(self, compression: Compression) -> Self
Set the compression type for the import file.
This affects the file extension in the generated SQL.
§Arguments
compression- Compression type
Sourcepub fn reject_limit(self, limit: u32) -> Self
pub fn reject_limit(self, limit: u32) -> Self
Set the reject limit for error handling.
§Arguments
limit- Maximum number of invalid rows before the import fails
Sourcepub fn with_files(self, entries: Vec<ImportFileEntry>) -> Self
pub fn with_files(self, entries: Vec<ImportFileEntry>) -> Self
Set multiple file entries for parallel import.
This method enables multi-file IMPORT statements where each file has its own AT/FILE clause with a unique internal address.
§Arguments
entries- Vector of file entries with addresses and file names
§Note
When using with_files(), the at_address() and file_name() methods
are ignored and should not be called.
Trait Implementations§
Source§impl Clone for ImportQuery
impl Clone for ImportQuery
Source§fn clone(&self) -> ImportQuery
fn clone(&self) -> ImportQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more