Skip to content

Conversation

TRobboJ
Copy link

@TRobboJ TRobboJ commented Jul 2, 2025

Hi there,

Just adding any database comments to the TypeScript interface to help with typehints.

Screenshot 2025-07-02 at 6 34 53 pm

Screenshot 2025-07-02 at 6 35 04 pm

@@ -81,6 +81,12 @@ export const AUTHORS_TABLE_CREATES = [
full_name VARCHAR(80) not null
);
`,
`EXEC sp_addextendedproperty
Copy link
Author

Choose a reason for hiding this comment

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

I've updated all the tests to add their version of a comment and they all pass when I run them.

Copy link
Author

Choose a reason for hiding this comment

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

Exception is sqllite as it doesn't support comments

)))
ts.factory.createTypeReferenceNode(dialect.mapDbTypeToJs(c.type) ?? 'any', undefined)
)
return c.comment ? ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLineCommentTrivia, `* ${c.comment}`, true) : property
Copy link
Author

Choose a reason for hiding this comment

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

Main change here to add the comments using addSyntheticLeadingComment

@jonthia
Copy link

jonthia commented Jul 2, 2025

This is amazing we've been wanting this exact feature!! +1 to get this merged in.

@noobfromvn99
Copy link

This would help a lot! Thank you for updating this. +1 vote in

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