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-guardPeer Dependencies
Sequelize Guard requires Sequelize as a peer dependency. If you haven't installed it yet:
npm install sequelizeYou'll also need to install the database driver for your database:
PostgreSQL
npm install pg pg-hstoreMySQL
npm install mysql2SQLite
npm install sqlite3MSSQL
npm install tediousVerify 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.tsIf you see the success message, you're ready to start using Sequelize Guard!
Next Steps
- Getting Started Guide - Learn the basics
- Configuration - Configure Sequelize Guard
- API Reference - Explore the full API