Overview
IlanaORM generates TypeScript types directly from your model files and migration definitions — no build step, no schema file, no manual maintenance. Each model gets:- A typed
Attributesinterface with the correct type per column (including enum union types) - A
declare classwith relation method signatures - A barrel
index.d.tsfor clean imports
Generating Types
types/ directory by default:
Custom output directory
Auto-generation on migrate
Types are regenerated automatically every time you run a migration:Example Output
Given this model and migration:Using the Generated Types
What Gets Inferred
Notes
- Types are only generated for TypeScript projects (detected by the presence of
tsconfig.json) - The
types/directory should be added to.gitignore— regenerate it from migrations instead - Do not edit generated files — they will be overwritten on the next
migrateortypesrun - For custom cast classes, the column falls back to
any— add a manual override if needed
