3.0.0 • Published 3 years ago

@zakodium/sybase v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

node-sybase

A simple node.js wrapper around a Java application that provides easy access to Sybase databases via jconn3. The main goal is to allow easy installation without the requirements of installing and configuring odbc or freetds. You do however have to have java 1.5 or newer installed.

Requirements

  • java 1.5+

Install

npm

npm install @zakodium/sybase

Example

const Sybase = require('sybase'),
  db = new Sybase('host', port, 'dbName', 'username', 'pw', 5000);

await db.connect();
const result = await db.query('select * from user where user_id = 42');
db.disconnect();

API

const db = new Sybase(
  host,
  port,
  dbName,
  username,
  password,
  timeout, // How much time we should wait for a response before generating an error
  logTiming, // Print timing information to the console
);

The java Bridge now optionally looks for a "sybaseConfig.properties" file in which you can configure jconnect properties to be included in the connection. This should allow setting properties like:

ENCRYPT_PASSWORD=true

Run locally

You can run a sybase instance by using the datagrip/sybase:15.7 docker image.

Instructions are on the Readme

It should probably also work with the latest image, but 15.7 has a smaller footprint