FoundryORM

A powerful, enterprise-grade ORM for TypeScript and Node.js. Support for PostgreSQL, MySQL, SQLite, and MongoDB with connection pooling, transactions, and type safety.

Everything you need for enterprise applications

Built for scale with connection pooling, transaction support, and type safety.

Multi-Database Support

Works seamlessly with PostgreSQL, MySQL, SQLite, and MongoDB. One API for all databases.

Connection Pooling

Built-in connection pooling for optimal performance and resource management.

SQL Injection Protection

Parameterized queries protect your application from SQL injection attacks.

TypeScript First

Full TypeScript support with decorators, type safety, and IntelliSense.

Transaction Support

Complete transaction management with automatic commit and rollback.

Flexible Query Builder

Intuitive fluent API for building complex queries with ease.

Multi-Database Support

One API, multiple databases. Choose what fits your project.

PostgreSQL
MySQL
SQLite
MongoDB

Get started in minutes

Simple setup with decorators and type safety. No complex configurations required.

Define models with decorators.
Use @Entity and @Column decorators for type-safe database mapping.
Connect to any database.
PostgreSQL, MySQL, SQLite, or MongoDB - your choice.
Start querying immediately.
Built-in CRUD operations with transaction support.
1import { Connection, Entity, Column, BaseModel } from 'foundry-orm';
2
3// Define your model
4@Entity('users')
5class User extends BaseModel {
6  @Column('id')
7  id!: number;
8
9  @Column('name')
10  name!: string;
11
12  @Column('email')
13  email!: string;
14}
15
16// Connect to database
17const connection = new Connection('postgres', {
18  host: 'localhost',
19  port: 5432,
20  database: 'mydb',
21  user: 'postgres',
22  password: 'password'
23});
24
25await connection.connect();
26BaseModel.setConnection(connection);
27
28// Use it!
29const user = await User.create({
30  name: 'John Doe',
31  email: '[email protected]'
32});
33
34const allUsers = await User.findAll();