Git Product home page Git Product logo

odbc-api's Introduction

ODBC-API

Docs Licence Crates.io Coverage Status

Rust ODBC bindings. ODBC (Open Database Connectivity) is an open standard to connect to a variaty of data sources. Most data sources offer ODBC drivers. This crate is currently tested against:

  • Microsoft SQL Server
  • PostgreSQL
  • MariaDB
  • SQLite

Current ODBC Version is 3.80.

This crate is build on top of the odbc-sys ffi bindings, which provide definitions of the ODBC C Interface, but do not build any kind of abstraction on top of it.

Usage

Check the guide for code examples and a tour of the features.

Installation

To build this library you need to link against the odbc library of your systems ODBC driver manager. It should be automatically detected by the build. On Windows systems it is preinstalled. On Linux and OS-X unix-odbc must be installed. To create a Connections to a data source, its ODBC driver must also be installed.

Windows

Nothing to do. ODBC driver manager is preinstalled.

Ubuntu

sudo apt-get install unixodbc-dev

OS-X (intel)

You can use homebrew to install UnixODBC

brew install unixodbc

OS-X (ARM / MAC M1)

cargo build is not going to pick up libodbc.so installed via homebrew due to the fact that homebrew on ARM Mac installs into /opt/homebrew/Cellar as opposed to /usr/local/opt/.

You find documentation on what directories are searched during build here: https://doc.rust-lang.org/cargo/reference/environment-variables.html#dynamic-library-paths.

You can also install unixODBC from source:

  1. copy the unixODBC-2.3.9.tar.gz file somewhere you can create files and directories
  2. gunzip unixODBC*.tar.gz
  3. tar xvf unixODBC*.tar
  4. ./configure
  5. make
  6. make install

Features

  • Connect using Data Source names (DSN)
  • Connect using ODBC connection strings
  • Connect using prompts (windows)
  • Log ODBC diagnostics and warnings (via log crate).
  • Columnar bulk inserts.
  • Columnar bulk queries.
  • Rowise bulk inserts.
  • Rowise bulk queries.
  • Output parameters of stored procedures.
  • prepared and 'one shot' queries.
  • Transactions
  • Pass parameters to queries
  • Asynchronous execution of one shot queries
  • Asynchronous execution of prepared queries
  • Asynchronous connecting to database
  • Asynchronous fetching of Metainformation
  • Multithreading
  • Inserting large binary / text data in stream
  • Fetching arbitrary large text / binary data in stream
  • Connection pooling
  • List tables of data sources

odbc-api's People

Contributors

baoyachi avatar dependabot-preview[bot] avatar dependabot[bot] avatar grovesnl avatar jorgecarleitao avatar pacman82 avatar soremwar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.