Questions tagged [waterline]

Waterline is an adapter-based ORM for Node. It is included with the Sails.js framework.

Waterline 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.

At the same time, Waterline aims to learn lessons and maintain the best features from both Rails' ActiveRecord and Grails' Hibernate ORMs.

Waterline uses the concept of an Adapter to translate a predefined set of methods into a query that can be understood by your data store. Adapters allow you to use various datastores such as MySQL, PostgreSQL, MongoDB, Redis, etc. and have a clear API for working with your model data.

It also allows an adapter to define it's own methods that don't necessarily fit into the CRUD methods defined by default in Waterline. If an adapter defines a custom method, Waterline will simply pass the function arguments down to the adapter.

Project GitHub


Related tags :

1230 questions
0
votes
1 answer

Why does sails.js raise so many browser console errors when I enable layouts?

Please speak slowly and clearly and use simple words-- I have no previous experience with node.js, sails.js, ejs, or grunt. I come from a PHP background. We are developing a website based on sails.js and ejs. When we enable layouts in…
jasper
  • 137
  • 1
  • 9
0
votes
1 answer

SailsJS One to Many associations

Hi I'm building a Sails app with a couple of models in a one to many configuration. I've been able to create new instances of the models via the relationship, but it seems to be only working one way. For reference (one) project can have (many)…
0
votes
1 answer

Sails inconsistent record creation

I use the following piece of code to create some records. If I provide incorrect values, say(password and passwordConfirmation does not match), then sometimes an institute record is created without a rollback and sometimes, rollback happens…
Derick
  • 191
  • 4
0
votes
1 answer

CRUD in Sails.js model

I have created a Sails.js Model by using command "sails generate model". The model is generated as follows: module.exports = { connection: 'someMysqlServer', attributes: { amount : { type: 'float' }, country : { type: 'string' }, …
Danial
  • 703
  • 1
  • 11
  • 26
0
votes
1 answer

Advanced request in waterline (sails, nodejs)

I have the Video model (Waterline) Video -title -description -matches (array) [0] - MatchTitle - MatchDescription [1] ... [N] How can I find videos which contains matches with title "ABC" for example ? I wrote…
vromanch
  • 939
  • 10
  • 22
0
votes
1 answer

sails.js One to many associations -- TypeError: Cannot convert null to object

I am getting this strange error recently. It was not there earlier and I don't remember changing much. error: Error (E_UNKNOWN) :: Encountered an unexpected error TypeError: Cannot convert null to object at hasOwnProperty (native) at…
Mandeep Singh
  • 7,674
  • 19
  • 62
  • 104
0
votes
0 answers

Waterline + Sails 0.10rc8/0.10rc9: beforeCreate not executing in sequence

My models are based on waterline: var Waterline = require('waterline'); var User = Waterline.Collection.extend({..}); Here is my User.js /** * User.js * * @description :: User Model * @docs :: http://sailsjs.org/#!documentation/models …
rajan
  • 33
  • 6
0
votes
1 answer

Using Model method waterline

I'm starting with koa and waterline ORM. I have a problem when I try to use "testFucntion" method from this waterline model from my controller: "use strict"; //https://github.com/balderdashy/waterline-docs var Waterline = require('waterline'); var…
0
votes
1 answer

Is there a way i can create a collection at runtime in SailsJs?

What I've understood, sails binds collection with its Models. Is there a way i can create a collection on runtime. What i want to do is create a different collection for each user. something like (user_12345, unique for every user). I've tried…
northdakota
  • 3
  • 1
  • 5
0
votes
2 answers

Deep assignment of Javascript object is not working (NodeJS)

What I am trying to do I am trying to deeply re-map an existing array of objects using a mapping function. The mapping it self works as you can see in "output 1" below, but the deep assignment of the object is not working, which means, it is not…
user2867106
  • 1,139
  • 1
  • 13
  • 31
0
votes
1 answer

Sails.js : Compile native database functions/procedures on sails lift

I am using sails.js with postgres as the database. Although most of the actions can be easily handled via waterline ORM, there are certain cases I prefer to use native queries and sometimes even postgres' native stored functions. However, the…
Mandeep Singh
  • 7,674
  • 19
  • 62
  • 104
0
votes
1 answer

Using Sails.js is it possible to sort with waterline by true/false?

I'm using Sails.js and thus, Waterline and I'm wondering if the following is possible? teamFind: function(req,res,next){ User.find().skip(req.param('listPage')).limit(26).sort('school').sort('officialUser').exec(function(err,users){ …
gregdillon
  • 23
  • 4
0
votes
1 answer

var schemaAttributes = this.waterline.schema[this.identity].attributes ** Waterline 0.10.0 - Sails v0.9.16

Hello I'm really new in Sails and Nodejs, Im using mysql as a DB. I got this error var schemaAttributes = this.waterline.schema[this.identity].attributes; TypeError: Cannot read property 'schema' of undefined and I tried reinstalling the module…
Pablo Solís
  • 109
  • 1
  • 4
0
votes
2 answers

Passing boolean through Waterline (Sailsjs)?

I have a problem case testing HTML input for truthiness, and then getting the true or false case to save through the ORM: open_to_public: (req.param('open_to_public') == 't' ? true: false), The Waterline docs say that strings will fail to…
RSAdmin
  • 419
  • 1
  • 6
  • 20
0
votes
2 answers

Iteration on async.auto?

This below is my snippet code of sailsJS. This code is work on me. afterCreate: function( value, callback ) { var getStock = function( cb ) { PurchaseInvoiceDetail .find({ product: value.product.id }) .then(function( detail…
Pewh Gosh
  • 1,031
  • 1
  • 11
  • 29