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
