Registry / database / slintorm

slintorm

JSON →
library1.0.0jsnpmunverified

SlintORM v1.0.0 is a minimal, fully typed ORM for TypeScript that supports SQLite, PostgreSQL, and MySQL. Released as a stable version with no specified release cadence, it distinguishes itself from other ORMs like TypeORM or Prisma by offering a lightweight, Go's GORM-inspired API with explicit decorator-driven schema definitions in interfaces. Key features include auto table creation, migrations, type-safe queries, relationships (one-to-one, one-to-many, many-to-many), advanced query building (joins, aggregates, subqueries, window functions, preloads), and soft deletes. It currently lacks a large community or extensive documentation, positioning it as a niche alternative for developers seeking minimalism over full-featured ORMs.

npm install slintorm
INSTALL
IMPORT
SIG · SLINTORM
S
slintorm
databasejavascriptv1.0.0
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.

ORMManager
✓ import ORMManager from 'slintorm'
✗ const ORMManager = require('slintorm')
Package is ESM-only (TypeScript). CommonJS require will not work.
Model
✓ import { Model } from 'slintorm'
✗ import Model from 'slintorm'
Model is a named export, not default.
DataType
✓ import { DataType } from 'slintorm'
DataType provides type constants for column definitions.

Initializes ORMManager with SQLite, defines a User model, syncs schema, and queries users by name.

import ORMManager from 'slintorm'; const orm = new ORMManager({ driver: 'sqlite', database: 'test.db', host: 'localhost', port: 5432, username: process.env.DB_USER ?? 'user', password: process.env.DB_PASS ?? '' }); interface User { id?: number; name: string; email?: string; createdAt?: string; deletedAt?: string; } const userModel = orm.model<User>({ table: 'users', schema: User }); async function main() { await orm.sync(); const users = await userModel.find({ where: { name: 'Alice' } }); console.log(users); } main().catch(console.error);
Debug
Known issues
breakingModel interface comments with @ annotations are parsed as schema definitions. Omitting @auto on primary key may cause auto-increment not to work.
fix
Ensure every model interface uses @auto on auto-increment primary keys like id?: number.
affects: >=1.0.0
gotchaThe package does not support runtime validation of nullable fields. Declaring a field as optional (?) in TypeScript does not enforce nullable in DB if @nullable is missing in comment.
fix
Always add @nullable comment annotation to fields that should accept NULL values, even if TypeScript marks them optional.
affects: >=1.0.0
gotchaSoft delete is enabled by adding @softDelete in interface comment. Without it, deletedAt field is not automatically managed.
fix
Add @softDelete comment to the deletedAt field in your model interface to enable soft delete functionality.
affects: >=1.0.0
gotchaRelationships defined with @relation or @relationship annotations are not type-checked against actual foreign keys. Mismatched foreignKey names cause silent runtime errors.
fix
Double-check foreignKey in relationship annotations matches an actual column in the model interface.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'better-sqlite3'
Missing optional dependency for SQLite driver.
fix
npm install better-sqlite3
TypeError: orm.sync is not a function
ORMManager instance may not have sync method if driver initialization failed.
fix
Ensure driver option is correctly set and the database file path is valid.
QueryFailedError: table 'users' already exists
Running sync() multiple times on existing tables without migration strategy.
fix
Use orm.sync({ alter: true }) to auto-migrate schema changes without recreating tables.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
better-sqlite3optionalRequired for SQLite driver support
pgoptionalRequired for PostgreSQL driver support
mysql2optionalRequired for MySQL driver support
Agent activity
12 hits · last 30 days
node
12
Resources
slintorm — npm install slintorm · libregistry