A TypeScript ORM for ScyllaDB and SQL databases inspired by Laravel Eloquent
π Quick Start β’ π Documentation β’ π€ Contributing
ScyllinX is a modern Object-Relational Mapper (ORM) written in TypeScript, designed to provide a simple, expressive, and fluent API for working with databases. Inspired by Laravel Eloquent, it brings familiar Active Record patterns to Node.js while offering compatibility with both ScyllaDB (Cassandra-compatible) and traditional SQL databases.
- β Active Record Syntax β Define models and interact with them directly
- β‘ ScyllaDB-first design with SQL compatibility (SQLite, PostgreSQL, MySQL)
- π Rich relationship system β
hasOne,hasMany,belongsTo,belongsToMany, and more - π Type-safe Query Builder with full IntelliSense support
- π§ Model lifecycle hooks, casting, and validation
- π Automatic API Documentation using JSDoc + VitePress
- π‘ Composable schema definitions and decorators for cleaner models
- π§ͺ Built-in testing support with Jest
pnpm add scyllinx
# or
npm install scyllinx
# or
yarn add scyllinx| Database | Status | Driver |
|---|---|---|
| ScyllaDB/Cassandra | π§ͺ Beta | cassandra-driver |
| SQLite | π§ͺ Beta | better-sqlite3 |
| PostgreSQL | π§ͺ Beta | pg |
| MySQL | π§ͺ Beta | mysql2 |
| MongoDB | π§ͺ Beta | mongodb |
import { ConnectionManager } from 'scyllinx';
import { databaseConfig } from './config/database';
const connectionManager = ConnectionManager.getInstance();
await connectionManager.initialize(databaseConfig);
connectionManager.getConnection().connect();import { Model, HasMany } from 'scyllinx';
import { Post } from './models/Post'
interface UserAttributes {
id: string;
name: string;
email: string;
created_at?: Date;
updated_at?: Date;
// Relationships attributes
posts?: Post[]
}
class User extends Model<UserAttributes> {
protected static table = 'users';
protected static primaryKey = 'id';
protected static fillable = ['name', 'email'];
protected static timestamps = true;
// Define relationships
postsRelation(): HasMany<User, Post> {
return this.hasMany(Post, 'user_id');
}
}
// Declaration Merging IMPORTANT
interface User extends UserAttributes {}
export { User, UserAttributes }// Create a new user
const user = await User.create({
name: 'John Doe',
email: 'john@example.com'
});
// Find a user
const foundUser = await User.find('user-id');
// Query with conditions
const activeUsers = await User.query()
.where('active', true)
.orderBy('created_at', 'desc')
.limit(10)
.get();
// Update a user
await user.update({ name: 'Jane Doe' });
// Delete a user
await user.delete();π Full documentation is available at: https://selori.github.io/scyllinx
We welcome contributions of all kinds!
- Fork and clone the repository
- Use
pnpmto install dependencies - Use conventional commits (e.g.,
feat:,fix:) - Run
pnpm lint && pnpm testbefore submitting a PR - Update documentation if applicable
Please see our Contributing Guide for details.
MIT Β© ScyllinX Team β 2025 See LICENSE for full license text.
Developed with β€οΈ for modern TypeScript applications