@pcs/sails-postgresql
Forked from github.com/balderdashy/sails-postgresql
Last updated 3 years ago by simondweare .
MIT · Original npm · Tarball · package.json
$ cnpm install @pcs/sails-postgresql 
SYNC missed versions from official npm registry.

PostgreSQL Sails/Waterline Adapter

A Waterline adapter for PostgreSQL. May be used in a Sails app or anything using Waterline for the ORM. Forked from balderdashy/sails-postgresql.

Install

Install is through NPM.

$ npm install @pcs/sails-postgresql

Configuration

The following config options are available along with their default values:

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

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

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

We are also testing features for future versions of waterline in postgresql. One of these is case sensitive string searching. In order to enable this feature today you can add the following config flag:

postgresql: {
  url: 'postgres://username:password@hostname:port/database',
  wlNext: {
    caseSensitive: true
  }
}

Model Level Config

You can use model level config options to specify a schema to use. This is done by adding the meta key schemaName.

module.exports = Waterline.Collection.extend({
  tableName: 'user',
  meta: {
    schemaName: 'foo'
  },

  identity: 'user',
  connection: 'myAwesomeConnection',

  attributes: {
    name: 'string'
  }
});

About Waterline

Waterline is a new kind of storage and retrieval engine. It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get users, whether they live in mySQL, LDAP, MongoDB, or Facebook.

To learn more visit the project on GitHub at Waterline.

Current Tags

  • 0.11.8                                ...           latest (3 years ago)

1 Versions

  • 0.11.8                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |