Takes two objects that describe the structure of a database and produces the PostgreSQL statements required to get from one to the other.
$ npm install pg-diff-sync --save
const pgDiffSync =const currentDbStructure = ...const expectedDbStructure = ...const statements =// Returns an array of DDL statements to apply on the PostgreSQL database
||An object representing the original starting position of a database - most likely the output conjured from the pg-info package|
||And an object representing how the database needs to be - in the same form as
The output from pg-diff-sync is a simple array of strings.
- Each string is a separate DDL statement, that should be run on the PostgreSQL database that produced the
- With some caveats, running these statements on the base database will turn it into the target database
$ npm test