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

Fix escaping table names and fields #506

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

domdomegg
Copy link
Contributor

@domdomegg domdomegg commented Dec 7, 2023

Fixes #505

@domdomegg
Copy link
Contributor Author

I think this is all working in kanel now. I'm looking at getting kanel-kysely working too then will make reviewable.

@domdomegg domdomegg marked this pull request as ready for review December 7, 2023 21:54
@domdomegg
Copy link
Contributor Author

I think that should do it. I've tested with the horrific example in #505 and it passes perfectly with both kanel and kanel-kysely. All the tests pass (although will flag that I don't think kanel-kysely or kanel-zod currently have a test setup).

@domdomegg
Copy link
Contributor Author

Requesting review from @kristiandupont

typeDefinition: string[];
exportAs: "named" | "default";
};

export type InterfacePropertyDeclaration = {
export type InterfacePropertyDeclaration = DeclarationBase & {
Copy link
Owner

Choose a reason for hiding this comment

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

The reason I didn't do this is that you can't add a prop declaration directly to a file. But it's a semantic difference, this is fine.

@@ -0,0 +1,5 @@
/** Used for comment text. */
const escapeComment = (name: string): string =>
Copy link
Owner

Choose a reason for hiding this comment

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

Nice! I had thought of this but not needed it thus far :-)

@kristiandupont
Copy link
Owner

Wow, you put a lot of work into this and managed to stay true to my weird conventions and patterns, that's impressive! Thank you!

@kristiandupont kristiandupont merged commit cd20da2 into kristiandupont:main Dec 8, 2023
1 check passed
@kristiandupont
Copy link
Owner

Both packages are published

@domdomegg
Copy link
Contributor Author

Thank you for reviewing, approving, merging and releasing so fast! This is a huge help :)

Have a brilliant weekend.

@domdomegg domdomegg deleted the fix-505 branch December 8, 2023 21:37
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.

bug: Tables with special characters or spaces in their names don't generate valid TypeScript
2 participants