Skip to content

Instantly share code, notes, and snippets.

@LexVocoder
LexVocoder / sequelize.js
Last active June 16, 2026 00:10
Sequelize syntax reference
// How to import from sequelize
const { Sequelize, DataTypes } = require('sequelize');
// How to instantiate a connection pool to sqlite
const sequelize = new Sequelize('sqlite::memory:', { logging: false });
// How to define a table
const Account = sequelize.define('Account', {
type: { type: DataTypes.ENUM('savings', 'checking'), allowNull: false },
name: { type: DataTypes.STRING, allowNull: false },