Andromadus Naruto
06/07/2022, 5:00 PMMichal Patejko
07/08/2022, 8:03 AMToshihiro Nakamura
07/26/2022, 1:09 PMToshihiro Nakamura
08/10/2022, 1:06 AMdata class Money(val amount: BigDecimal, val currency: String)
@KomapperEntity
data Employee(@KomapperId val id: Int, @KomapperEmbedded val: salary: Money)
Please try it out!S.
08/16/2022, 9:04 PMQueryDsl.from(decks).where(declaration).orderBy(decks.id.asc()).limit(pageSize)
.leftJoin(deckWords) { decks.id eq deckWords.deck }
.leftJoin(deckTags) { decks.id eq deckTags.deck }
.include(decks, deckWords, deckTags)
the issue here is that it also limits joined tables. is it possible to add subqueries with the dsl to circumvent this?Toshihiro Nakamura
09/17/2022, 2:29 AMToshihiro Nakamura
10/10/2022, 9:51 AMS.
11/03/2022, 10:14 PMio.r2dbc.postgresql.ExceptionFactory$PostgresqlNonTransientResourceException: [53300] sorry, too many clients already]
Michal Patejko
11/29/2022, 11:30 AMdave08
11/30/2022, 12:18 PMdave08
12/06/2022, 10:49 AM@KomapperUpdatedAt
but it's recorded as an Int (unix time stamp), can komapper handle that? Maybe kotlinx.datetime's Instant?dave08
12/06/2022, 2:54 PM@KomapperAutoIncrement
is set to a value, insert
ignores it and generates a value --- which on one hand avoids using a nullable id field... but might be confusing to some.dave08
12/06/2022, 3:04 PMdave08
12/07/2022, 10:27 AMsingle()
being called on the Query, whereas toList()
is called on the flowQuery... also the presence of the lamba form of runQuery and flowQuery is a bit puzzling... it even only has an empty receiver object...dave08
12/08/2022, 12:13 PMset { }
shouldn't it be o.fieldName setTo "one"
instead of eq
? Since eq
is already used for when { }
... in Kotlin, there's also a difference between =
and ==
...dave08
12/08/2022, 12:13 PMset
dave08
12/08/2022, 12:20 PMdave08
12/08/2022, 12:21 PMandThen()
, but would that translate to a RETURN
in postgres, or make a seperate request?dave08
12/08/2022, 12:43 PMandThen
only run the next query if the first one succeeds? Would there be a place for an onError(query)
extension to Query?Toshihiro Nakamura
12/10/2022, 9:14 AMdave08
12/11/2022, 10:39 AMdave08
12/11/2022, 11:45 AM/**
* Builds a query that returns the single element.
* When the query is executed, it throws [NoSuchElementException] for empty query result and [IllegalStateException]
* for query result that contains more than one element.
*
* @param T the element type of [List]
* @return the query
*/
fun <T> ListQuery<T>.single(): Query<T> = collect { it.single() }
It's an java.lang.IllegalArgumentException: Flow has more than one element
not IllegalStateException
dave08
12/11/2022, 11:46 AM/**
* The terminal operator that awaits for one and only one value to be emitted.
* Throws [NoSuchElementException] for empty flow and [IllegalStateException] for flow
* that contains more than one element.
*/
public suspend fun <T> Flow<T>.single(): T {
var result: Any? = NULL
collect { value ->
require(result === NULL) { "Flow has more than one element" }
result = value
}
dave08
12/11/2022, 11:47 AMdave08
12/11/2022, 11:47 AMrequire
throws an IllegalArgumentException
dave08
12/12/2022, 10:13 AMKomapperColumnOverride
for embedded fields? Or can I just annotate the embedded class with a regular KomapperColumn
?dave08
12/12/2022, 2:50 PMdave08
12/12/2022, 2:50 PMdave08
12/13/2022, 2:58 PMdave08
12/13/2022, 2:59 PM@KomapperId
and composite primary indexes @KomapperEmbeddedId
...