-
Notifications
You must be signed in to change notification settings - Fork 1
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
Primary key icon #108
Primary key icon #108
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.
type: { type_name: "varchar" } | ||
type: { type_name: "varchar" }, | ||
PK: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: src/parser/postgres have already primary-key handling logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM👍
Please note that pegjs will be replaced to prism.
In prism parser, primary_key is supported so it will be easy to switch.
see: #114.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have any questions, please call me at huddle!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying the code is hard, so I would like you to add a package and use that! example:
import { PrimaryKeyIcon } from 'lucide-react'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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'`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't mind either way! I'll make the adjustments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 commit pushed : b6f81fe
Merging this to fix the flaky test. #94 (comment) |
pgsql-parser
topg-query-emscripten
#110Summary
Added Primary key icon
Related Issue
N/A
Changes
id
fields as primary keys (PK: true
) when no explicit primary key is defined inschema.rb
.convertToDBStructure
function to correctly handle primary key attributes.PrimaryKeyIcon
component to visually indicate primary keys in the ERD renderer.PrimaryKeyIcon
into theTableNode
component in the ERD renderer.PrimaryKeyIcon
in 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