Skip to main content

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 Attributes interface with the correct type per column (including enum union types)
  • A declare class with relation method signatures
  • A barrel index.d.ts for clean imports

Generating Types

Types are written to a 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:
IlanaORM generates:

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 migrate or types run
  • For custom cast classes, the column falls back to any — add a manual override if needed