Registry / database / hysteria-orm

hysteria-orm

JSON →
library11.0.6jsnpmunverified

Hysteria ORM is a modern, high-performance ORM for Node.js supporting SQL (PostgreSQL, MySQL, SQLite via sqlite3) and experimental NoSQL (MongoDB, Redis) databases. Currently at version 11.0.6, it ships TypeScript types and requires esbuild 0.28+, ioredis 5.10+, mongodb 7.1+, mssql 12.2+, mysql2 3.20+, oracledb 6.10+, pg 8.20+, sqlite3 6.0+, typescript 6.0+, and zod 4.4+ as peer dependencies. Key differentiators: unified API across multiple database engines, partial type safety, and active development with frequent breaking changes. Not recommended for production use.

npm install hysteria-orm
INSTALL
IMPORT
SIG · HYSTERIA-ORM
H
hysteria-orm
databasejavascriptv11.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HysteriaORM
import { HysteriaORM } from 'hysteria-orm'
const HysteriaORM = require('hysteria-orm')
ESM-only package; CJS require will fail.
Model
import { Model } from 'hysteria-orm'
import Model from 'hysteria-orm'
Named export, not default.
buildSchema
import { buildSchema } from 'hysteria-orm/schema'
import { buildSchema } from 'hysteria-orm'
Subpath export; available since v11.

Connects to a PostgreSQL database, defines a User model with Zod schema, and performs a findMany query.

import { HysteriaORM, Model } from 'hysteria-orm'; import { z } from 'zod'; const orm = new HysteriaORM({ client: 'pg', connection: { host: 'localhost', port: 5432, user: 'postgres', password: process.env.DB_PASSWORD ?? 'password', database: 'test', }, }); const UserSchema = z.object({ id: z.number().int(), name: z.string(), email: z.string().email(), }); const User = new Model('users', UserSchema); async function main() { await orm.connect(); const users = await User.findMany(); console.log(users); await orm.disconnect(); } main().catch(console.error);
Debug
Known issues
breakingBreaking changes occur between minor versions due to active development.
fix
Pin to exact version and update imports as per changelog.
affects: >=11.0.0
deprecatedNoSQL support (MongoDB, Redis) is experimental and may be removed.
fix
Use SQL drivers for production.
affects: >=11.0.0
gotchaMultiple peer dependencies must be installed manually; orm will fail silently if drivers are missing.
fix
Install required drivers: npm install pg mysql2 sqlite3 etc.
affects: >=11.0.0
gotchaESM-only; requires Node.js >=22 and 'type':'module' in package.json.
fix
Add 'type':'module' and use import syntax.
affects: >=11.0.0
gotchaSubpath imports like 'hysteria-orm/schema' may change without notice.
fix
Check documentation for current export paths.
affects: >=11.0.0
gotchaZod schemas must use .strict() or else extra fields are silently dropped.
fix
Use z.object({...}).strict() on your schemas.
affects: >=11.0.0
Errors
Common errors & fixes
Error: Cannot find module 'pg'
Missing peer dependency for PostgreSQL.
fix
npm install pg
TypeError: HysteriaORM is not a constructor
Using CJS require instead of ESM import.
fix
Use import { HysteriaORM } from 'hysteria-orm'
Error: Schema validation failed: Unrecognized key(s) in object: 'extra'
Zod schema not strict; extra fields not allowed.
fix
Add .strict() to your Zod object schema.
Upgrade
Version history
11.0.6latest on npm
Audit
Dependencies
pgoptionalPostgreSQL driver
mysql2optionalMySQL driver
sqlite3optionalSQLite driver
mongodboptionalMongoDB driver
ioredisoptionalRedis driver
mssqloptionalMSSQL driver
oracledboptionalOracle DB driver
esbuildrequiredRequired for runtime compilation
typescriptrequiredRequired for schema type generation
zodrequiredSchema validation
Agent activity
6 hits · last 30 days
node
6
Resources