Add column helper#541
Closed
hfhbd wants to merge 4 commits into
Closed
Conversation
AlecKazakova
reviewed
Aug 4, 2023
| } | ||
| } | ||
|
|
||
| fun SqlColumnName.getColumnDefOrNull(): SqlColumnDef? { |
Collaborator
There was a problem hiding this comment.
I think it's a little more nuanced then this, since columns can come from an alter table statement
Collaborator
There was a problem hiding this comment.
I'm also pretty sure this is already done elsewhere in code quite a bit (going from column name to column def)
Collaborator
Author
There was a problem hiding this comment.
Thanks, you are right. Also added a test for alter table.
hfhbd
force-pushed
the
hfhbd/columnHelper
branch
from
August 4, 2023 11:28
f6a9b76 to
aea3f16
Compare
hfhbd
commented
Aug 4, 2023
| } | ||
| } | ||
|
|
||
| fun SqlColumnDef.isForeignKey(): Boolean { |
Collaborator
Author
There was a problem hiding this comment.
After thinking again, this won't work in sqldelight with the mysql dialect supporting ALTER TABLE DROP FOREIGN KEY because this isn't a SqlColumnDef... I guess the only option is to put the keys into the schema too 🤔
|
@hfhbd Why was this PR closed? I still cannot drop foreign keys :-/ |
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.
Related to lysine-dev/sqldelight#4489