Track the Storm 1.14.0 release - #1
Open
zantvoort wants to merge 3 commits into
Open
Conversation
A join now widens the query, so a clause that names a joined entity uses the plain call and the Any variants are gone. Where a query joins nothing but references another entity of its graph, widen() says so; scrollByGenre narrows back to the projection, because a scroll key has to identify one row of the root and a key on the junction table does not. SqlCapture.run is record, named so a Kotlin caller cannot resolve it to kotlin.run. @stormtest rolls each test back, so the tests no longer pick rows other methods leave alone. Resolves Storm from mavenLocal until 1.14.0 is on Maven Central and the Gradle Plugin Portal.
findGenres reaches the genre name through the junction table's foreign key rather than naming the genre table in short form, so the clause stays typed to the root and the query needs no widening. The SQL is unchanged. The remaining widen() calls stay: the two GROUP BY sites would resolve a foreign key path's id component to the junction column while the SELECT still projects the referenced table's key, which strict grouping rejects, and findTopMovies joins conditionally, so its builder is widened either way.
A grouping states what one row stands for, and 1.14 emits the columns that express it, so these queries name the entity and stop enumerating its columns. The lists were there to satisfy the strictest dialect and had to be revisited whenever an entity gained a field; the dialect decides now. findMoviesSharingCast and findMostProlificActors reach the entity through the credit's own foreign keys, so they no longer widen either: the path starts at the query root and keeps the compile-time root check. The SQL is equivalent, and narrower where a key already determined the columns that were being listed.
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.
Migrates the demo to Storm 1.14.0 and adopts the query API as 1.14 defines it.
Important
Do not merge until 1.14.0 is on Maven Central and the Gradle Plugin Portal. This branch resolves Storm from
mavenLocal(), through arepositoriesentry and apluginManagementblock insettings.gradle.kts, both markedTEMPORARY. Merging before the release would leave the template unbuildable for anyone who clones it. Drop those two blocks as part of the merge.Query API
A join widens the query, so from the join onward every clause accepts paths from any entity in the query and the
Anyvariants are gone. Most call sites are a plain rename:Grouping states an identity
A grouping says what one row stands for, and the generator emits the columns that express it — the key on PostgreSQL, every selected column on SQL Server and Oracle. So the queries name the entity and stop enumerating its columns:
The column lists these replace existed to satisfy the strictest dialect, and had to be revisited whenever an entity gained a field.
MovieRepositorykeeps its template grouping: one row per decade is a computed value, not an identity, so it stays literal.Paths from the query root
findGenresorders byMovieGenre_.genre.name, reaching the genre through the junction table's foreign key. A nested path starts at the root, so it needs no widening and keeps the compile-time root check that widening gives up.scrollByGenrejoins the junction table and then narrows back to the projection: a scroll key has to identify one row of the root, and a unique key on the junction table does not.One
widen()remains, infindTopMovies. It is structural rather than a leftover: the conditionalinnerJoinwidens the root, so the single reassignable builder variable has to be declaredQueryBuilder<Data, Rating, Movie>, and the unjoined initial value only fits that declaration after widening. Removing it fails compilation.Tests
SqlCapture.runisrecord.@StormTestnow runs each test in a transaction that is rolled back afterwards, so the tests no longer need to pick rows that other methods leave alone, and the comments saying they did are gone.Full
./gradlew buildgreen, tests included.