amilajack / falcon-core-old

The cross-database ORM that powers falcon
MIT License
2 stars 1 forks source link
api core falcon orm

falcon-core

The cross-database ORM that powers falcon

Requires node >= 8 and npm >= 5

Build Status Coverage Status NPM version Dependency Status npm

Roadmap

Release 1.0.0

Installation

npm install falcon-core --save

Example

import path from 'path';
import { db, config } from 'falcon-core';

const serverInfo = {
  database: path.join(__dirname, 'demo.sqlite'),
  client: 'sqlite'
};

async function main() {
  const serverSession = db.createServer(serverInfo);
  const connection = await serverSession.createConnection('demo.sqlite');
  await connection.connect(serverInfo);

  // Connection APIs
  console.log(await connection.getTableSelectScript('albums'));
  console.log(await connection.listTables());
  console.log(await connection.listDatabases());
  console.log(await connection.getTableColumns('albums'));
  console.log(await connection.getTableValues('albums'));

  // Export API's
  console.log(await connection.exportJson('./tmp.json', {
    table: 'users'
  }));
}

main();

Related