Skip to content

waterlinejs/postgresql-adapter

Repository files navigation

PostgreSQL Waterline Adapter

NPM version Build status Dependency Status Code Climate

A Waterline adapter for PostgreSQL, with PostGIS support.

Features

  • 100% re-write of the original sails-postgresql adapter in ES6. And way faster.
  • Uses knex.js for query building and connection pooling
  • PostGIS 2.1+ Support

Compatibility

  • Waterline v0.11 and later
  • PostgreSQL 9.4 and later

Install

$ npm install waterline-postgresql --save

Configuration

config/connections.js

module.exports.connections = {
  // ...
  postgresdb: {
    /**
     * This 'connection' object could also be a connection string
     * e.g. 'postgresql://user:password@localhost:5432/databaseName?ssl=false'
     */
    connection: {
      database: 'databaseName',
      host: 'localhost',
      user: 'user',
      password: 'password',
      port: 5432,
      ssl: false
    },
    /**
     * Pool configuration
     */
    pool: {
      min: 2,
      max: 20
    }
  }
}

License

MIT

Maintained By