Skip to content

theconst/aodbc

Repository files navigation

Cache ODBC - javascript access to Intersystems Cache Database

Build Status Gitter

Description

This library aims to provide a simple access to ODBC data sources for node.js.

The library is primarily targeted at https://www.intersystems.com/products/cache/#what-sets-it-apart, but may be suitable for other databases as well.

Library heavily relies on https://github.com/nanodbc/nanodbc - a proven wrapper for ODBC API.

Current status

The library has alpha quality. Integration tests are written for Cache database samples.

Usage

See test specs for a usage example for a raw connector interface. See https://github.com/theconst/odm-sample for an example web application. You may also find a comprehensive instruction for different OS configuration.

Prerequisites

  1. Git 2.x.x
  2. MSVC Build tools (Windows), GCC 6.x.x + Make (UNIX)
  3. Cmake >= 3.2
  4. nodejs (tested versions are 8.x.x and 10.x.x)
  5. UnixODBC (on Linux)
  6. Configured ODBC datasource for the database. You may find configuration samples in config directory.

Build steps

General build steps:

  1. git clone https://github.com/theconst/aodbc
  2. npm install

If the above steps do not work (or custom build options are required):

  1. git clone https://github.com/theconst/aodbc
  2. npm install
  3. npm install -g cmake-js
  4. cmake-js rebuild -a <target arch> -G <generator to use>

After installing and building the module, you can use it as a submodule.

Docker

To launch the application in Docker container, follow the following steps:

  1. Change settings for your ODBC host in odbc.ini
  2. docker build -t cacheodbc:latest .
  3. docker exec -it <docker_image_id> /bin/bash
  4. npm t will run the test for the library

Releasing

  • To trigger a release, commit to a branch with release-* tag.
  • Artifacts will be available in the corresponding git releases section

Packaging

  1. Download artifacts from release.
  2. Add them to build directory.
  3. Add new artifacts (if any to package.json)
  4. run npm publish

TODO List

  • Add support for setting fetch size
  • Add tracing. You can enable tracing on ODBC labels
  • Generalize delegation code
  • Increase C++ test coverage
  • Rewrite tests to be database-agnostic
  • Automate build for linux
  • Add support for prepared statements
    • Add support for dates in prepared statements
  • Add support for transactions
  • Add support for binary type
  • Add support for Windows
  • Add support for Unicode
  • Rename library to cache-odbc
  • Migrate to bintray to reduce binary package size