A Waterline adapter for PostgreSQL. May be used in a Sails app or anything using Waterline for the ORM.
Questions tagged [sails-postgresql]
106 questions
0
votes
1 answer
how to create a column with datatype 'TimeStampWithTimezone' in sails.js v1.0.2 models?
I'm using sails v 1.0.2 and sails-PostgreSQL adapter. I have a model that has a column of date type that saves current time in the format of timestamp with time zone. how should I do it? previously I created my database in pgAdmin statically but now…

fariba.j
- 1,737
- 7
- 23
- 42
0
votes
1 answer
Sails.js: Could not populate model because of ambiguous usage
I'm having two models of let's say A and B. It's an 1:n relation, where one A owns one B, and B can be owned my multiple As.
Now, if possible, B shouldn't have to know about all the As it's referenced in, so I'm only associating on the A side.
Now I…

Philip Feldmann
- 7,887
- 6
- 41
- 65
0
votes
1 answer
Connecting to a postgresql database with Sails 1.0.0?
I just decided to upgrade an existing Sails project to 1.0.0 and managed to get through most of the upgrade process until I tried connecting to the database. When attempting to lift this is the error I receive:
The adapter used by the default…

mtpeoples
- 37
- 5
0
votes
0 answers
error: A hook (`orm`) failed to load when lifting sails app using postgres
So I get this 2 error:
error: A hook (orm) failed to load!
error: error: password authentication failed for user "root"
This is my connections.js file:
module.exports.connections = {
PostgresqlServer: {
adapter: 'sails-postgresql',
…

Ali SALEM
- 1
- 3
0
votes
1 answer
Sails JS - Nested .query method doesn't run sequence
I beginner in Sails JS. I try to make multiple .query("SELECT ... "). I have a problem when looks like it not run sequence. I will explain my problem, look to My snippet code :
var isSuccess = true;
for(var loc = 0 ; loc < decode.length ; loc++){
…

Mr. Mike
- 453
- 5
- 23
0
votes
1 answer
SailsJS - Error occurred connecting to multiple database: error: syntax error at or near "SELEC"
I have MongoDB used in my application, now I need to connect to Postgresql to get some other data. But after I add connection and model for Postgresql, there's an error occurred when I started the application with sails lift. Following are the whole…

Sky
- 7,343
- 8
- 31
- 42
0
votes
2 answers
sails-postgresql "ReferenceError: User is not defined"
I try to set up postgresql connection with sails.js . Here is my config:
api/models/User.js:
module.exports = {
tableName: 'user',
meta: {
schemaName: 'public'
},
identity:'sails',
connection: 'postgreSQL',
attributes: {
username:{
…

Pierre HARDY
- 1
- 3
0
votes
1 answer
Sails.js one to many association with postgreSQL: column does not exist
I need some help with associations in sails 0.12.13 with postgresql.
I have an "App" model and a "Membership" model. Relation should be one to many (one app can be associated with many relationships).
This is the App model db table schema (table is…

whites11
- 12,008
- 3
- 36
- 53
0
votes
1 answer
SailsJS populate html table with each
I cant retrieve model data to a html select tag. Heres my code so far.
% _.each(users, function(user){ %>

fsn fusion
- 27
- 9
0
votes
0 answers
How to replicate a query with SQL IN Operator in sails.js
I am connecting to a PostgreSQL and using the following approach in a controller but it seems to not find anything when it should return some values:
Machine.query('Select * from Machine where Machine.demo_id in (' + ids_demo + ') and…

agonza1
- 439
- 7
- 20
0
votes
1 answer
Sails.js migration - Instantiated Waterline model already has a `datastore` property
While migrating to sails 1.0 I'm getting this error when I do a sails lift -
Error: Consistency violation: Instantiated Waterline model already has a `datastore` property
My config -
// config/datastores.js
module.exports.datastores = {
default…

Pratik Mandrekar
- 9,362
- 4
- 45
- 65
0
votes
0 answers
Waterline lifecycle callback on FindOne?
Waterline supports lifecycle callbacks (docs). My User model has:
beforeValidate: hash_password,
beforeCreate: hash_password,
beforeUpdate: hash_password
Which works fine for creating/updating records (I double checked in the database).
However on…

A T
- 13,008
- 21
- 97
- 158
0
votes
1 answer
Adding a record to an associated object throws and error Many-to-many Waterline sails
Sail Many-to-many association throws errors on save after adding associated object. Here is my modeling.
User:
module.exports = {
attributes: {
...
operations: {
collection: 'operation',
via: 'users'
}
…

Alex Onozor
- 6,841
- 1
- 22
- 26
0
votes
2 answers
Where to put graphql mutations in Sails?
I've installed npm sails-graphql, but I dont know where to put a mutation, surfing on the web I've found nodejs examples in which they add mutations in index.js but in sails there are no such file.
Thanks in advance.

Sidonai
- 3,088
- 3
- 13
- 12
0
votes
2 answers
Override sails update to return just one object
When I update a model, waterlock .update() always return an array of objects, even if I set on criteria a primaryKey.
on my code
Ad.update({ id: req.param('id') }, {
// desired attributed to be updated
}).exec(function(err, updatedRecord) {
…

Leo
- 1,051
- 2
- 13
- 33