-
Notifications
You must be signed in to change notification settings - Fork 279
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: disallow AlterColumn method chaining #468
fix: disallow AlterColumn method chaining #468
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey 👋 Thank you! ❤️ I understand what you were going for with this and it does seem convenient, but it is not aligned with Kysely's WYSIWYG design principle. Not sure about these changes. We should consider either:
I'm leaning towards 1. @koskimas WDYT? |
Can you explain this? does it require an issue? |
@igalklebanov that's rather new to me that Kysely pushes WYSIWYG to such extent.
No. I was just saying, that you can call |
Oh, gotcha. The API is dialect agnostic by design. |
@igalklebanov Yes, I agree. This is the way to proceed. |
@koskimas @igalklebanov |
6bd80a7
to
aaddf04
Compare
aaddf04
to
9943bd5
Compare
9943bd5
to
cccc7a4
Compare
I updated the PR. Above you can see intelisense suggestion (type compilation result). |
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.
Looks good! 💪
Left a few minor suggestions..
@igalklebanov thanks for the suggestions. I've implemented them all in one commit. |
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! 🚀
13b4ca4
to
1235cc2
Compare
* fix: disallow chaining AlterColumnBuilder operations (kysely-org#467) * chore: limit AlterColumnNode.create available params, change AlterColumnBuilder fields names
Fixes: #467
It was slightly tricky, but I decided that "unwinding" looks the best in terms of clarity of what is happening.
This effectively produces query:
as in Postgres docs. MySQL has exact syntax for chaining ALTER COLUMN, but supports only
drop default
andset default
operations, so probably nobody will chain those two together, plus alter column usage for MySQL is not properly handled in whole Kysely anyway. I tested MySQL case manually.EDIT: now it just disallows chaining