Skeema Logo
Skeema
Sign inGet started →
Analysis & intelligence

Code generation

Skeema turns the parts of your design that are mechanical — database schemas and API scaffolds — into code that stays in sync with the diagram. Schema codegen is deterministic and free; API routes are derived from real flows.

Schema code (from ER boards)

Open the codegen drawer on any ER board to emit the schema in four targets. This is pure template code — no AI call, no cost, identical every time — so it’s safe to regenerate whenever the schema changes.

  • Prisma — models with camelCase fields, @map for snake_case columns, enums, and inverse relations.
  • PostgreSQLCREATE TABLE with pgcrypto UUIDs, FK indexes, and ENUM types.
  • MySQL — InnoDB engine, inline ENUMs, utf8mb4.
  • Mongoose — TypeScript interfaces plus schemas with ObjectId refs.
Round-trip
Codegen pairs with schema import: paste a Prisma or SQL schema to build an ER diagram, edit visually, then generate clean code back out. The diagram and the code never drift.

API routes (from service nodes)

Derive API route scaffolds from a service node. Skeema picks the language and framework from the node’s declared tech stack and reads the project’s flows to shape the endpoints:

  • Language detected from tech — TypeScript, Python, Go, Java, Ruby, C#, Rust, or PHP.
  • Framework chosen to match — Express/Fastify/Nest, FastAPI, Gin, Spring, Rails, ASP.NET, Axum, Laravel.
  • Endpoints derived from real flow messages, not generic CRUD — and async-first when the service is connected to a stream.

Why deterministic matters

For schemas, determinism is a feature: the same diagram always produces the same code, so codegen is a reliable build step rather than a roll of the dice. AI is reserved for the genuinely ambiguous parts (route shaping from intent), where its judgment adds value.

Key takeaways
  • Schema codegen (Prisma/PostgreSQL/MySQL/Mongoose) is deterministic, free, and always in sync.
  • API routes are language-aware and derived from real flows, not generic CRUD.
  • Round-trip: import schema → edit visually → generate clean code back out.