AST-based schema management for
One schema definition, perfectly optimized SQL for each database
# Define your schema once
model User {
id Serial @pk
email VarChar(255) @unique @notnull
name Text
role Enum('admin', 'user') @default('user')
createdAt Timestamp @default(CURRENT_TIMESTAMP)
}
model Post {
id Serial @pk
title Text @notnull
content Text
authorId Int @ref(User.id) @onDelete(CASCADE)
}
CREATE TABLE "User" (
"id" SERIAL PRIMARY KEY,
"email" VARCHAR(255) UNIQUE NOT NULL,
"name" TEXT,
"role" VARCHAR(50) DEFAULT 'user'
CHECK ("role" IN ('admin', 'user')),
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE `User` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`email` VARCHAR(255) UNIQUE NOT NULL,
`name` TEXT,
`role` ENUM('admin', 'user') DEFAULT 'user',
`createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARSET=utf8mb4;
CREATE TABLE "User" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"email" TEXT UNIQUE NOT NULL,
"name" TEXT,
"role" TEXT DEFAULT 'user'
CHECK ("role" IN ('admin', 'user')),
"createdAt" TEXT DEFAULT CURRENT_TIMESTAMP
);
Built for performance, security, and developer happiness
Only Node.js built-ins. No external packages means no supply chain attacks, faster installs, and smaller bundles.
SQL injection protection, path traversal prevention, file size limits, and SHA-256 integrity verification.
Written in strict TypeScript. Catch errors at compile-time, not runtime. Full IntelliSense support.
PostgreSQL, MySQL, and SQLite support. Same DSL generates optimized SQL for each database.
Real compiler pipeline: Lexer, Parser, AST, Generator. No regex hacks. Proper error messages with line numbers.
304 comprehensive tests with 100% pass rate. Battle-tested and production ready.
Built for reliability and performance
See why developers are switching
| Feature | Schemact | Prisma | Knex | TypeORM |
|---|---|---|---|---|
| Dependencies | 0 | ~50 | ~20 | ~100 |
| Custom DSL | ✓ | ✓ | ✗ | ✗ |
| AST-Based Compiler | ✓ | ✓ | ✗ | ✗ |
| Database Introspection | ✓ | ✓ | ✗ | ✗ |
| Integrity Checking | ✓ | ✗ | ✗ | ✗ |
| Multi-Database | ✓ | ✓ | ✓ | ✓ |
Everything you need to know
schemact pull command to introspect your existing database and generate a .sact schema file. This reverse-engineering feature supports all three databases.
Join developers who have switched to Schemact for a cleaner, faster, and more secure migration experience.