All Projects → Koka → odbc-rs

Koka / odbc-rs

Licence: MIT license
Rust ODBC FFI binding

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to odbc-rs

ElegantData
像操作Room一样操作 SharedPreferences 和 File 文件.
Stars: ✭ 18 (-80%)
Mutual labels:  db
cargo-valgrind
A cargo subcommand, that runs valgrind and displays its output in a helpful manner.
Stars: ✭ 66 (-26.67%)
Mutual labels:  ffi-bindings
cztop
CZMQ binding for Ruby
Stars: ✭ 30 (-66.67%)
Mutual labels:  ffi-bindings
db-command
Performs basic database operations using credentials stored in wp-config.php.
Stars: ✭ 65 (-27.78%)
Mutual labels:  db
raml
OCaml runtime and FFI bindings directly in Rust
Stars: ✭ 75 (-16.67%)
Mutual labels:  ffi-bindings
sqlmetrics
Prometheus metrics for Go database/sql via VictoriaMetrics/metrics
Stars: ✭ 21 (-76.67%)
Mutual labels:  db
dbclient
데이터배이스 관리 / 자동 메일링 / Admin 자동화 / Database IDE Tool. SQL Development Helper. Support DBMS Oracle/Mysql/MS-SQL
Stars: ✭ 35 (-61.11%)
Mutual labels:  db
ocp-flyway-db-migration
Database Migration Sample with Flyway, Docker and Kubernetes in Openshift Container Platform
Stars: ✭ 17 (-81.11%)
Mutual labels:  db
dbx4fb
dbExpress driver for Firebird
Stars: ✭ 22 (-75.56%)
Mutual labels:  db
db-rest
A clean REST API wrapping around the Deutsche Bahn API.
Stars: ✭ 40 (-55.56%)
Mutual labels:  db
implyr
SQL backend to dplyr for Impala
Stars: ✭ 74 (-17.78%)
Mutual labels:  odbc
db.rstudio.com
Website dedicated to all things R and Databases
Stars: ✭ 13 (-85.56%)
Mutual labels:  odbc
sack.vfs
Node addon which adds a virtual file system interface; websockets; json(6) parsing; sql support(sqlite,odbc); javascript sched_yield; ssl certificate generation; more...
Stars: ✭ 29 (-67.78%)
Mutual labels:  odbc
tevere
🏞 Decentralized DB over IPFS
Stars: ✭ 57 (-36.67%)
Mutual labels:  db
ccxx
This is a cross-platform library software library about c, c ++, unix4, posix. Include gtest, benchmark, cmake, process lock, daemon, libuv, lua, cpython, re2, json, yaml, mysql, redis, opencv, qt, lz4, oci ... https://hub.docker.com/u/oudream
Stars: ✭ 31 (-65.56%)
Mutual labels:  odbc
odbc2parquet
A command line tool to query an ODBC data source and write the result into a parquet file.
Stars: ✭ 95 (+5.56%)
Mutual labels:  odbc
qt-sql-example
Example Qt application that connects to SQL Server and displays a table from the database
Stars: ✭ 29 (-67.78%)
Mutual labels:  odbc
iiitdmj-gpa
GPA Calculator + Quiz Bot for IIITDM Jabalpur
Stars: ✭ 16 (-82.22%)
Mutual labels:  db
django-undeletable
undeletable Django models
Stars: ✭ 13 (-85.56%)
Mutual labels:  db
oledb
A small promised based module which uses edge.js to connect to an OLE DB, ODBC or SQL database.
Stars: ✭ 28 (-68.89%)
Mutual labels:  odbc

ODBC wrapper for safe idiomatic Rust

Library for writing ODBC applications in Rust.

If you're looking for raw ODBC FFI bindings check odbc-safe and odbc-sys crate.

Project Status: Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.

https://travis-ci.org/Koka/odbc-rs Build status https://crates.io/crates/odbc Coverage Status Docs Join the chat at https://gitter.im/odbc-rs/odbc

Docs are also available here

extern crate odbc;
// Use this crate and set environmet variable RUST_LOG=odbc to see ODBC warnings
extern crate env_logger;
use odbc::*;
use std::io;
use odbc_safe::AutocommitOn;

fn main() {

    env_logger::init();

    match connect() {
        Ok(()) => println!("Success"),
        Err(diag) => println!("Error: {}", diag),
    }
}

fn connect() -> std::result::Result<(), DiagnosticRecord> {

    let env = create_environment_v3().map_err(|e| e.unwrap())?;

    let mut buffer = String::new();
    println!("Please enter connection string: ");
    io::stdin().read_line(&mut buffer).unwrap();

    let conn = env.connect_with_connection_string(&buffer)?;
    execute_statement(&conn)
}

fn execute_statement<'env>(conn: &Connection<'env, AutocommitOn>) -> Result<()> {
    let stmt = Statement::with_parent(conn)?;

    let mut sql_text = String::new();
    println!("Please enter SQL statement string: ");
    io::stdin().read_line(&mut sql_text).unwrap();

    match stmt.exec_direct(&sql_text)? {
        Data(mut stmt) => {
            let cols = stmt.num_result_cols()?;
            while let Some(mut cursor) = stmt.fetch()? {
                for i in 1..(cols + 1) {
                    match cursor.get_data::<&str>(i as u16)? {
                        Some(val) => print!(" {}", val),
                        None => print!(" NULL"),
                    }
                }
                println!("");
            }
        }
        NoData(_) => println!("Query executed, no data returned"),
    }

    Ok(())
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].