sqlx-exasol
A database driver for Exasol to be used with the Rust sqlx framework, based on the Exasol Websocket API. Inspired by Py-Exasol and based on the (now archived) rust-exasol sync driver.
Based on sqlx version 0.9.0-alpha.1.
Comparison to native sqlx drivers
The driver re-exports all sqlx public API and implements the exposed traits. As a result,
it can do all the drivers shipped with sqlx do, with some caveats:
-
Limitations
-
Additions
- array-like parameter binding in queries, thanks to the columnar nature of the Exasol database
- performant & parallelizable ETL IMPORT/EXPORT jobs in CSV format through HTTP Transport
Compile-time query checks
The driver now supports compile-time query validation and can be used alongside
sqlx within the same crate. Note however that derive proc-macros from sqlx are
database agnostic and thus sqlx-exasol just re-exports them as-is.
CLI utility
The driver uses its own CLI utility (built on the same sqlx-cli library):
# Usage is exactly the same as sqlx-cli
Connection string
The connection string is expected to be an URL with the exa:// scheme, e.g:
exa://sys:exasol@localhost:8563.
See the crate level documentation for a list of supported connection string parameters.
Example
use env;
use ;
let pool = connect.await?;
let mut con = pool.acquire.await?;
query
.execute
.await?;
See the crate documentation for more details and advanced examples.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions to this repository, unless explicitly stated otherwise, will be considered dual-licensed under MIT and Apache 2.0. Bugs/issues encountered can be opened here
Footnotes
1: Exasol has no advisory or database locks and simple, unnested, transactions are unfortunately not enough to define a mechanism so that concurrent migrations do not collide. This does not pose a problem when migrations are run sequentially or do not act on the same database objects.
2: Exasol does not provide the information of whether a column is nullable or not, so the driver cannot implicitly decide whether a NULL value can go into a certain database column or not until it actually tries.