Primary key icon#108
Merged
Merged
Conversation
503787c to
ad72ff5
Compare
- Updated the parser to mark `id` fields as primary keys (`PK: true`) when no explicit primary key is defined in `schema.rb`. - Updated the `convertToDBStructure` function to correctly handle primary key attributes. - Adjusted test snapshots and test cases to reflect the inclusion of primary key information. - Added a new `PrimaryKeyIcon` component to visually indicate primary keys in the ERD renderer. - Integrated the `PrimaryKeyIcon` into the `TableNode` component in the ERD renderer. - Included `PrimaryKeyIcon` in the icon library and Storybook for documentation and testing.
ad72ff5 to
6eda17d
Compare
The setup process might take some time for now.
hoshinotsuyoshi
commented
Nov 29, 2024
Comment on lines
-2321
to
+2322
| type: { type_name: "varchar" } | ||
| type: { type_name: "varchar" }, | ||
| PK: true, |
Member
Author
There was a problem hiding this comment.
NOTE: src/parser/postgres have already primary-key handling logic.
MH4GF
suggested changes
Nov 29, 2024
MH4GF
left a comment
Contributor
There was a problem hiding this comment.
If you have any questions, please call me at huddle!
Contributor
There was a problem hiding this comment.
Copying the code is hard, so I would like you to add a package and use that! example:
import { PrimaryKeyIcon } from 'lucide-react'
Member
Author
There was a problem hiding this comment.
Contributor
There was a problem hiding this comment.
@hoshinotsuyoshi Thanks for adjusting!
I don't see much reason to wrap the component, and I was wondering if I could export directly here?
example:
export { KeyRound } from 'lucide-react'`
Member
Author
There was a problem hiding this comment.
I honestly don't mind either way! I'll make the adjustments.
Base automatically changed from
Switch-from-using-pgsql-parser-to-pg-query-emscripten
to
main
November 29, 2024 08:07
2 tasks
Member
Author
|
Merging this to fix the flaky test. #94 (comment) |
Merged
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.
pgsql-parsertopg-query-emscripten#110Summary
Added Primary key icon
Related Issue
N/A
Changes
idfields as primary keys (PK: true) when no explicit primary key is defined inschema.rb.convertToDBStructurefunction to correctly handle primary key attributes.PrimaryKeyIconcomponent to visually indicate primary keys in the ERD renderer.PrimaryKeyIconinto theTableNodecomponent in the ERD renderer.PrimaryKeyIconin the icon library and Storybook for documentation and testing.Testing
Run:
However, there might be some development cache issues.
For my part, I tested it with:
But as a reviewer, you don't need to go that far. 👌
Other Information
N/A