📗 Go Guide • 📘 TypeScript Guide • 📙 Python Guide • 🦀 Rust Guide • 📋 Release Notes
A powerful, database-agnostic ORM built in Go with multi-database support and type-safe code generation for Go, JavaScript/TypeScript, Python, Kotlin, Java, and Rust.
- 🗃️ Multi-Database Support: PostgreSQL, MySQL, SQLite, ScyllaDB/Cassandra, ClickHouse (full ORM)
- 🔄 Migration Management: Create, apply, and track migrations with transaction safety
- 📤 Smart Export System: JSON, CSV, SQLite formats
- 🔧 Code Generation: Type-safe code for Go, TypeScript/JavaScript, Python, Kotlin, Java, and Rust
- 🎯 Typed JSON Columns:
@jsonannotations generate typed classes for JSONB with auto-serialization - 🔄 Smart Migrations: Auto-detects column/table renames (preserves data), generates reversible down migrations
- 🌱 Database Seeding: Generate realistic fake data for development
- ⚡ Blazing Fast: Outperforms Drizzle and Prisma in benchmarks
- 📊 FlashORM Studio: Visual database management for SQL, MongoDB, and Redis
| Operation | FlashORM | Drizzle | Prisma |
|---|---|---|---|
| Insert 1000 Users | 149ms | 224ms | 230ms |
| Complex Query x500 | 3156ms | 12500ms | 56322ms |
| Mixed Workload x1000 | 186ms | 1174ms | 10863ms |
| TOTAL | 5980ms | 17149ms | 71510ms |
2.8x faster than Drizzle, 11.9x faster than Prisma
curl -fsSL https://lumos-labs-hq.github.io/flash/install.sh | bashcurl -fsSL https://lumos-labs-hq.github.io/flash/install.sh | bashirm https://lumos-labs-hq.github.io/flash/install.ps1 | iex# NPM (Node.js/TypeScript)
npm install -g flashorm
# Python
pip install flashorm
# Go
go install github.com/Lumos-Labs-HQ/flash@latest# 1. Initialize project (auto-detects Go/Node/Python/Kotlin/Java/Rust)
flash init --postgresql # or --mysql, --sqlite, --scylla, --clickhouse
# 2. Set database URL
export DATABASE_URL="postgres://user:pass@localhost:5432/mydb"
# 3. Create and apply migrations
flash migrate "create users table"
flash apply
# 4. Generate type-safe code
flash gen| Command | Description |
|---|---|
flash init |
Initialize project |
flash migrate <name> |
Create migration |
flash apply |
Apply migrations |
flash down |
Rollback migration |
flash status |
Show status |
flash pull |
Extract schema from database |
flash studio |
Launch visual editor |
flash export |
Export database |
flash seed |
Seed with fake data |
flash gen |
Generate type-safe code |
flash gen -f |
Force regenerate (skip cache) |
flash gen --db <name> |
Generate for specific database |
flash dblist |
List all configured databases |
flash issues |
File a validated bug/feature report to the Flash repo |
flash update |
Update plugins and flash binary |
flash uninstall |
Remove flash and ~/.flash |
When you run flash init, FlashORM generates a FLASH.md file in your project root. This file is a complete, self-contained reference designed for AI coding agents (Cursor, Copilot, Kiro, etc.) — so they can drive FlashORM correctly without guessing.
FLASH.md contains:
- The exact database/provider for this project
- Query parameter style (
$1vs?) for your database - Complete schema and query examples from your scaffolding
- All annotations:
@cache,@json,@required - Supported databases table with parameter styles
- Caching annotation syntax with examples in all 6 languages
- Typed JSON column examples in all 6 languages
- How to file bugs via
flash issues
Keep FLASH.md committed — agents on any machine can read it.
File a structured bug report or feature request directly to the Flash GitHub repo:
# Bug report
flash issues \
-k bug \
-t "gen: short description of the problem" \
-b "What were you doing and what did Flash do" \
--repro "1. flash init --postgresql 2. flash gen 3. ..." \
--expected "What should have happened" \
--actual "What happened, including the exact error"
# Feature request
flash issues -k feature -t "codegen: add X support" -b "Description"
# Preview without submitting
flash issues -k bug -t "..." -b "..." --print
# Submit without confirm prompt
flash issues -k bug -t "..." -b "..." --repro "..." -y| Flag | Description |
|---|---|
-k |
Kind: bug (default), feature, question, docs |
-t |
Title (required, must be descriptive) |
-b |
Body (required) |
--repro |
Reproduction steps (required for bugs) |
--expected |
Expected behavior |
--actual |
Actual behavior / error text |
--print |
Compose and print without submitting |
-y |
Skip confirmation prompt |
The command validates the report before filing — it rejects empty titles, vague bodies, and bug reports missing reproduction steps.
Configure multiple databases in one project:
[[databases]]
name = "main"
provider = "postgresql"
url_env = "DATABASE_URL"
schema_dir = "db/main/schema"
queries = "db/main/queries/"
migrations_path = "db/main/migrations"
default = true
[databases.gen.kotlin]
enabled = true
package = "com.example.main.flashgen"
[[databases]]
name = "analytics"
provider = "clickhouse"
url_env = "ANALYTICS_URL"
schema_dir = "db/analytics/schema"
queries = "db/analytics/queries/"
[databases.gen.go]
enabled = true
out = "gen/analytics"All commands support --db <name>: flash gen --db main, flash apply --db analytics, flash studio --db main
| Database | ORM Support | Studio |
|---|---|---|
| PostgreSQL | ✅ Full | ✅ SQL Studio |
| MySQL | ✅ Full | ✅ SQL Studio |
| SQLite | ✅ Full | ✅ SQL Studio |
| ScyllaDB / Cassandra | ✅ Full(not yet for Rust ) | ✅ SQL Studio |
| ClickHouse | ✅ Beta | ✅ SQL Studio |
| MongoDB | ❌ | ✅ Visual Management |
| Redis | ❌ | ✅ Visual Management |
FlashORM generates type-safe query code from your SQL files. Auto-detects project type on flash init.
[gen.go]
enabled = true
out = "flash_gen"
driver = "pgx" # or "database/sql" (default)[gen.js]
enabled = true
out = "flash_gen"
driver = "pg" # pg | postgres | mysql2 | better-sqlite3 | bun:sqlite[gen.python]
enabled = true
out = "flash_gen"
async = true
driver = "asyncpg" # asyncpg | psycopg3 | pymysql | aiosqlite | sqlite3[gen.kotlin]
enabled = true
out = "src/main/kotlin/com/example/db/flashgen"
package = "com.example.db.flashgen"
driver = "jdbc" # jdbc (default) | exposed | r2dbcGenerates: Models.kt, UsersQueries.kt, Queries.kt (unified entry point)
val q = Queries.newq(conn)
val user = q.getUser(42) // Users?
val posts = q.getPostsByUser(42) // List<GetPostsByUserRow>[gen.java]
enabled = true
out = "src/main/java/com/example/db/flashgen"
package = "com.example.db.flashgen"
driver = "jdbc" # jdbc (default) | jooq | hibernateGenerates: Users.java, UsersQueries.java, Queries.java (unified entry point)
var q = Queries.newq(conn);
Users user = q.getUser(42); // Users
List<GetPostsByUserRow> posts = q.getPostsByUser(42); // List<GetPostsByUserRow>[gen.rust]
enabled = true
out = "src/flash_gen"
driver = "sqlx" # sqlx (default)Generates: mod.rs, models.rs, db.rs, users.rs (per-query-file modules)
let queries = Queries::new(pool);
let user = queries.get_user(1).await?; // Users
let posts = queries.list_posts_by_user(1).await?; // Vec<GetPostsByUserRow>Features:
- Async by default using
sqlx #[derive(FromRow)]on all model structsquery_scalarfor single-column results,query_asfor structs- PostgreSQL, MySQL, SQLite support
- Proper
Option<T>for nullable columns
Generate typed classes for JSONB columns with auto-serialization. No manual JSON parsing needed.
-- name: GetUser :one
-- @json settings {"theme": "string", "language": "string", "font_size": "int"}
-- @json metadata {"level": "int", "badges": "string[]", "xp_points": "int"}
SELECT id, name, settings, metadata FROM users WHERE id = $1;-- name: GetUser :one
-- @json import user_settings.json as settings
SELECT id, name, settings FROM users WHERE id = $1;db/json/user_settings.json:
{
"theme": "string",
"language": "string",
"font_size": "int",
"notifications": "boolean"
}Config:
json_path = "db/json"string · int · float · boolean · string[] · int[] · float[] · boolean[] · any
All fields are nullable. Unmentioned JSON fields accessible via .raw / .get("key").
// Auto-generated:
data class Settings(
val theme: String?,
val language: String?,
val fontSize: Int?,
val raw: JsonObject? = null
) {
fun toJson(): String
fun get(key: String): String? // access any field not in the definition
companion object { fun fromJson(json: String?): Settings? }
}
// Usage — everything is typed:
val user = queries.getUser(id)
val theme = user?.settings?.theme // String?
val extra = user?.settings?.get("custom") // access unmentioned fieldsWorks with SELECT, INSERT, UPDATE, and RETURNING. All 6 languages supported.
version = "2"
schema_dir = "db/schema"
queries = "db/queries/"
migrations_path = "db/migrations"
json_path = "db/json" # optional: directory for @json import files
env_path = "config/.env" # optional: custom .env file path
[database]
provider = "postgresql"
url_env = "DATABASE_URL"
[gen.go]
enabled = trueflash studio
flash studio "postgres://user:pass@localhost:5432/mydb"
flash studio "scylla://localhost:9042/keyspace"
flash studio "clickhouse://localhost:9000"Features: Schema designer, data browser, relationship visualization, auto-migration creation
flash studio "mongodb://localhost:27017/mydb"
flash studio "mongodb+srv://user:pass@cluster.mongodb.net/mydb"flash studio "redis://localhost:6379"
flash studio "redis://:password@localhost:6379"flash seed # seed all tables
flash seed --count 100 # custom count
flash seed users:100 posts:500 comments:1000 # per-table counts
flash seed --truncate --force # truncate and reseedflash export # JSON (default)
flash export --csv # CSV files per table
flash export --sqlite # Portable SQLite fileflash apply --force # Production deployment
flash reset --force # Reset database (development)
flash pull # Extract schema from existing database
flash raw "SELECT COUNT(*) FROM users;"
flash raw db/seed.sql # Execute SQL file (supports comment blocks)- Go Usage Guide
- TypeScript Usage Guide
- Python Usage Guide
- Rust Usage Guide
- How It Works
- Architecture & Internals
- Release Notes
- Contributing
git clone https://github.com/Lumos-Labs-HQ/flash.git
cd flash
make dev-setup
make build-allMIT License - see LICENSE file for details.
Built with ❤️ by Lumos Labs
