Questions tagged [sails-postgresql]

A Waterline adapter for PostgreSQL. May be used in a Sails app or anything using Waterline for the ORM.

106 questions
0
votes
1 answer

Sails ORM: How to know if found or Created in findOrCreate waterline function

I'm using the findOrCreate waterline model function. According to the documentation here, It checks for the existence of the record in the first parameter. If it can't be found, the record in the second parameter is created. Is there any way to know…
SpaceX
  • 555
  • 1
  • 6
  • 16
0
votes
1 answer

How to use the 'via' attribute in a collection with more than one PK?

How to use the 'via' attribute in a collection with more than one PK? Below is an example of a hasMany datamodel. The Model Definition. Persistence.prototype.collections.Device = Waterline.Collection.extend({ identity: 'device', connection:…
mluis
  • 213
  • 2
  • 13
0
votes
1 answer

Populating navigation bar data from DB

I have a sails application and I want to populate the navigation bar drop-down menu data from DB. I am using policies to call service and populate sails.config.views.locals.HeaderData variable But because of some async feature of sails the service…
Sam77
  • 21
  • 3
0
votes
1 answer

sailsjs - one POST multiple records and associations created

Invoice-Model: attributes: { number: { type: 'integer' } lines: { collection: 'line', via: 'invoice' } } Line-Model: attributes: { name: { type: 'integer' } invoice: { model: 'invoice' } } As you can see these…
EinArzt
  • 347
  • 3
  • 11
0
votes
1 answer

Sort populated record in sails waterline

I created a Sails application with two models Publication and Worksheet. They are having a one-to-one relationship. Sails-postgresql is the adapter I'm using. I'm using waterline orm to fire query to the database. I'm When I am trying to load…
Indranil Mondal
  • 2,799
  • 3
  • 25
  • 40
0
votes
1 answer

I want to store some credentials in the session at the time when server lifts in Sails

I am using Sails and Postgres and I want to save some credentials in the session at the start-up of server. Kindly help me. How can I do this, and is there any possibilities that it may give some error just because of database connectivity with the…
0
votes
1 answer

how to write CASE WHEN query with waterline js

how to write CASE WHEN query with waterline Model. SELECT description,order_no,CASE WHEN STATUS=1 THEN 'True' ELSE 'False' END AS STATUS FROM CATEGORY_MAS as category
Pranay Soni
  • 1,056
  • 10
  • 18
0
votes
1 answer

Multiple tables for a single model in Sails.js?

I currently have a website written in Perl, using Mojolicious and Mojo::Pg. One of the things it does is pull in and display data from my Ninja Block's temperature sensors. I have four tables in Postgres, outdoor_temperature, outdoor_humidity, and…
VirtualWolf
  • 653
  • 13
  • 23
0
votes
1 answer

Using HTML instead of ejs in sails

I am a newbie on sails framework and I started working on it then found that everything is in ejs. When I converted it into the HTML then it didn't work. How to write client-side in HTML using AngularJS without ejs or with least ejs possible if we…
ashishkumar148
  • 975
  • 1
  • 10
  • 26
0
votes
1 answer

Sails JS: Pass parameter to toJSON

The sailsjs model attribute method toJSON is very handy for processing model attributes before sending back to client. However, this method does not take any parameters and I cannot pass additional information to the method that can be used for…
JustWonder
  • 2,373
  • 3
  • 25
  • 36
0
votes
4 answers

SailsJs Models long integer support with postgresql

I'm having issues with a Sails application running with a PostgreSQL database. I needed to insert an 11 digits integer, but I can't find a simple way to tweak my models for this. Edit 1 here is an example of a model : /** * Phone.js * * @docs …
Raed
  • 519
  • 1
  • 6
  • 23
0
votes
0 answers

Sails application connecting to MySql / PgSql error

In my Sails application I have some integration tests in Mocha/Chai/Supertest that run against sails-disk database until today. Today I tried switching to actual databases, to test performance and behaviour as well as reliability of my models.…
Vee6
  • 1,527
  • 3
  • 21
  • 40
0
votes
1 answer

Sails JS Configured Route in Routes JS returns Not Found

I am using Sails JS, PostgreSQL stack. I want to pass two ids as parameters at the end of a url as below: /getLocation/cc/re Where 'cc' is a two letter country code e.g US and 're' is a an autocomplete query for a region of the country referred to…
watkib
  • 347
  • 3
  • 11
  • 25
0
votes
1 answer

sails.js unable to lift sails version 0.9.9 and sails-postgresql version 0.9.7

I am not able to lift sails version 0.9.9 with postgresql version 0.9.7 Here is the error message that I get debug: Lowering sails... /home/mandeep/iqr/thirstt/node_modules/sails-postgresql/lib/query.js:285 if(self._schema[key].type ===…
Mandeep Singh
  • 7,674
  • 19
  • 62
  • 104
0
votes
1 answer

findOrCreate creates duplicates

I'm using oracle adapter, async.each and findOrCreate to transfer some data from oracle to my postgres db: //simplified version oracle.select(sql, [], function(err, results) { async.each(results, function(add_me, async_cb){ …
maialithar
  • 3,065
  • 5
  • 27
  • 44