sails.js

PostgreSQL Database Adapter for Sails

Install

You can install the postgreSQL adapter via NPM.

npm install sails-postgresql

Configuration

You can configure the database settings in config/connections.js.

Here’s an example:

postgresql: {
  database: 'databaseName',
  host: 'localhost',
  user: 'root',
  password: '',
  port: 5432,
  poolSize: 10,
  ssl: false
};

Alternatively, you can supply the connection information in URL format:

postgresql: {
  url: 'postgres://username:password@hostname:port/database',
  ssl: false
};

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow