Grunt plugin to help with administering Postgres.
npm install --save-dev grunt-pg
Once that's done, add this line to your project's Gruntfile:
If the plugin has been installed correctly, running
grunt --help at the command line should list the newly-installed
plugin's task or tasks. In addition, the plugin should be listed in package.json as a
devDependency, which ensures
that it will be installed whenever the
npm install command is run.
Firstly, an example of using the pgcreate task:
There are 5 tasks in grunt-pg: pgcreateuser, pgdropuser, pgcreatedb, pgowner, pgdropdb and pgsqlfile. Each task is a multitask.
Each works similarly as the example above shows. The connection credentials must be a user who is privieleged enough to be able to perform these operations. For example, using the 'postgres' user to the 'template1' database should be sufficient.
The connection object can also specify anything that node-pg understands: user, database, password, port and host.
Each task also requires the following:
2013-01-16: 0.1.0 -
Copyright (c) 2013 Moneytribe. MIT.