Rust driver for Siodb
A simple driver for Siodb written in pure Rust.
Features
- Support of URI
- Connections to Siodb (TLS, TCP, Unix socket)
- Authentication to Siodb
- Query execution
- DML execution
Installation
Add the crate dependency with the version you desire into Cargo.toml
:
[dependencies]
siodb_driver = "*"
Quick setup
Start Siodb in a container and get the RSA key for root user locally:
Example
let uri = "siodb://root@localhost:50000?identity_file=/home/nico/root_id_rsa";
let mut siodb_conn = new.expect;
if siodb_conn
.query_row
.is_none
if siodb_conn
.query_row
.is_none
siodb_conn
.execute
.expect;
println!;
siodb_conn
.query
.expect;
while siodb_conn.next.unwrap
println!;
siodb_conn.close.unwrap;
URI
To identify a Siodb resource, the driver use the URI format.
For TCP connection:
siodb://root@localhost:50000?identity_file=/home/siodb/.ssh/id_rsa
For Unix socket connection:
siodb://root@unix_socket?identity_file=/home/siodb/.ssh/id_rsa
The above example will connect you to the localhost with port number 50000
.
The driver will do the authentication with the Siodb user root and the identity file /home/siodb/.ssh/id_rsa
.
Options
- identity_file: the path to the RSA private key.
- unix_socket: indicate the path of the Unix socket used by Siodb to connect locally.
- trace: to trace everything within the driver to sdtout.
- plaintext: if Siodb has
client.enable_encryption
set tono
.
Support Siodb
Do you like this project? Tell it by clicking the star 🟊 on the top right of this page ☝☝
Documentation
We write the documentation in Markdow and it is available in the folder docs/users/docs
.
If you prefer a more user friendly format, the same documentation is
available online here.
Contribution
Please refer to the Contributing file.
Support
Follow Siodb
License
Licensed under Apache License version 2.0.