Skip to content

Import Prisma and Drizzle schemas, and add isketch import - #88

Merged
raj-khan merged 1 commit into
mainfrom
fl-85-schemas
Sep 27, 2026
Merged

raj-khan merged 1 commit into
mainfrom
fl-85-schemas

Conversation

@raj-khan

Copy link
Copy Markdown
Owner

FL-85.

  • Prisma (src/domain/prisma.js): models and views become tables listing their fields, @id/@@id marked PK; a relation with fields: [...] is an edge from the holder to the target, labelled with the key, which is marked FK; lists on both sides with no key are one two-way many-to-many edge; back relations add nothing; unknown field types are warned by line.
  • Drizzle (src/domain/drizzle.js): pgTable, mysqlTable, sqliteTable (also on a schema) become tables named as in the database; .primaryKey() and primaryKey({ columns }) mark keys; .references(), foreignKey() and one(..., { fields }) in relations() become edges; references to missing tables are warned.
  • Both share SQL's column description and carry an origin, so a re-import updates the diagram in place. Both are in the Import dialog.
  • isketch import <file> [--from <format>] [-o out.flow]: any import format, detected from the name and, for YAML and JSON, the content (detectFormat, reusable by isketch scan). Skipped items print as file:line: message.

Tests: prisma (5), drizzle (4), detectFormat (3), CLI import (3), e2e schemas (2). e2e 140, vitest 294, lint and typecheck.

Models and tables become entity diagrams with keys and relations. The
CLI imports any format, told from the file name and content.
@raj-khan
raj-khan merged commit 48e09ac into main Sep 27, 2026
4 checks passed
@raj-khan
raj-khan deleted the fl-85-schemas branch September 27, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant