Skip to content

Commit

Permalink
Oracle: Patch generating "null" when no relation rows
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinRay97 committed Sep 25, 2024
1 parent 441f6b0 commit ef3dd9d
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,15 @@ object JsonQueryGenerator : BaseQueryGenerator() {

DSL.jsonEntry(
alias,
DSL.select(
subQuery.asField<Any>(alias)
DSL.coalesce(
DSL.select(
subQuery.asField<Any>(alias)
), DSL.jsonObject(
DSL.jsonEntry(
"rows",
DSL.jsonArray().returning(SQLDataType.CLOB)
)
).returning(SQLDataType.CLOB)
)
)
}
Expand Down Expand Up @@ -286,7 +293,7 @@ object JsonQueryGenerator : BaseQueryGenerator() {
)

private fun getTableName(collection: String): String {
return collection.split('.').last()
return collection.split('.').last()
}

}

0 comments on commit ef3dd9d

Please sign in to comment.