sqldiff ![Build Status](https://travis-ci.org/fulcrumapp/sqldiff.svg?branch=master)
Diff SQL table definitions to produce statements to patch them. This module does not execute any SQL.
Installation
npm install sqldiff
Example
import { Table, SchemaDiffer, Postgres, SQLite } from 'sqldiff';
const oldTable = new Table('users');
const newTable = new Table('users');
oldTable.addColumn('id', 'pk');
oldTable.addColumn('name', 'string');
newTable.addColumn('id', 'pk');
newTable.addColumn('name', 'string');
newTable.addColumn('description', 'string');
newTable.addColumn('age', 'integer');
newTable.addColumn('height', 'double');
const differ = new SchemaDiffer({ tables: [oldTable] },
{ tables: [newTable] });
const pg = new Postgres(differ);
console.log(pg.generate());
const sqlite = new SQLite(differ);
console.log(sqlite.generate());