How to use the sequelize.ARRAY function in sequelize

To help you get started, we’ve selected a few sequelize 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 flow-typed / flow-typed / definitions / npm / sequelize_v4.x.x / flow_v0.42.x- / test_sequelize.js View on Github external
Sequelize.BLOB( 'tiny' );
Sequelize.BLOB( 'medium' );
Sequelize.BLOB( { length : 'medium' } );
Sequelize.BLOB( 'long' );
Sequelize.ARRAY( Sequelize.STRING );
Sequelize.ARRAY( Sequelize.STRING( 100 ) );
Sequelize.ARRAY( Sequelize.INTEGER );
Sequelize.ARRAY( Sequelize.HSTORE );
Sequelize.ARRAY( Sequelize.ARRAY( Sequelize.STRING ) );
Sequelize.ARRAY( Sequelize.TEXT );
Sequelize.ARRAY( Sequelize.DATE );
Sequelize.ARRAY( Sequelize.BOOLEAN );
Sequelize.ARRAY( Sequelize.DECIMAL );
Sequelize.ARRAY( Sequelize.DECIMAL( 6 ) );
Sequelize.ARRAY( Sequelize.DECIMAL( 6, 4 ) );
Sequelize.ARRAY( Sequelize.DOUBLE );
Sequelize.ARRAY( Sequelize.REAL );
Sequelize.ARRAY( Sequelize.JSON );
Sequelize.ARRAY( Sequelize.JSONB );
Sequelize.GEOMETRY;
Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
Sequelize.VIRTUAL( Sequelize.STRING );
Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
new Sequelize.VIRTUAL( Sequelize.STRING );
new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);

//
//  Deferrable
github flow-typed / flow-typed / definitions / npm / sequelize_v4.x.x / flow_v0.42.x- / test_sequelize.js View on Github external
Sequelize.BLOB( 'long' );
Sequelize.ARRAY( Sequelize.STRING );
Sequelize.ARRAY( Sequelize.STRING( 100 ) );
Sequelize.ARRAY( Sequelize.INTEGER );
Sequelize.ARRAY( Sequelize.HSTORE );
Sequelize.ARRAY( Sequelize.ARRAY( Sequelize.STRING ) );
Sequelize.ARRAY( Sequelize.TEXT );
Sequelize.ARRAY( Sequelize.DATE );
Sequelize.ARRAY( Sequelize.BOOLEAN );
Sequelize.ARRAY( Sequelize.DECIMAL );
Sequelize.ARRAY( Sequelize.DECIMAL( 6 ) );
Sequelize.ARRAY( Sequelize.DECIMAL( 6, 4 ) );
Sequelize.ARRAY( Sequelize.DOUBLE );
Sequelize.ARRAY( Sequelize.REAL );
Sequelize.ARRAY( Sequelize.JSON );
Sequelize.ARRAY( Sequelize.JSONB );
Sequelize.GEOMETRY;
Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
Sequelize.VIRTUAL( Sequelize.STRING );
Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
new Sequelize.VIRTUAL( Sequelize.STRING );
new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);

//
//  Deferrable
// ~~~~~~~~~~~~
//
//  https://github.com/sequelize/sequelize/blob/v3.4.1/test/integration/sequelize/deferrable.test.js
github populr-app / populr / server / database / twitter / model.js View on Github external
Twitter Model
****************/

/* * Imports * */

var Sequelize = require('sequelize');
var sql = require('../connection.js');

/* * Schema * */

module.exports = sql.define('twitter', {
  fullName: { type: Sequelize.STRING, allowNull: false, primaryKey: true },
  handle: { type: Sequelize.STRING },
  twitterId: {type: Sequelize.STRING },
  profilePic: {type: Sequelize.STRING, defaultValue: '' },
  tweets: { type: Sequelize.ARRAY(Sequelize.TEXT), defaultValue: [] },
  backgroundPic: {type: Sequelize.STRING, defaultValue: '' },
  followers: { type: Sequelize.INTEGER, defaultValue: 0 },
  followerschange: { type: Sequelize.INTEGER, defaultValue: 0 },
  score: { type: Sequelize.INTEGER, defaultValue: 0 },
  scorechange: { type: Sequelize.INTEGER, defaultValue: 0 },
  scorecounter: { type: Sequelize.INTEGER, defaultValue: 0 },
  scoreminute: { type: Sequelize.ARRAY(Sequelize.INTEGER), defaultValue: [] },
  scorehour: { type: Sequelize.ARRAY(Sequelize.INTEGER), defaultValue: [] },
  scoreday: { type: Sequelize.ARRAY(Sequelize.INTEGER), defaultValue: [] },
  scoreweek: { type: Sequelize.ARRAY(Sequelize.INTEGER), defaultValue: [] },
  scoremonth: { type: Sequelize.ARRAY(Sequelize.INTEGER), defaultValue: [] }
});

module.exports.sync();
github WeebDev / Commando / models / Star.js View on Github external
},
	authorID: {
		type: Sequelize.STRING,
		allowNull: false
	},
	starboardMessageID: {
		type: Sequelize.STRING,
		allowNull: false
	},
	stars: {
		type: Sequelize.INTEGER,
		allowNull: false,
		defaultValue: 0
	},
	starredBy: {
		type: Sequelize.ARRAY(Sequelize.STRING), // eslint-disable-line new-cap
		allowNull: false
	}
});

module.exports = Star;
github feathersjs-ecosystem / feathers-swagger / example / sequelize / app.js View on Github external
// Add your service(s)
    const model = user(this.get('sequelize')),
      options = {
        Model: model,
        paginate: {
          default: 5,
          max: 25
        }
      };

    const doc = {
      description: 'Operations about Users.',
      definitions: {
        'UserPaginate': swagger.definition({
          attributes: {
            data: Sequelize.ARRAY('users')
          }
        }, {
          extends: ['paginate']
        })
      },
      definition: swagger.definition(model),
      securities: ['find'],
      find: {
        parameters: [{
          description: 'Get examples by name',
          in: 'query',
          required: false,
          name: 'email',
          type: 'string'
        }],
        responses: {
github flow-typed / flow-typed / definitions / npm / sequelize_v4.x.x / flow_v0.42.x- / test_sequelize.js View on Github external
Sequelize.DECIMAL( { precision : 10, scale : 2 } );
Sequelize.DECIMAL( 10 );
Sequelize.DECIMAL( { precision : 10 } );
Sequelize.ENUM( 'value 1', 'value 2' );
Sequelize.BLOB;
Sequelize.BLOB( 'tiny' );
Sequelize.BLOB( 'medium' );
Sequelize.BLOB( { length : 'medium' } );
Sequelize.BLOB( 'long' );
Sequelize.ARRAY( Sequelize.STRING );
Sequelize.ARRAY( Sequelize.STRING( 100 ) );
Sequelize.ARRAY( Sequelize.INTEGER );
Sequelize.ARRAY( Sequelize.HSTORE );
Sequelize.ARRAY( Sequelize.ARRAY( Sequelize.STRING ) );
Sequelize.ARRAY( Sequelize.TEXT );
Sequelize.ARRAY( Sequelize.DATE );
Sequelize.ARRAY( Sequelize.BOOLEAN );
Sequelize.ARRAY( Sequelize.DECIMAL );
Sequelize.ARRAY( Sequelize.DECIMAL( 6 ) );
Sequelize.ARRAY( Sequelize.DECIMAL( 6, 4 ) );
Sequelize.ARRAY( Sequelize.DOUBLE );
Sequelize.ARRAY( Sequelize.REAL );
Sequelize.ARRAY( Sequelize.JSON );
Sequelize.ARRAY( Sequelize.JSONB );
Sequelize.GEOMETRY;
Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
Sequelize.VIRTUAL( Sequelize.STRING );
Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
github flow-typed / flow-typed / definitions / npm / sequelize_v4.x.x / flow_v0.42.x- / test_sequelize.js View on Github external
Sequelize.DECIMAL( 10, 2 );
Sequelize.DECIMAL( { precision : 10, scale : 2 } );
Sequelize.DECIMAL( 10 );
Sequelize.DECIMAL( { precision : 10 } );
Sequelize.ENUM( 'value 1', 'value 2' );
Sequelize.BLOB;
Sequelize.BLOB( 'tiny' );
Sequelize.BLOB( 'medium' );
Sequelize.BLOB( { length : 'medium' } );
Sequelize.BLOB( 'long' );
Sequelize.ARRAY( Sequelize.STRING );
Sequelize.ARRAY( Sequelize.STRING( 100 ) );
Sequelize.ARRAY( Sequelize.INTEGER );
Sequelize.ARRAY( Sequelize.HSTORE );
Sequelize.ARRAY( Sequelize.ARRAY( Sequelize.STRING ) );
Sequelize.ARRAY( Sequelize.TEXT );
Sequelize.ARRAY( Sequelize.DATE );
Sequelize.ARRAY( Sequelize.BOOLEAN );
Sequelize.ARRAY( Sequelize.DECIMAL );
Sequelize.ARRAY( Sequelize.DECIMAL( 6 ) );
Sequelize.ARRAY( Sequelize.DECIMAL( 6, 4 ) );
Sequelize.ARRAY( Sequelize.DOUBLE );
Sequelize.ARRAY( Sequelize.REAL );
Sequelize.ARRAY( Sequelize.JSON );
Sequelize.ARRAY( Sequelize.JSONB );
Sequelize.GEOMETRY;
Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
Sequelize.VIRTUAL( Sequelize.STRING );
github coding-blocks / hiring-blocks / db / models.js View on Github external
const db = new Sequelize(DATABASE_URL, {
  dialect: 'postgres'
});


const Student = db.define('student', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
  education: Sequelize.ARRAY(Sequelize.JSON),
  skills: Sequelize.ARRAY(Sequelize.JSON),
  compLanguages: Sequelize.ARRAY(Sequelize.JSON),
  projects: Sequelize.ARRAY(Sequelize.JSON),
  trainings: Sequelize.ARRAY(Sequelize.JSON),
  cbStudent: {type: Sequelize.BOOLEAN, defaultValue: false},
  cbCourses: Sequelize.ARRAY(Sequelize.STRING),
});

const CompanyManager = db.define('companymanager', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
  designation: Sequelize.STRING,
});


const Admin = db.define('admin', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
  cbCentre: Sequelize.STRING,
  cbDesignation: Sequelize.STRING
});

const User = db.define('user', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
github Bluegrass-Grief-Owls / coordin-eat / server / db / models / user.js View on Github external
email: {
		type: Sequelize.STRING,
		unique: true,
		allowNull: false
	},
	password: {
		type: Sequelize.STRING
	},
	salt: {
		type: Sequelize.STRING
	},
	googleId: {
		type: Sequelize.STRING
	},
	favoriteFood: {
		type: Sequelize.ARRAY(Sequelize.STRING),
		defaultValue: []
	}
})

module.exports = User

/**
 * instanceMethods
 */
User.prototype.correctPassword = function (candidatePwd) {
	return User.encryptPassword(candidatePwd, this.salt) === this.password
}

/**
 * classMethods
 */
github coding-blocks / hiring-blocks / db / models.js View on Github external
const DATABASE_URL = process.env.DATABASE_URL || ('postgres://' + secret.DB_USER + ":" + secret.DB_PASSWORD + "@" + secret.DB_HOST + ":5432/" + secret.DATABASE);


const db = new Sequelize(DATABASE_URL, {
  dialect: 'postgres'
});


const Student = db.define('student', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
  education: Sequelize.ARRAY(Sequelize.JSON),
  skills: Sequelize.ARRAY(Sequelize.JSON),
  compLanguages: Sequelize.ARRAY(Sequelize.JSON),
  projects: Sequelize.ARRAY(Sequelize.JSON),
  trainings: Sequelize.ARRAY(Sequelize.JSON),
  cbStudent: {type: Sequelize.BOOLEAN, defaultValue: false},
  cbCourses: Sequelize.ARRAY(Sequelize.STRING),
});

const CompanyManager = db.define('companymanager', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
  designation: Sequelize.STRING,
});


const Admin = db.define('admin', {
  id: {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
  cbCentre: Sequelize.STRING,
  cbDesignation: Sequelize.STRING
});

sequelize

Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift and Snowflake’s Data Cloud. It features solid transaction support, relations, eager and lazy loading, read replication and more.

MIT
Latest version published 28 days ago

Package Health Score

95 / 100
Full package analysis