Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Jan 25, 2019
1 parent 1f6e579 commit cfd6706
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ Options:
-s --migrations-schema=SCHEMA Set the name of the migrations table scheme [default: public]

Connection options:
-d --db=PGDATABASE database name to connect to
-h --host=PGHOST database server host or socket directory [default: localhost]
-p --port=PGPORT database server port [default: 5432]
-U --user=PGUSER database user name
-W --password=PGPASSWORD database user name password
-c --connection=DATABASE_URL database connection string in libpq format
-d --db=PGDATABASE database name to connect to
-h --host=PGHOST database server host or socket directory [default: localhost]
-p --port=PGPORT database server port [default: 5432]
-U --user=PGUSER database user name
-W --password=PGPASSWORD database user name password
```

## Node.js API
Expand All @@ -66,12 +67,15 @@ Using Promises

```js
const PgMigrate = require('@urbica/pg-migrate');
const pgMigrate = new PgMigrate({ database: 'test', migrationsDir: './migrations' });
const pgMigrate = new PgMigrate({
database: 'test',
migrationsDir: './migrations'
});

pgMigrate
.connect()
.then(() => pgMigrate.migrate())
.then(() => pgMigrate.end());
.connect()
.then(() => pgMigrate.migrate())
.then(() => pgMigrate.end());
```

...or using async/await
Expand Down

0 comments on commit cfd6706

Please sign in to comment.