1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
//! # exarrow-rs
//!
//! ADBC-compatible driver for Exasol with Apache Arrow data format support.
//!
//! This library provides high-performance database connectivity for Exasol using
//! the ADBC (Arrow Database Connectivity) interface. It enables efficient data transfer
//! using the Apache Arrow columnar format, making it ideal for analytical workloads
//! and data science applications.
//!
//! ## Features
//!
//! - **ADBC Interface**: Standard Arrow Database Connectivity driver
//! - **Query Execution**: Execute SQL queries and retrieve results as Arrow RecordBatches
//! - **Bulk Import**: Import data from CSV, Parquet, and Arrow RecordBatches
//! - **Bulk Export**: Export data to CSV, Parquet, and Arrow RecordBatches
//! - **Streaming**: Memory-efficient streaming for large datasets
//! - **Compression**: Support for gzip, bzip2, snappy, lz4, and zstd compression
//!
//! ## Connect
//!
//! ```no_run
//! use exarrow_rs::adbc::{Driver, Database, Connection};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let driver = Driver::new();
//! // Schema in the URI is automatically opened with OPEN SCHEMA after login.
//! let database = driver.open(
//! "exasol://sys:exasol@localhost:8563/my_schema?validateservercertificate=0"
//! )?;
//! let mut connection = database.connect().await?;
//! println!("Connected: session {}", connection.session_id());
//! connection.close().await?;
//! Ok(())
//! }
//! ```
//!
//! ## Execute a query
//!
//! ```no_run
//! use exarrow_rs::adbc::{Driver, Connection};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let driver = Driver::new();
//! let database = driver.open(
//! "exasol://sys:exasol@localhost:8563/my_schema?validateservercertificate=0"
//! )?;
//! let mut connection = database.connect().await?;
//!
//! let batches = connection.query("SELECT id, name FROM users ORDER BY id").await?;
//! let total_rows: usize = batches.iter().map(|b| b.num_rows()).sum();
//! println!("Fetched {} rows across {} batch(es)", total_rows, batches.len());
//!
//! connection.close().await?;
//! Ok(())
//! }
//! ```
//!
//! ## Import data
//!
//! ```no_run
//! use exarrow_rs::adbc::{Driver, Connection};
//! use exarrow_rs::import::{CsvImportOptions, ParquetImportOptions};
//! use std::path::PathBuf;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let driver = Driver::new();
//! let database = driver.open(
//! "exasol://sys:exasol@localhost:8563/my_schema?validateservercertificate=0"
//! )?;
//! let mut connection = database.connect().await?;
//!
//! // Import CSV files
//! let csv_files = vec![PathBuf::from("/data/part1.csv"), PathBuf::from("/data/part2.csv")];
//! let rows = connection
//! .import_csv_from_files("users", csv_files, CsvImportOptions::default())
//! .await?;
//! println!("Imported {} rows from CSV", rows);
//!
//! // Import Parquet files
//! let parquet_files = vec![PathBuf::from("/data/snapshot.parquet")];
//! let rows = connection
//! .import_parquet_from_files("users", parquet_files, ParquetImportOptions::default())
//! .await?;
//! println!("Imported {} rows from Parquet", rows);
//!
//! connection.close().await?;
//! Ok(())
//! }
//! ```
// Module declarations
// FFI module for C-compatible ADBC export (conditionally compiled)
// ADBC Interface Types
/// Re-export ADBC driver and connection types.
pub use ;
// Arrow Conversion
/// Re-export Arrow conversion utilities.
pub use ArrowConverter;
// Error Types
/// Re-export error types for convenient error handling.
pub use ;
// Type System
/// Re-export type mapping utilities.
pub use ;
// Import Types
/// CSV import options and functions.
///
/// The CSV import module provides functionality for importing data from CSV files,
/// streams, iterators, and custom callbacks into Exasol tables.
///
/// # Example
///
pub use ;
// Export Types
/// CSV export options and functions.
///
/// The export module provides functionality for exporting data from Exasol tables
/// or query results to files, streams, in-memory lists, or custom callbacks.
///
/// # Example
///
pub use ;
// Query Builder Types
/// Query builder types for constructing IMPORT and EXPORT SQL statements.
///
/// These types provide a builder pattern for constructing Exasol IMPORT and EXPORT
/// SQL statements with full control over CSV format options, compression, and
/// encoding settings.
///
/// # Export Query Example
///
///
/// # Import Query Example
///
pub use ;
pub use ;
// Query Execution Types
pub use ;
/// Query execution and result handling types.
pub use ;
// FFI Types (when ffi feature is enabled)
/// Re-export FFI types when ffi feature is enabled.
pub use ;