Questions tagged [sails-postgresql]

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

103 questions
12
votes
1 answer

Using sails.js with an existing postgres database

I was looking at using Sails for an app that we are developing. I'm using the sails-postgresql adapter which uses the waterline orm. I have an existing database that I want to connect to. If I create a model using generate something and then in my…
Senica Gonzalez
  • 7,310
  • 14
  • 61
  • 101
5
votes
1 answer

Model Attribute Type: what is the difference between json and ref?

In the documentation regarding built-in data types, it is written: json: Any JSON-serializable value, including numbers, booleans, strings, arrays, dictionaries (plain JavaScript objects), and null. ref: Any JavaScript value except undefined.…
Julien Le Coupanec
  • 6,324
  • 3
  • 43
  • 56
5
votes
1 answer

sails-postgresql AdapterError: Unexpected error from database adapter: there is no parameter $1

Im pretty new to sails, im trying to create an authentication schema in my postgresql db. I have an user model module.exports = { attributes: { firstName: { type: 'string' }, lastName: { type: 'string' }, email: { …
Matúš Bartko
  • 2,115
  • 1
  • 24
  • 39
4
votes
2 answers

error: error: password authentication failed for user "electron_release_server_user"

I was messing around with this amazing Sails project here. I managed to get it 100% functional on my Macbook Pro with little to no difficulty. Here's my fork. Now I'm trying to get it working on an Azure Ubuntu 14.04 box and after running it with…
4
votes
1 answer

How to get the value of decoded JSON Web Token (JWT)

I'm using the Mailgun node machine-pack to send an email with a url that has a JWT created using machinepack-jwt in it. When the user clicks "confirm" in the generated email it hits my Sails controller method where I want to decode the JWT. I keep…
Brad W
  • 2,468
  • 2
  • 15
  • 26
4
votes
1 answer

What's the best way to handle database columns with numeric data type in Sails.js?

I have an existing PostgreSQL database with lots of columns with data types like "numeric(27,10)" or "numeric(17,2)". In the Sails models I've set up for each table, I list the type of each attribute as either integer or float. However, when Sails…
carpiediem
  • 1,376
  • 12
  • 29
4
votes
2 answers

get Selected fields in .populate() waterline-postgresql .populate('fieldName',{select:[]})

select query is not working in .populate() of waterline-postgresql. Model.find(query).populate(assoc.alias,{select:['field1','field2']}); This is not working in waterline-postgresql adapter. Is this not supported or Am I making any mistake?
Satyam Koyani
  • 4,168
  • 2
  • 20
  • 46
3
votes
3 answers

How to dynamically connect to databases in Sails.js

I am rebuilding a legacy PHP application using nodejs and I choose sailsjs after about a week of exploration. Everything was fine until I realised that in sails you only have access to session variables in your controllers. Thus, I cannot make…
ArrowHead
  • 555
  • 4
  • 15
3
votes
2 answers

sails.js -postgresql returning string value instead of integer for bigint fields

We are migrating a project from PHP to Node.js using Sails.js as the backend framework. We cannot modify our database and have to use the existing database for this project. If I keep the migrate: "alter" for a newly created model, Sails by default…
Mandeep Singh
  • 6,485
  • 17
  • 56
  • 90
2
votes
3 answers

How can I use the Find method to perform a case insensitive search on the database field?

I am unable to get the case insensitive search from the database using Sails.js V1.0 + Waterline ORM. I am using sails-postgresql adapter. The running environment is Heroku + Heroku PostgreSQL. Is there any way to turn off the following setting in…
2
votes
1 answer

How to mock a Sails.js / Waterline Model during testing

I am trying to mock a Sails Model using sinon.js. I have a problem when I am testing the part where I'm using .fetch() alongside Model.create() to retrieve the newly created row. Here is my code I want to mock: ... let newObject = await…
benomite
  • 738
  • 4
  • 20
2
votes
1 answer

Sails database configuration issue with postgresql

I upgrade sails to 1.0, I resolved all the other errors but not able to resolved database connection issue, It will be really helpful if anyone can reply on this. module.exports.datastores = { localDiskDb: { adapter: 'sails-disk' }, …
Farhan Chauhan
  • 315
  • 1
  • 3
  • 13
2
votes
2 answers

extra columns in model association sailsjs

How can I have an extra column in postgres with sailsjs model association? This is an example of my two models // Users.js attribute ... challenges: { collection: 'challenge', via: 'userChallenge' } // Challenge.js…
suskind
  • 68
  • 4
2
votes
1 answer

Sails ORM: How to pass value with array in valuesToEscape parameter

I've rawQuery which requires comma separated string but according to the documentation here, the second argument should be an array: An array of dynamic, untrusted strings to SQL-escape and inject within the SQL string using the appropriate…
SpaceX
  • 355
  • 1
  • 4
  • 14
2
votes
0 answers

Inserting timestamp with microseconds in PostgreSQL using Waterlinejs

I'm trying to save a timestamptz with microsecond precision like this one: 2016-10-18T13:36:38.431555 I have tested PostgreSQL alone and it works fine: CREATE TABLE test(mytime timestamptz); INSERT INTO test('2016-10-18T13:36:38.431555'); SELECT *…
1
2 3 4 5 6 7