-
Notifications
You must be signed in to change notification settings - Fork 513
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
Basic suggested migration #2385
Basic suggested migration #2385
Conversation
HELL YEA will give this a thorough review shortly |
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.
Leaving to Alec to review the rest
My only concern is that someone may not see the subtle refactor icon
...tlin/com/squareup/sqldelight/intellij/refactoring/SqlDelightSuggestedRefactoringExecution.kt
Outdated
Show resolved
Hide resolved
d5bcc3a
to
dd1fbd5
Compare
3f48440
to
95016c7
Compare
shortly has come I'm working on this branch now, I've rebased it and got it running and working so I can step through stuff and provide better feedback I think the |
yea this all looks really constrained to the signatureRange APIs, I suspect we will want our entryway to be more like the inspections you've made, though I like the UI this prompts you with so I wonder if we can keep that somehow 🤔 |
95016c7
to
fd78e14
Compare
Also the file view provider needs to stay, or we have to change the file service. The file view provider was holding state about what that provider generated last time it ran so that we correctly delete files when the filename changes, but with the service it deletes all files except the currently edited one. I assume if we switch to use an Intention it will work fine with the provider again |
(cherry picked from commit dd1fbd5)
fd78e14
to
4702fd8
Compare
Okay gave it a shot with the inspection APIs, I left the refactoring executor and signature builders that you wrote since those still worked well, and just used the inspection instead of the signature refactor entry point. sqldelightMigrations.mov |
dd01eff
to
b4e5b13
Compare
b4e5b13
to
db3f0bc
Compare
import com.alecstrong.sql.psi.core.DialectPreset.SQLITE_3_24 | ||
import com.alecstrong.sql.psi.core.DialectPreset.SQLITE_3_25 | ||
|
||
interface SqlGeneratorStrategy { |
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.
big fan of this API btw, nice
yo that's much better than my version |
.joinToString(", ") | ||
|
||
return """ | ||
|BEGIN TRANSACTION; |
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.
Is this something that changes with sqldelight 2.x? I was under the impression that at least for iOS and Android in 1.x world, you don't need transactions. There's also some documentation about it: https://cashapp.github.io/sqldelight/jvm_sqlite/migrations/
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.
yea true theres no need for it
Is there anything I need to do specifically? I'm using 2.0.0-alpha02 both runtime and the plugin but when adding a new column to a table I don't get the feature. |
do you have a |
Can you try the snapshot version of the IDE? This change may have fixed it |
Indeed |
Screen.Recording.2021-05-10.at.15.32.19.mov
This only supports basic stuff from alter-table-stmt in sqlite like table rename and column add/delete/rename. The ui is not really customizable in the sdk. I had to delete FileViewProvider for query files because the indicator gets reset when another file changes. And I would really like your suggestions on how to generate migration scripts better.