5.0.0 • Published 4 years ago
marv-pg-driver v5.0.0
marv-pg-driver
A postgres driver for marv
Usage
migrations/
|- 001.create-table.sql
|- 002.create-another-table.sqlPromises
const marv = require('marv/api/promise'); // <-- Promise API
const driver = require('marv-pg-driver');
const directory = path.resolve('migrations');
const connection = {
// Properties are passed straight pg.Client
host: 'postgres.example.com',
};
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-pg-driver');
const directory = path.resolve('migrations');
const connection = {
// Properties are passed straight pg.Client
host: 'postgres.example.com',
};
marv.scan(directory, (err, migrations) => {
if (err) throw err;
// Connection properties are passed straight pg.Client
marv.migrate(migrations, driver({ connection }), (err) => {
if (err) throw err;
// Profit :)
});
});Testing
npm install
npm run docker
npm test5.0.0
4 years ago
4.0.0
6 years ago
3.0.0
7 years ago
2.2.2
7 years ago
2.2.1
7 years ago
2.2.0
7 years ago
2.1.1
7 years ago
2.0.0
9 years ago
1.4.0
9 years ago
1.3.0
9 years ago
1.2.0
9 years ago
1.1.1
9 years ago
1.1.0
9 years ago
1.0.0
9 years ago
0.7.0
10 years ago
0.6.0
10 years ago
0.5.0
10 years ago
0.4.0
10 years ago
0.3.1
10 years ago
0.3.0
10 years ago
0.2.1
10 years ago
0.2.0
10 years ago