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
2 answers

SailsJS One-To-Many not working since v0.11.0

I'm currently working on an SailsJS app. I started to work with version 0.10.5 and implemented lots of models with inheritance between them. All was working fine. Today, I decided to update my SailsJS project to version 0.11.0. I've read that the…
fwoelffel
  • 412
  • 7
  • 16
0
votes
1 answer

Sailsjs/Waterline : How to populate model after Model.Query()?

I'm use bluebird library and promise, How to populate model after Model.Query()? my following code is error: var Promise = require('bluebird'); var pmodel = Promise.promisify(someModel.query); pmodel .("custom sql") .populate("attributes_id") …
0
votes
1 answer

Transaction in orientdb and waterline

I am trying to to create transaction in waterline but I am getting this error from OrientDB: com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.BEGIN Here is my…
9me
  • 1,078
  • 10
  • 36
0
votes
1 answer

How to sort after populate?

i have the following models : Appgroupmodule.js module.exports = { autoPK: false, freezeTableName: true, autoCreatedAt: false, autoUpdatedAt: false, attributes: { appgroup_id:{ model: 'Appgroup' }, appmodule_id:{ …
0
votes
1 answer

Using waterline advanced queries via io.socket

I'm trying to get a subset of underlying mongodb collection that fits in particular datetime range. So here is a code: io.socket.get('/myResource', { sort: 'myDatetimeField', where: { myDatetimeField: { '>':…
Radagast
  • 5,798
  • 3
  • 22
  • 18
0
votes
1 answer

Waterline Edges associations

I just prepared a model which contains two vertices and one edge between them, v1, v2 and e1, while v1 is instance or vertex of class A, and v2 is vertex of class B. e1 is the instance of class E. I wanted to prepare schema in waterline for this…
Zeeshan
  • 375
  • 1
  • 3
  • 17
0
votes
2 answers

Waterline trying to access ID field

Currently Im using this model (with sails.js) module.exports = { tableName: 'player_deaths', autoCreatedAt: false, autoUpdatedAt: false, attributes: { player_id: { required: true, type: 'integer' }, …
Raggaer
  • 3,244
  • 8
  • 36
  • 67
0
votes
1 answer

Waterline defaultsTo not setting the value before inserting into db

The title is pretty straight forward. I have an attribute which looks like this: isSet: { type: boolean, defaultsTo: false } So my goal is to have the value set to false everytime a user is created. But when I do create a user this…
dkx22
  • 1,103
  • 1
  • 13
  • 25
0
votes
1 answer

How can I model a one-to-one relationship on a primary key in Waterline?

I have a pair of tables (MySQL, if you're curious) such that one is a primary table and one is an auxiliary table whose PK is an FK to the first one -- they share a one-to-one relationship. I've defined both tables adequately, but I run into trouble…
jesdynf
  • 434
  • 1
  • 3
  • 8
0
votes
1 answer

How do custom and multilanguage messages errors on sails js

I saw this question, he explain the method for create a custom messages but not says how do messages with multi languages in the errors. Thanks for your help.
andalm
  • 81
  • 6
0
votes
0 answers

sailsjs access associations in full response object in afterDestroy

When using the DELETE blueprint, in the afterDestroy hook, the destroyedRecord returned DOES NOT contain associations. However, the response sent DOES contain the associations. Is there a way to access these through afterDestroy? Basically, the…
gotmikhail
  • 843
  • 1
  • 6
  • 19
0
votes
1 answer

push values to sails.js collection

I'm working in a little project in sails.js, i have two models: Empresa and Noticia, the Empresa Model have a collection of Noticia and the Noticia model have a empresa relation: Empresa.js module.exports = { attributes: { nombre: { …
Daniel Rdz
  • 45
  • 5
0
votes
1 answer

Sails.js: How to properly handle request parameters/queries to backend?

I'm developing an application using Sails.js in the backend, and I'm having trouble validating requests as follows: I want to block access to certain resources based on an attribute of the logged in user. I have the REST API blueprints enabled, and…
Fissio
  • 3,748
  • 16
  • 31
0
votes
2 answers

Sails js model association

I currently have a News model and Comments model. Comments are showed up from X id news so for news with id 5 load comments with id 5. My models looks like this module.exports = { tableName: 'raggaer_aac_news', autoCreatedAt: false, …
Raggaer
  • 3,244
  • 8
  • 36
  • 67
0
votes
2 answers

How to update (override) a collection association's value in sails.js?

I have a model that has an attribute that is a collection association: Take for example, a User model below. module.exports = { attributes: { pets: { collection: 'pet' } } } I am aware that I can add pets to a user instance…
DevX
  • 1,714
  • 2
  • 14
  • 17