3 category: Ruby libraries
8 sequelize.sync().done -> ...
12 Project = sequelize.define('Project', {
13 title: Sequelize.STRING,
14 description: Sequelize.TEXT,
15 myDate: { type: Sequelize.DATE, defaultValue: Sequelize.NOW },
16 title: { type: Sequelize.STRING, allowNull: false },
17 id: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true },
19 classMethods: { ... },
20 instanceMethods: { ... }
27 Project.find(123).success (project) ->
29 Project.find({ where: {title: 'Hello'} })
30 Project.find({ where: {id: [1,3,4]} })
31 Project.find({ where: ["id > ?", 25] })
35 attributes: ['id', ['name', 'title']]
41 .findAll({ where: ... })
42 .findAll({ order: 'title DESC' })
43 .findAll({ limit: 10 })
44 .findAll({ offset: 10, limit: 2 })
51 item = Project.build({ ... })
55 item.save().success (item) ->
57 item.updateAttributes({ title: '...' })
59 item.destroy().success ->