Skip to main content

Installation

Install Hysteria ORM using your preferred package manager:

yarn add hysteria-orm
# or
npm install --save hysteria-orm

Development Dependencies

When working with TypeScript, install the following dev dependencies to run the CLI and migrations:

yarn add bundle-require esbuild typescript -D

Database Drivers

Install the driver for your target database:

DatabasePackage
PostgreSQLpg
MySQL/MariaDBmysql2
SQLitesqlite3
MongoDBmongodb
Redisioredis
MSSQLmssql
OracleDBoracledb

Example:

npm install pg

Quick Setup with CLI

The CLI can initialize your project with the standard configuration:

npx hysteria init --type <database-type>

Available types: sqlite, mysql, postgres, mariadb, cockroachdb, mssql, oracledb, mongodb, redis

This creates:

your-project/
├── database/
│ ├── index.ts # Database connection configuration
│ └── migrations/ # Migration files folder (SQL databases only)

The CLI also installs the required dependencies automatically.


Next: Setup