Oliver Eisenbarth
06/19/2021, 6:21 PMmaxmello
06/22/2021, 3:52 PMindexType
to Table.index
such that it uses the USING GIN (...);
syntax, but the class Index
only allows indices on `Column`s, not on something like ExpressionWithColumnType
, so something like this seems impossible:
CREATE INDEX idx_fts_post ON post USING gin((setweight(to_tsvector(title),'A') || setweight(to_tsvector(content), 'B')));
Is there a workaround for that? Sadly the Index
class is not open, and therefore I cannot create a subclass with modified behavior. Can one create something like a fake column and get away with it? (Note: I already created custom Exposed functions to use the postgres-specific functions like to_tsvector
)
Maybe it would also be possible to modify the Exposed code to allow something like this in the future? When I see the usage of columns
in Index
, it really seems that if one would provide a custom name for the index and add some if(columnLike is Column<*>)
to the parts where behavior is dependent on the it actually being a column of the table, this would not be a breaking change to make.Jgafner
07/02/2021, 5:43 AMdata class AClass (id: EntityID<Int>) : IntEntity(id)
If not any documentation on how to transform the AClass to a data class to be serialize ?
TnxImran/Malic
07/14/2021, 8:24 AM0.32.1
?
previously, when I would execute
exec("EXEC sp_msforeachtable @command1 = \"ALTER TABLE ? NOCHECK CONSTRAINT all\";")
in the case that there is no ResultSet it doesn't blow up, but now it does - in the case that the ResultSet is empty or non-existent.
it fails with:
WARN -Transaction attempt #1 failed: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.. Statement(s): EXEC sp_msforeachtable @command1 = "ALTER TABLE ? NOCHECK CONSTRAINT all"; org.jetbrains.exposed.exceptions.ExposedSQLException: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.
at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:62)
at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:135)
at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:121)
at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:97)
at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:83)
at org.jetbrains.exposed.sql.Transaction.exec$default(Transaction.kt:82)
Lbenyehu
07/20/2021, 11:18 AMŁukasz Bednarczyk
07/20/2021, 1:21 PMPhil Richardson
08/07/2021, 8:04 PM(optional)BackReferencedOn
for use in my entity, but there is scant examples out there.
I note issue 583 covering an example of this, but it doesn't seem anything got back into the Wiki
It states
... you expect zero or one additional info for a user, but every info has userIt should be expected to be a 1-to-1 mapping only The wider crux of this means the following expanded knowledge For 1-to-1 mapping Use
(optional)BackReferencedOn
on the entity that will always exist
Use referencedOn
on the entity that may or may not exist, but will never exist unless the parent does
Accessing either value in a entity will only ever return a single entity (or null depending on use)
For 1-to-many mapping
Use referrersOn
the left hand side entity - The 1 entity, that can have many children refer to it - Its value in a entity will be a list (0 or more entries)
Use referencedOn
the right hand side entity - The many entities, that can refer to a single parent entity - Its value will be a entity (always 1)
Is this (weird, if convoluted) interpretation correct?tapac
08/08/2021, 8:53 PMŁukasz Bednarczyk
08/09/2021, 6:35 AMSchemaUtils.crerateDatabase?
Should I call it outside a transaction?Nayeem Zen
08/09/2021, 6:14 PMNayeem Zen
08/09/2021, 6:18 PMŁukasz Bednarczyk
08/12/2021, 11:11 AMtapac
09/01/2021, 5:13 PMOp.nullOp()
function to represent NULL in queries, Table.Dual
object to make selects on dummy table, Table.batchReplace
and low-level performance optimizations + several bug fixes.
Please check the recent change log for more information.dave08
09/05/2021, 11:18 AMdave08
09/05/2021, 12:52 PMdave08
09/05/2021, 1:27 PMdave08
09/05/2021, 1:44 PMtapac
09/15/2021, 9:56 AMtapac
09/22/2021, 7:25 PMnullium21
09/27/2021, 4:38 PMreferrersOn
)dave08
09/29/2021, 10:17 AMdave08
09/29/2021, 10:59 AMdave08
09/29/2021, 10:59 AMclass InstantFromEpochSecondsColumnType : ColumnType() {
override fun sqlType(): String = currentDialect.dataTypeProvider.integerType()
override fun valueFromDB(value: Any): Instant = when (value) {
is Int -> Instant.fromEpochSeconds(value.toLong(), 0)
is Number -> Instant.fromEpochSeconds(value.toLong(), 0)
is String -> Instant.fromEpochSeconds(value.toLong(), 0)
else -> error("Unexpected value of type Int: $value of ${value::class.qualifiedName}")
}
override fun notNullValueToDB(value: Any): Any = when {
value is Instant -> value.epochSeconds
else -> error("Invalid value $value")
}
}
fun Table.timestampFromEpochSeconds(name: String): Column<Instant> = registerColumn(name, InstantFromEpochSecondsColumnType())
than_
10/05/2021, 9:08 AMtapac
10/09/2021, 8:08 PMconnectionProperties
added.
Support for relocating Exposed (or another kotlin libs) with Shadow plugin (doc).tapac
10/12/2021, 11:40 AMJohn Pali
10/15/2021, 3:28 PMtapac
10/20/2021, 9:31 AMSchemaUtils.createMissingTablesAndColumns
is used.Lbenyehu
10/20/2021, 1:03 PMsubashz
10/26/2021, 4:32 PMlimit
and offset
is applied in 1 query. For clarification see this previous thread: https://kotlinlang.slack.com/archives/C0CG7E0A1/p1591256151141300