dave08
10/15/2023, 4:19 PMdave08
10/15/2023, 4:21 PMdave08
10/15/2023, 4:34 PMdave08
10/16/2023, 11:40 AMval declaration = classDeclaration.getDeclaredProperties().firstOrNull { it.simpleName == parameter.name }
@Toshihiro Nakamura ... do I need that apart from my custom type for ClobString to work with like?Toshihiro Nakamura
10/16/2023, 11:06 PMdave08
10/29/2023, 12:48 PMio.r2dbc.spi.R2dbcBadGrammarException
it would have been great to have been great if Komapper could try catching such errors and include some info like the sql that was run, etc...dave08
11/06/2023, 12:16 PMdave08
11/07/2023, 2:59 PM• ON DUPLICATE KEY UPDATE is supported in INSERT statements, due to this feature VALUES has special non-standard meaning is some contexts.
• INSERT IGNORE is partially supported and may be used to skip rows with duplicate keys if ON DUPLICATE KEY UPDATE is not specified.whereas komapper seems to use
merge into using
that cause funny errors that the table EXCLUDED doesn't exist... maybe there should be H2Dialect(mode: H2CompatibilityMode)
...?dave08
11/21/2023, 11:55 AMCan't create more than max_prepared_stmt_count statements...
after migrating to Komapper from Jasync? (It could be that it's not Komapper... I'm just double checking, or maybe someone might know another reason for it?)Toshihiro Nakamura
11/23/2023, 1:12 AMS.
11/25/2023, 8:06 PMdave08
11/28/2023, 12:09 PMdave08
11/30/2023, 10:26 AMinline fun <reified T : Any> groupConcat(vararg columns: ColumnExpression<T, String>) : ColumnExpression<T, String> {
val operands = columns.map { Operand.Column(it) }
return columnExpression(T::class, String::class, { this as T }, "group_concat", operands.toList()) {
append("GROUP_CONCAT(")
operands.dropLast(1).forEach { visit(it); append(", ") }
visit(operands.last())
append(")")
}
}
S.
12/07/2023, 11:06 PMWHERE (a.name, a.uuid) > (prev.name, prev.uuid) ORDER BY a.name, a.uuid
dave08
12/10/2023, 12:40 PMFROM_UNIXTIME(?)
for mysql (to be used in a where statement: a.field1 > FROM_UNIXTIME(?)
)?dave08
12/10/2023, 12:54 PMinnerJoin(Meta.baz) { Meta.foo.id eq Meta.tagging.recordId ;Meta.tagging.type eq "Foo" }
but recordId
is an Int
... can I somehow still do this w/o giving up on using those value classes? Something like Meta.tagging.recordId.map { FooId(it) }
?Toshihiro Nakamura
12/30/2023, 4:27 AMstefano
01/09/2024, 3:38 PMMeta
object, and subsequent code is highlighted with errors, making it quite hard to work as the autocomplete goes kaboom. Any idea what the problem could be?stefano
01/09/2024, 7:30 PMcase
in a select over which komapper blows up with
java.lang.UnsupportedOperationException: null
at org.komapper.core.dsl.expression.LiteralExpression.getColumnName(LiteralExpression.kt:14) ~[komapper-core-1.16.0.jar:na]
because I'm returning more than 3 columns in the query so it's switching to a Record
return type instead of a tuple. How can I set an as <name>
alias to an expression in a select? Or is there a more idiomatic solution?stefano
01/10/2024, 10:28 AM<aggregateFn>If(column, filter)
, e.g. sumIf(revenue, period = 'current')
. I don't know how to model the filter part in a custom column expression, I'd have structured it as a WhereDeclaration
but it doesn't seem to be used as an argument to construct an Operand
for the custom column expression. Any ideas how I can do this?stefano
01/10/2024, 10:53 AMWITH <table name> (<column list>)
), but ClickHouse doesn't support the column list. Is there a way to modify this behavior, either through the dialect definition or otherwise, so that the resulting query omits the list of column names?dave08
01/11/2024, 10:23 AM@KomapperProjection
a @KomapperEntity
? It's a bit confusing, since it's not really in the database... and sometimes might not have any relationship to something in the database... (is there a Meta entry generated for it? What would be it's use?). Also it seems like it needs a @KomapperId
even though a projection might not always have one... And it doesn't seem to take into consideration nullable fields with default values... (you have to provide it, and it can't be null
...)
Also, can a projection be used to map the result from many joined tables?dave08
01/11/2024, 3:01 PMstefano
01/17/2024, 7:47 PMIt is recommended that SCHEMA queries are used only for development purposes. For example, it is suitable for the following use cases:
• Create a sample application
• Get a base DDL statements in the early phases of the development project
DDL statements for production environments should be managed separately.What would you recommend for managing the schema and schema migrations? I was going to default to Flyway but I'm curious if there's anything else you'd use
Toshihiro Nakamura
01/20/2024, 2:15 AMdave08
03/03/2024, 1:52 PMdave08
03/03/2024, 1:58 PM@KomapperEmbedded
properties?dave08
03/03/2024, 4:38 PMselect 1 from...
as a column (with a Boolean value), I tried defining:
private fun literalOne(): ScalarExpression<Boolean, Int> {
val name = "literalOne"
return columnExpression(Boolean::class, Int::class, { it > 0 }, name, listOf()) {
append("1")
} as ScalarExpression<Boolean, Int>
}
but it seems like a ScalarExpression
can't be defined... so I can't use a subquery with select(literalOne())
like this as a column value... is there any way to work around this?dave08
03/04/2024, 1:23 PMToshihiro Nakamura
03/08/2024, 3:46 PM