I hereby claim:
- I am particlebanana on github.
- I am particlebanana (https://keybase.io/particlebanana) on keybase.
- I have a public key ASAh5PURM8Grk0dq4iEGRXSFQ2QmMBy-JpMxUAW0_4TCXwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
These are the various pieces that involved in the new version of Waterline. It's a major update that brings in a lot of low-level functionality into userland code.
URL: https://github.com/treelinehq/waterline-query-docs
// ╔═╗╦═╗╔═╗╦╔╗╔╔═╗╔╦╗╔═╗╦ ╦ ┌─┐┌─┐┌┬┐ ┌┐┌┌─┐┌┬┐┬─┐┌─┐ ┌─┐┬┬ ┌─┐ | |
// ╠═╝╠╦╝║╣ ║║║║╚═╗ ║ ╠═╣║ ║ └─┐├┤ │ │││├─┘│││├┬┘│ ├┤ ││ ├┤ | |
// ╩ ╩╚═╚═╝╩╝╚╝╚═╝ ╩ ╩ ╩╩═╝╩═╝ └─┘└─┘ ┴ ┘└┘┴ ┴ ┴┴└─└─┘ └ ┴┴─┘└─┘ | |
// | |
// Used in production to install npm private modules | |
if(process.env.NODE_ENV !== 'production') { | |
return; | |
} | |
var fs = require('fs'); |
module.exports.connections = { | |
localMongoDb: { | |
adapter: 'sails-mongo', | |
host: 'localhost', | |
port: 27017, | |
database: 'mongo-one' | |
}, | |
localMongoDbTwo: { |
/** | |
* User.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/#!documentation/models | |
*/ | |
module.exports = { | |
attributes: { |
var _ = require('lodash'), | |
async = require('async'), | |
Waterline = require('waterline'); | |
// Instantiate a new instance of the ORM | |
var orm = new Waterline(); | |
var mysqlAdapter = require('sails-mysql'); | |
var config = { |
/** | |
* A simple example of how to use Waterline v0.10 with Express | |
*/ | |
var express = require('express'), | |
_ = require('lodash'), | |
app = express(), | |
Waterline = require('waterline'); | |
/** | |
* Bootstrap | |
*/ | |
var Sails = require('sails'); | |
/** | |
* Before ALL the test bootstrap the server | |
*/ |
// An example controller from /api/controllers/StoreController.js | |
module.exports = { | |
typeA: function(req, res) { | |
res.send('typeA action with Lang Type: ' + req.languageType); | |
}, | |
typeB: function(req, res) { | |
res.send('typeB action with Lang Type: ' + req.languageType); |
// Simple User model | |
// /api/models/User.js | |
module.exports = { | |
attributes: { | |
name: 'string' | |
} | |
}; |