Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 841 Bytes

misc.md

File metadata and controls

31 lines (17 loc) · 841 Bytes

Miscellaneous Operations

pgm.sql( sql )

Run raw sql -- with some optional very basic mustache templating

Arguments:

  • sql [string] - SQL query to run
  • args [object] - (optional) key/val of arguments to replace

pgm.func( sql )

Inserts raw string, which is not escaped

e.g. pgm.func('CURRENT_TIMESTAMP') to use in default option for column definition

Arguments:

  • sql [string] - string to not be escaped

pgm.db.query and pgm.db.select

Allows to run DB queries with same DB connection migration is running See pg.Client.query

Returns promise with either result of query or returned rows of query (in case of select).