Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2025-08-03 | 2.3 kB | |
v0.9.103_ Super new feature source code.tar.gz | 2025-08-03 | 2.2 MB | |
v0.9.103_ Super new feature source code.zip | 2025-08-03 | 3.7 MB | |
Totals: 3 Items | 5.9 MB | 0 |
Base-query preview, a massive new feature
Base-query is a collective term for Derived Table, CTE, and Recursive CTE in SQL.
Jimmer not only enables the functionality of Derived Table, CTE, and Recursive CTE in a strongly-typed manner but also introduces a feature absent in native SQL—a design philosophy that native SQL lacks.
In SQL, developers must first decide which columns to query in the base-query and then let the outer query select a subset of those columns.
In Jimmer, developers can make the base-query return table objects rather than expressions. The shape of these table objects is unknown. Finally, when the outer query applies a GraphQL-style data structure likeFetcher/OutputDTO
to define the query shape, the outer query inversely determines which columns the inner base-query needs to fetch. This feature is called "reverse propagation of projection."
Reverse propagation of projection is the soul of Jimmer's base-query, representing the majority of the internal complexity of this feature and offering a design philosophy that native SQL simply cannot provide.
This new feature will inevitably require significant updates to the documentation. Until the documentation is fully updated, please refer to the following unit tests to understand this new functionality:
- Java
- Derived Table: https://github.com/babyfish-ct/jimmer/blob/main/project/jimmer-sql/src/test/java/org/babyfish/jimmer/sql/tuple/BaseQueryTest.java
- CTE: https://github.com/babyfish-ct/jimmer/blob/main/project/jimmer-sql/src/test/java/org/babyfish/jimmer/sql/tuple/CteBaseQueryTest.java
-
Kotlin
- Derived Table: https://github.com/babyfish-ct/jimmer/blob/main/project/jimmer-sql-kotlin/src/test/kotlin/org/babyfish/jimmer/sql/kt/query/BaseQueryTest.kt
- CTE: https://github.com/babyfish-ct/jimmer/blob/main/project/jimmer-sql-kotlin/src/test/kotlin/org/babyfish/jimmer/sql/kt/query/CteBaseQueryTest.kt
- Recursive CTE: https://github.com/babyfish-ct/jimmer/blob/main/project/jimmer-sql-kotlin/src/test/kotlin/org/babyfish/jimmer/sql/kt/query/RecursiveBaseQueryTest.kt