Crates.io | rdbc2 |
lib.rs | rdbc2 |
version | 0.2.2 |
source | src |
created_at | 2023-03-11 13:13:03.000387 |
updated_at | 2023-04-28 22:51:09.45923 |
description | Rust Database Connectivity Interface |
homepage | |
repository | https://github.com/CoLearn-Dev/rdbc2 |
max_upload_size | |
id | 807261 |
size | 27,059 |
This is a Rust implementation of the Java DataBase Connectivity (JDBC) API, a continuation and reimplementation of the rdbc project.
Add the following to your Cargo.toml
:
[dependencies]
rdbc2 = "0.2"
use rdbc2;
let mut database = rdbc2::dbc::Database::new(<database_url>)?;
let result = database.execute_query(<query_string>)?;
let serialized_result = database.execute_query_and_serialize(<query_string>)?; // Serializes the result into a JSON string
let serialized_result_raw = database.execute_query_and_serialize_raw( < query_string>)?; // Serializes the result into an u8 array
// Or with parameters
let result = database.execute_query_with_params( < query_string>, < params>)?;
let serialized_result = database.execute_query_and_serialize_with_params(<query_string>, <params>)?;
MySQL
SQLite
PostgreSQL