[drizzle-kit] Add support for table and column comments#4446
Open
xcfox wants to merge 8 commits into
Open
Conversation
|
This is amazing! it would be amazing to ping the drizzle team to get this one merged! |
|
my project need this feature 🔥 |
|
Agreed, this would be very nice for our customers to better understand the table structure - since the data we are inserting originates in a different language - so it would be good to comment where the column originates from |
|
There is not enough such a chip for a more beautiful description of the base, I would like to get this improvement soon! |
|
very useful feature, hope you release it soon. |
|
+1 |
1 similar comment
|
+1 |
|
Added a new discussion to push this feature |
|
+1 |
Author
|
I see that the new engine has been completed, and I think I should re-implement this requirement on the new engine. |
Author
|
Finally, I have reimplemented this feature on the new engine. |
…ostgres, sqlite, singlestore
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.





This PR implements the support for table and column comments as discussed here, here and here.
COMMENT='...'/COMMENT '...'COMMENT ON TABLE/COLUMNCOMMENT ON TABLE/COLUMNsp_addextendedpropertySQL Examples
MySQL:
PostgreSQL:
MSSQL:
SQLite
SQLite has no native
COMMENTsyntax and no kit-level support (comment metadata is stored in Drizzle ORM schema only, not in DDL snapshots or SQL migrations). The.comment()andcomment()APIs work in ORM schema definitions and can be used by downstream tools (drizzle-zod,drizzle-valibot,drizzle-graphql) for documentation generation, butdrizzle-kitwill not generate, diff, or introspect SQLite comments.Next Steps
drizzle-zod/drizzle-valibot/drizzle-graphqlfor schema descriptions