Sequelize Guard

Installation

Learn how to install and set up Sequelize Guard in your project.

Prerequisites

Before installing Sequelize Guard, make sure you have:

  • Node.js 18 or higher
  • Sequelize 6.x or higher
  • A supported database (PostgreSQL, MySQL, SQLite, MSSQL, etc.)

Package Installation

Install Sequelize Guard using your preferred package manager:

npm install sequelize-guard

Peer Dependencies

Sequelize Guard requires Sequelize as a peer dependency. If you haven't installed it yet:

npm install sequelize

You'll also need to install the database driver for your database:

PostgreSQL

npm install pg pg-hstore

MySQL

npm install mysql2

SQLite

npm install sqlite3

MSSQL

npm install tedious

Verify Installation

Create a simple test file to verify the installation:

import { SequelizeGuard } from 'sequelize-guard';
import { Sequelize } from 'sequelize';

const sequelize = new Sequelize('sqlite::memory:');
const guard = new SequelizeGuard(sequelize);

console.log('Sequelize Guard installed successfully!');

Run the test:

npx tsx test-guard.ts

If you see the success message, you're ready to start using Sequelize Guard!

Next Steps

On this page