marv-oracledb-driver

2.0.0 • Public • Published

NPM version NPM downloads Maintainability Test Coverage Code Style

marv-oracledb-driver

An oracle database driver for marv

Usage

migrations/
  |- 001.create-table.sql
  |- 002.create-another-table.sql

Promises

const marv = require('marv/api/promise'); // <-- Promise API
const driver = require('marv-oracledb-driver');
const directory = path.resolve('migrations');
const connection = {
  // Properties are passed straight oracledb.getConnection
  connectionString: 'localhost:32118/XE',
  user: 'system',
  password: 'Oracle18'
};

const migrations = await marv.scan(directory);
await marv.migrate(migrations, driver({ connection });
// Profit :)

Callbacks

const marv = require('marv/api/callback'); // <-- Callback API
const driver = require('marv-oracledb-driver');
const directory = path.resolve('migrations');
const connection = {
  // Properties are passed straight oracledb.getConnection
  connectionString: 'localhost:32118/XE',
  user: 'system',
  password: 'Oracle18',
};

marv.scan(directory, (err, migrations) => {
  if (err) throw err;
  marv.migrate(migrations, driver({ connection }), (err) => {
    if (err) throw err;
    // Profit :)
  });
});

Testing

npm install
npm test

Tests run inside a docker container that contains the oracle client libraries, and against an Oracle XE instance which is also in a container. Both are managed by docker-compose and launched by running npm test, however it the database does take a while to start, so tests may fail initially.

Package Sidebar

Install

npm i marv-oracledb-driver

Weekly Downloads

12

Version

2.0.0

License

ISC

Unpacked Size

16.8 kB

Total Files

32

Last publish

Collaborators

  • cressie176