How to use the waterline.Model function in waterline

To help you get started, we’ve selected a few waterline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github balderdashy / sails-hook-orm / lib / build-ontology-and-run-auto-migrations.js View on Github external
_.each(hook.models, function _loadEachModelDefIntoWaterline(normalizedModelDef, identity) {
      // Create a Waterline "Collection" instance for each model, then register it w/ the ORM.
      sails.log.silly('Registering model `%s` in Waterline', identity);
      orm.registerModel(Waterline.Model.extend(normalizedModelDef));
    });
github balderdashy / waterline / example / models / User.js View on Github external
/**
 * Example User Model
 *
 */

var Waterline = require('waterline');

var User = Waterline.Model.extend({

  /**
   * Set Table Name to whatever you want
   */

  tableName: 'waterline_user',

  /**
   * Attributes are equal to Database Columns
   * in a relational database or documents in a
   * document-oriented database.
   */

  attributes: {
    first_name: {
      type: 'string',

waterline

An ORM for Node.js and the Sails framework

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis