MonetDB bindings for Rust
Rust client for the MonetDB analytics database.
Note: this crate is in its early stages. The basics seem to work but a lot has not been implemented yet and the API may change in incompatible ways at any time.
Examples
use Error;
use Connection;
// Example output:
// host=Some("totoro") clientpid=Some(1895691) client=Some("libmapi 11.51.4") remark=None
// host=Some("totoro") clientpid=Some(1914127) client=Some("monetdb-rust 0.1.1") remark=None
You can also use a Parameters object to fine tune the connection parameters:
# use Error;
use ;
#
Current status
-
Support for MonetDB Jun2020 (11.37.7) and higher. Older versions are highly likely to work but haven't been tested. If you need this, just ask.
-
Rust 1.80 and higher, older versions have not yet been tested.
-
The full
monetdb://connection URL syntax is supported, though not all features have been implemented. -
Most data types can be retrieved in string form using
get_str(). Exception: blobs -
The primitive types bool, i8/u8, i16/u16, i32/u32, i64/u64, i128/u128, isize/usize, f32/f64 have typed getters, for example
get_i8(). -
A single call to
Cursor::execute()can return multiple result sets. -
extremely basic and untested TLS (
monetdbs://) support can optionally be compiled in.
Not implemented yet but planned:
-
parametrized queries
-
start transaction / commit / rollback
-
typed getters for decimal and temporal types
-
BLOB support
-
Full TLS support
-
file transfers
-
Binary result set
-
Adaptive paging window sizes
-
scanning /tmp for Unix Domain sockets
-
Non-SQL, for example language=mal for MonetDB's tracing / profiling API
-
PREPARE STATEMENT
-
Async, seems to be needed for sqlx
-
Integration with database frameworks such as sqlx and Diesel. There does not seem to be a JDBC equivalent for Rust.
Optional features
The monetdb crate currently defines one optional feature:
- rustls Enable a first stab at supporting TLS connections using
rustls. The TLS-related configuration
parameters such as
cert=andclientkey=aren't supported yet and there is no testing, but a basicmonetdbs://URL seems to work. To try it, pass it on the command line like this:
or enable it in your application's Cargo.toml like this:cargo run --features=rustls --example testconnect -- monetdbs://my.tls.host/demo[dependencies] monetdb = { version="0.1.1", features=["rustls"]}