Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add initial tbls parser #577

Merged
merged 5 commits into from
Jan 27, 2025
Merged

✨ Add initial tbls parser #577

merged 5 commits into from
Jan 27, 2025

Conversation

sasamuku
Copy link
Member

@sasamuku sasamuku commented Jan 27, 2025

Summary

  • Add initial tbls parser
  • Add format for schema.json

ERD Web:

image

https://liam-erd-b9jxja3n1-route-06-core.vercel.app/erd/p/github.com/k1LoW/tbls/blob/v1.81.0/sample/mysql/schema.json

CLI:

image
$ ./dist-cli/bin/cli.js erd build --input https://github.com/k1LoW/tbls/blob/v1.81.0/sample/mysql/schema.json --format tbls

Related Issue

Changes

Testing

Other Information

Copy link

changeset-bot bot commented Jan 27, 2025

🦋 Changeset detected

Latest commit: a580fb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@liam-hq/db-structure Patch
@liam-hq/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -7,6 +7,7 @@ const nameToFormatMap: Record<string, SupportedFormat> = {
'schema.rb': 'schemarb',
schemafile: 'schemarb',
'prisma.schema': 'prisma',
'schema.json': 'tbls',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 schema.json is a general name.
I think it's alright to handle it when namespace conflicts in Liam.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is troubling, but I think this is not a problem because it is just inference logic.

Copy link
Member

@MH4GF MH4GF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

frontend/packages/db-structure/src/parser/tbls/parser.ts Outdated Show resolved Hide resolved
Comment on lines +2 to +3
"@liam-hq/db-structure": patch
"@liam-hq/cli": patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since last Friday, we've been shipping new features as minor instead of patch. https://github.com/liam-hq/liam/releases/tag/%40liam-hq%2Fcli%400.2.0

For this PR, would minor be appropriate? Or should we consider this an initial implementation? @MH4GF @sasamuku

Suggested change
"@liam-hq/db-structure": patch
"@liam-hq/cli": patch
"@liam-hq/db-structure": minor
"@liam-hq/cli": minor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hoshinotsuyoshi Thanks!
I thought that patch was still good enough for now.
The intent is available to the user but unstable and treated as experimental.

I would like to make it minor at a time when we have completed some implementation!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent is available to the user but unstable and treated as experimental.

That makes sense! Thanks for the clarification. @MH4GF

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I understood 👍

Copy link
Member

@hoshinotsuyoshi hoshinotsuyoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sasamuku sasamuku added this pull request to the merge queue Jan 27, 2025
Merged via the queue into main with commit a30a3d0 Jan 27, 2025
13 checks passed
@sasamuku sasamuku deleted the add_tbls_parser branch January 27, 2025 08:44
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.

3 participants