Repository navigation
feat(export): DBML and PDF export of the diagram (#1285) - #1297
Merged
Merged
Conversation
- DBML: tables with pk / increment / not null / unique / default / note, composite keys in an indexes block, enums, refs (- for one-to-one, > otherwise), table groups, sticky notes and header colours; to a file or the clipboard. - PDF: the diagram as the SVG shows it, fitted on one A4 or A3 page (landscape for a wide diagram) as a ~200 dpi image; written by hand, no new dependency.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1285
Last issue of the ERD epic #1286.
DBML (Export → DBML (.dbml), Copy DBML)
Table "t" [headercolor: #…, note: '…']with columnspk,increment,not null,unique,default,note; a composite primary key goes in anindexes { (a, b) [pk] }block."timestamp with time zone"); defaults map to number / boolean /'string'(a::castdropped) /`expression`.Enumfor enum columns (PostgreSQL labels, MySQLenum(...)).Ref:with-for a one-to-one foreign key and>otherwise; schema tables as"schema"."table".TableGroupfor the user's groups, sticky notes asNote. Only the tables the diagram shows.PDF (Export → PDF (A4) / PDF (A3))
lib/core/export/image_pdf.dart): catalog, page, one Flate image, content stream, xref. No new dependency.Tests:
test/core/erd/erd_dbml_test.dart(golden text of a sample schema and edge cases),test/core/export/image_pdf_test.dart(page plan, xref offsets), and a menu test that saves a DBML and a PDF.