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
1
vote
1 answer
Using legacy mysql database with new sails application
When setting up sails models to use an existing MySql database with string primary keys (PK), the PK is no longer generated automatically.
Am I missing something or do I have to implement the PK generation in beforeCreate? If I were to implement the…

danba
- 842
- 11
- 32
1
vote
1 answer
SailsJS/Waterline cannot create models in Postgres
Im trying to deploy my Sails JS application onto a standard Ubuntu 14.04.3 VM.
Right now, Im having trouble with connecting my SailsJS instance with PostgreSQL server instance. Both the SailsJS server and the PostgreSQL server are running in the…

sourdesi
- 360
- 1
- 4
- 21
1
vote
0 answers
Work with Date type
In Sails ORM/ODM Waterline there 3 date types: date, time and datetime. In my model I have type:'date'. But when i tried to save date like YYYY-MM-DD, it saved it like YYYY-MM-(DD-1)T22:00:00Z(UTC).
Database: postgreSQL
How to keep only date,…

kseon12
- 41
- 6
1
vote
1 answer
How to associate models of two different sailsJs project?
I have a sailsJs project that manages login for different type of users i.e. user type1,user type2 etc. I have another sailsJs project that manages the services provided by these users, so i need to associate the user type model with the services…

vik228
- 11
- 2
1
vote
1 answer
Can Sails query two tables at the same time?
I am trying to use Sails query language to query two tables, with Postgresql as the database.
I have two tables 'Person' and 'Pet'.
For 'Person', its model is:
id: { type: 'integer', primaryKey }
namePerson: { type: 'string' }
age: { type: 'integer'…

JustWonder
- 2,373
- 3
- 25
- 36
1
vote
3 answers
Sails.js - Postgresql Adapter multiple schemas
I've been searching a lot about Sails.js multi tenancy capabilities and I know that such a feature is not yet implemented. My initial idea was to build multi tenant app by creating one database per tenant.
Since I realized that I can't do such a…

Pavarine
- 637
- 3
- 15
- 30
1
vote
0 answers
Sails GET request doesn't return data from all columns in my Postgres DB
I'm using $sailsSocket to make my GET and POST requests. My POST request looks like this;
$sailsSocket.post('/schedules/toDateObj',
{ jobSchedObj:
{ repair_shop_equipment_id: response.config.data.schedEquip.rsrcId,
…

Brad W
- 2,540
- 2
- 18
- 28
1
vote
1 answer
What is the downside of using localDisk as storage means in Sails project
I am trying to decide what database to use in a Sails project. I started with localDisk and it works fine. I wonder why a database like Postgres or Mongo is needed. Could someone explain to me?
Also since waterline abstracted the underlying…

windchime
- 1,253
- 16
- 37
1
vote
0 answers
watelineJS: One Way Association
I'm using the Waterline ORM (PostgresQL adapter) with SailsJS and I have two models:
buildings:
{
tableName: 'buildings',
attributes: {
id: {
type: 'integer',
primaryKey: true
},
BuildingName: {type: 'string'},
…

shoom
- 11
- 3
1
vote
1 answer
Is there some way to overwrite default formatting and validation for specific type?
I have a model User with a "birthday" field of type "date". The problem is that waterline converts its value to the JavaScript Date object that is restricted to minimum of the year 1970. Obviously there are some people with a year of birth less than…

Timofey
- 141
- 6
1
vote
2 answers
sailsjs: how do I reverse engineer an existing db into sails/waterline models?
I am a SailsJS noob.
I have an existing database (postgres) that I want to turn into models for SailsJS/Waterline. is there a method/tool/utility to do this automatically like the datasource.discoverSchema() method in LoopBack?
thanks,
Mark

Mark Lummus
- 740
- 8
- 17
1
vote
0 answers
Sails.js many-to-many associations throw error on create and populate
When I try to associate one collection with another collection using a many-to-many association, I get the following error:
Using sails-mongo:
TypeError: Cannot read property 'where' of undefined
at _afterFetchingJunctorRecords…

senornestor
- 4,075
- 2
- 33
- 33
1
vote
1 answer
Sails.js associations: "Many" side of one-to-many associations not saving to MongoDB or Postgres (vs. disk db)
This works with sails-disk adapter but not with sails-mongo or sails-postgresql.
I have 2 models, Feed and Event, where Feed can belong to many Events.
When I create or save a new Feed record with an association to one or more Events (via "posts"…

senornestor
- 4,075
- 2
- 33
- 33
0
votes
0 answers
Sails js adapter not able to get connection due to poolsize
Sails js adapter is not able to get connection due to poolsize, i think increasing poolsize should solve the problem, anyone else faced this and how you fixed it.
Getting below error
Unexpected error from database adapter:selectfailed…

shyam agarwal
- 179
- 6
0
votes
0 answers
sails.sendNativeQuery not working with postgresql adapter version 5 and nodejs 18
I'm facing a problem after to update my sails, postgre adapter and nodejs version
when i try to use sails.sendNativeQuery in my log i receive it:
debug: {
command: undefined,
rowCount: undefined,
oid: undefined,
rows: undefined
}
the same query used…

Ademir Gomes
- 11
- 1
- 4