'ColumnType' -> 'DatabaseType', removed 'STRING' database type, 'BYTE_ARRAY' -> 'BINARY_DATA'

This commit is contained in:
Andrew Golovashevich 2025-01-04 17:04:14 +03:00
parent d55cc47415
commit 29f2435057
19 changed files with 629 additions and 618 deletions

View File

@ -4,455 +4,454 @@ import kotlinx.datetime.Instant
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.LocalTime
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface Expression<RuntimeType, DatabaseType : ColumnType<RuntimeType>, OwnerBuilderUserExtension : Any> {
public interface Expression<RuntimeType, DT : DatabaseType<RuntimeType>, OwnerBuilderUserExtension : Any> {
public interface Builder<OwnerBuilderUserExtension : Any> {
public fun <DatabaseType : ColumnType<*>> equals(
left: Expression<*, DatabaseType, OwnerBuilderUserExtension>,
right: Expression<*, DatabaseType, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
public fun <DT : DatabaseType<*>> equals(
left: Expression<*, DT, OwnerBuilderUserExtension>,
right: Expression<*, DT, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun <DatabaseType : ColumnType<*>> notEquals(
left: Expression<*, DatabaseType, OwnerBuilderUserExtension>,
right: Expression<*, DatabaseType, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension> =
public fun <DT : DatabaseType<*>> notEquals(
left: Expression<*, DT, OwnerBuilderUserExtension>,
right: Expression<*, DT, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension> =
this.logicalNot(this.equals(left, right))
public fun isNull(
e: Expression<*, ColumnType.Nullable<*, *>, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
e: Expression<*, DatabaseType.Nullable<*, *>, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun isNotNull(
e: Expression<*, ColumnType.Nullable<*, *>, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension> =
e: Expression<*, DatabaseType.Nullable<*, *>, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension> =
this.logicalNot(this.isNull(e))
public fun logicalAnd(
left: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
right: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
right: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun logicalOr(
left: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
right: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
right: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun logicalXor(
left: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
right: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension> =
left: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
right: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension> =
this.notEquals(left, right)
public fun logicalNot(
e: Expression<*, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
e: Expression<*, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLess(
left: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersLessOrEquals(
left: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreater(
left: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
right: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
right: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
right: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
right: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
right: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
right: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
right: Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpIntegersGreaterOrEquals(
left: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
right: Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun extendIntegerToS16(
e: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>
e: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>
public fun extendIntegerToS16(
e: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>
e: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>
public fun extendIntegerToU16(
e: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>
e: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>
public fun extendIntegerToS32(
e: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>
e: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>
public fun extendIntegerToS32(
e: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>
e: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>
public fun extendIntegerToS32(
e: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>
e: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>
public fun extendIntegerToS32(
e: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>
e: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>
public fun extendIntegerToU32(
e: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>
e: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>
public fun extendIntegerToU32(
e: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>
e: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>
public fun extendIntegerToS64(
e: Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
e: Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>,
): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun extendIntegerToS64(
e: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
e: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun extendIntegerToS64(
e: Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
e: Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>,
): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun extendIntegerToS64(
e: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
e: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun extendIntegerToS64(
e: Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
e: Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>,
): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun extendIntegerToS64(
e: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
e: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun extendIntegerToU64(
e: Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>,
): Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>
e: Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>,
): Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>
public fun extendIntegerToU64(
e: Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>,
): Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>
e: Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>,
): Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>
public fun extendIntegerToU64(
e: Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>,
): Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>
e: Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>,
): Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>
public fun extendFractionalToDouble(
e: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>
): Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>
e: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>
): Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>
public fun cmpFractionalLess(
left: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalLess(
left: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalLessOrEquals(
left: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalLessOrEquals(
left: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalGreater(
left: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalGreater(
left: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalGreaterOrEquals(
left: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
right: Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpFractionalGreaterOrEquals(
left: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
right: Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateEarlier(
left: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateEarlierOrSimultaneous(
left: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateLater(
left: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateLaterOrSimultaneous(
left: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
right: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalTimeEarlier(
left: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalTimeEarlierOrSimultaneous(
left: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalTimeLater(
left: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalTimeLaterOrSimultaneous(
left: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
right: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateTimeEarlier(
left: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateTimeEarlierOrSimultaneous(
left: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateTimeLater(
left: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpLocalDateTimeLaterOrSimultaneous(
left: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
right: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpInstantEarlier(
left: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpInstantEarlierOrSimultaneous(
left: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpInstantLater(
left: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun cmpInstantLaterOrSimultaneous(
left: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
left: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
right: Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun dateComponentOf(
dt: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>
dt: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>
public fun timeComponentOf(
dt: Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>
dt: Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>,
): Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>
public fun joinDateTime(
date: Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>,
time: Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>
date: Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>,
time: Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>,
): Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>
public fun constantOf(v: String): Expression<String, ColumnType.STRING, OwnerBuilderUserExtension>
public fun constantOf(v: Boolean): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
public fun constantOf(v: Byte): Expression<Byte, ColumnType.INT_S8, OwnerBuilderUserExtension>
public fun constantOf(v: UByte): Expression<UByte, ColumnType.INT_U8, OwnerBuilderUserExtension>
public fun constantOf(v: Short): Expression<Short, ColumnType.INT_S16, OwnerBuilderUserExtension>
public fun constantOf(v: UShort): Expression<UShort, ColumnType.INT_U16, OwnerBuilderUserExtension>
public fun constantOf(v: Int): Expression<Int, ColumnType.INT_S32, OwnerBuilderUserExtension>
public fun constantOf(v: UInt): Expression<UInt, ColumnType.INT_U32, OwnerBuilderUserExtension>
public fun constantOf(v: Long): Expression<Long, ColumnType.INT_S64, OwnerBuilderUserExtension>
public fun constantOf(v: ULong): Expression<ULong, ColumnType.INT_U64, OwnerBuilderUserExtension>
public fun constantOf(v: Float): Expression<Float, ColumnType.FLOAT_32, OwnerBuilderUserExtension>
public fun constantOf(v: Double): Expression<Double, ColumnType.FLOAT_64, OwnerBuilderUserExtension>
public fun constantOf(v: LocalDate): Expression<LocalDate, ColumnType.LOCAL_DATE, OwnerBuilderUserExtension>
public fun constantOf(v: LocalTime): Expression<LocalTime, ColumnType.LOCAL_TIME, OwnerBuilderUserExtension>
public fun constantOf(v: LocalDateTime): Expression<LocalDateTime, ColumnType.LOCAL_DATETIME, OwnerBuilderUserExtension>
public fun constantOf(v: Instant): Expression<Instant, ColumnType.INSTANT, OwnerBuilderUserExtension>
public fun constantOf(v: Boolean): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun constantOf(v: Byte): Expression<Byte, DatabaseType.INT_S8, OwnerBuilderUserExtension>
public fun constantOf(v: UByte): Expression<UByte, DatabaseType.INT_U8, OwnerBuilderUserExtension>
public fun constantOf(v: Short): Expression<Short, DatabaseType.INT_S16, OwnerBuilderUserExtension>
public fun constantOf(v: UShort): Expression<UShort, DatabaseType.INT_U16, OwnerBuilderUserExtension>
public fun constantOf(v: Int): Expression<Int, DatabaseType.INT_S32, OwnerBuilderUserExtension>
public fun constantOf(v: UInt): Expression<UInt, DatabaseType.INT_U32, OwnerBuilderUserExtension>
public fun constantOf(v: Long): Expression<Long, DatabaseType.INT_S64, OwnerBuilderUserExtension>
public fun constantOf(v: ULong): Expression<ULong, DatabaseType.INT_U64, OwnerBuilderUserExtension>
public fun constantOf(v: Float): Expression<Float, DatabaseType.FLOAT_32, OwnerBuilderUserExtension>
public fun constantOf(v: Double): Expression<Double, DatabaseType.FLOAT_64, OwnerBuilderUserExtension>
public fun constantOf(v: LocalDate): Expression<LocalDate, DatabaseType.LOCAL_DATE, OwnerBuilderUserExtension>
public fun constantOf(v: LocalTime): Expression<LocalTime, DatabaseType.LOCAL_TIME, OwnerBuilderUserExtension>
public fun constantOf(v: LocalDateTime): Expression<LocalDateTime, DatabaseType.LOCAL_DATETIME, OwnerBuilderUserExtension>
public fun constantOf(v: Instant): Expression<Instant, DatabaseType.INSTANT, OwnerBuilderUserExtension>
@OptIn(ExperimentalUnsignedTypes::class)
public fun constantOf(v: ByteArray): Expression<UByteArray, ColumnType.BYTE_ARRAY, OwnerBuilderUserExtension>
public fun constantOf(v: ByteArray): Expression<UByteArray, DatabaseType.BINARY_DATA, OwnerBuilderUserExtension>
public fun <ArgRuntimeType : Any, ArgDatabaseType : ColumnType<ArgRuntimeType>, RetRuntimeType, RetDatabaseType : ColumnType<RetRuntimeType>> ifNull(
nullable: Expression<ArgRuntimeType?, ColumnType.Nullable<ArgRuntimeType, ArgDatabaseType>, OwnerBuilderUserExtension>,
onValue: (Expression<ArgRuntimeType, ArgDatabaseType, OwnerBuilderUserExtension>) -> Expression<RetRuntimeType, RetDatabaseType, OwnerBuilderUserExtension>,
onNull: () -> Expression<RetRuntimeType, RetDatabaseType, OwnerBuilderUserExtension>
): Expression<RetRuntimeType, RetDatabaseType, OwnerBuilderUserExtension>
public fun <ArgRT : Any, ArgDT : DatabaseType<ArgRT>, RetRuntimeType, RetDT : DatabaseType<RetRuntimeType>> ifNull(
nullable: Expression<ArgRT?, DatabaseType.Nullable<ArgRT, ArgDT>, OwnerBuilderUserExtension>,
onValue: (Expression<ArgRT, ArgDT, OwnerBuilderUserExtension>) -> Expression<RetRuntimeType, RetDT, OwnerBuilderUserExtension>,
onNull: () -> Expression<RetRuntimeType, RetDT, OwnerBuilderUserExtension>
): Expression<RetRuntimeType, RetDT, OwnerBuilderUserExtension>
public fun <ArgRuntimeType : Any, ArgDatabaseType : ColumnType<ArgRuntimeType>> notNullAnd(
nullable: Expression<ArgRuntimeType?, ColumnType.Nullable<ArgRuntimeType, ArgDatabaseType>, OwnerBuilderUserExtension>,
onValue: (Expression<ArgRuntimeType, ArgDatabaseType, OwnerBuilderUserExtension>) -> Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
public fun <ArgRT : Any, ArgDT : DatabaseType<ArgRT>> notNullAnd(
nullable: Expression<ArgRT?, DatabaseType.Nullable<ArgRT, ArgDT>, OwnerBuilderUserExtension>,
onValue: (Expression<ArgRT, ArgDT, OwnerBuilderUserExtension>) -> Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
public fun <ArgRuntimeType : Any, ArgDatabaseType : ColumnType<ArgRuntimeType>> nullOr(
nullable: Expression<ArgRuntimeType?, ColumnType.Nullable<ArgRuntimeType, ArgDatabaseType>, OwnerBuilderUserExtension>,
onValue: (Expression<ArgRuntimeType, ArgDatabaseType, OwnerBuilderUserExtension>) -> Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, ColumnType.BOOLEAN, OwnerBuilderUserExtension>
public fun <ArgRT : Any, ArgDT : DatabaseType<ArgRT>> nullOr(
nullable: Expression<ArgRT?, DatabaseType.Nullable<ArgRT, ArgDT>, OwnerBuilderUserExtension>,
onValue: (Expression<ArgRT, ArgDT, OwnerBuilderUserExtension>) -> Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>,
): Expression<Boolean, DatabaseType.BOOLEAN, OwnerBuilderUserExtension>
}
}

View File

@ -2,7 +2,7 @@ package ru.landgrafhomyak.serdha.api.v0.ddl.table
import kotlin.jvm.JvmName
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
/**
* Descriptor of 'check' constraint on columns. Used for schema manipulations.
@ -30,7 +30,7 @@ public interface CheckConstraint<TableUserExtension : Any> {
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("expression")
public val expression: Expression<Boolean, ColumnType.BOOLEAN, TableUserExtension>
public val expression: Expression<Boolean, DatabaseType.BOOLEAN, TableUserExtension>
/**

View File

@ -1,17 +1,17 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.table
import kotlin.jvm.JvmName
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
import ru.landgrafhomyak.serdha.api.v0.dml.SelectedTable
/**
* Descriptor of data column (of table or query). Used for schema manipulations and [access in queries builder][SelectedTable.selectColumn].
*
* @param RuntimeType Type in programming language to which database type is converted.
* @param DatabaseType Descriptor of column type on database side.
* @param RT Type in programming language to which database type is converted.
* @param DT Descriptor of column type on database side.
* @param TableUserExtension Type of [owner's table][Column.table] user expression for static reporting errors when this descriptor passed to wrong table.
*/
public interface Column<RuntimeType, DatabaseType : ColumnType<RuntimeType>, TableUserExtension : Any> {
public interface Column<RT, DT : DatabaseType<RT>, TableUserExtension : Any> {
/**
* Name of column for debugging, errors and raw schema access.
*/
@ -25,7 +25,7 @@ public interface Column<RuntimeType, DatabaseType : ColumnType<RuntimeType>, Tab
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("type")
public val type: DatabaseType
public val type: DT
/**
* Table, that contains this column. For debugging.

View File

@ -2,16 +2,15 @@ package ru.landgrafhomyak.serdha.api.v0.ddl.table
import kotlin.jvm.JvmName
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
/**
* Descriptor of default value attached to [column][Column]. Used for schema manipulations.
*
* @param RuntimeType Type in programming language to which database type is converted.
* @param DatabaseType Descriptor of column type on database side.
* @param RT Type in programming language to which database type is converted.
* @param DT Descriptor of column type on database side.
* @param TableUserExtension Type of [owner's table][Column.table] user expression for static reporting errors when this descriptor passed to wrong table.
*/
public interface DefaultConstraint<RuntimeType, DatabaseType : ColumnType<RuntimeType>, TableUserExtension : Any> {
public interface DefaultConstraint<RT, DT : ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType<RT>, TableUserExtension : Any> {
/**
* Name of constraint for debugging, errors and raw schema access.
*/
@ -31,12 +30,12 @@ public interface DefaultConstraint<RuntimeType, DatabaseType : ColumnType<Runtim
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("attachedToColumn")
public val attachedToColumn: Column<RuntimeType, DatabaseType, TableUserExtension>
public val attachedToColumn: Column<RT, DT, TableUserExtension>
/**
* Expression used to initialize cell.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("expression")
public val expression: Expression<RuntimeType, DatabaseType, TableUserExtension>
public val expression: Expression<RT, DT, TableUserExtension>
}

View File

@ -1,7 +1,7 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.table
import kotlin.jvm.JvmName
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.RowId
/**
@ -23,7 +23,7 @@ public interface ForeignRowReference<ContainerTableUserExtension : Any, TargetTa
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("fromColumn")
public val fromColumn: Column<RowId<TargetTableUserExtension>, ColumnType.ROW_ID<TargetTableUserExtension>, ContainerTableUserExtension>
public val fromColumn: Column<RowId<TargetTableUserExtension>, DatabaseType.ROW_ID<TargetTableUserExtension>, ContainerTableUserExtension>
/**
* Table referenced by this foreign key. For debugging.
@ -37,7 +37,7 @@ public interface ForeignRowReference<ContainerTableUserExtension : Any, TargetTa
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("toColumn")
public val toColumn: Column<RowId<TargetTableUserExtension>, ColumnType.ROW_ID<TargetTableUserExtension>, TargetTableUserExtension>
public val toColumn: Column<RowId<TargetTableUserExtension>, DatabaseType.ROW_ID<TargetTableUserExtension>, TargetTableUserExtension>
/**
@ -52,7 +52,7 @@ public interface ForeignRowReference<ContainerTableUserExtension : Any, TargetTa
/**
* Replaces all references to deleted row in [ForeignRowReference.fromColumn] with `null`.
*
* Type of [ForeignRowReference.fromColumn] must be [nullable][ColumnType.Builder.nullableOf].
* Type of [ForeignRowReference.fromColumn] must be [nullable][DatabaseType.Builder.nullableOf].
*/
SET_NULL,

View File

@ -1,37 +1,38 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.table
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseTypesProvider
import ru.landgrafhomyak.serdha.api.v0.ddl.types.RowId
public interface TableCreator<TableUserExtension : Any> {
public val expressionBuilder: Expression.Builder<TableUserExtension>
public val types: ColumnType.Builder
public val types: DatabaseTypesProvider
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> column(name: String, type: DatabaseType): Column<RuntimeType, DatabaseType, TableUserExtension>
public fun <RuntimeType, DatabaseType : ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType<RuntimeType>> column(name: String, type: DatabaseType): Column<RuntimeType, DatabaseType, TableUserExtension>
public fun index(name: String, vararg columns: Column<*, *, TableUserExtension>): Index<TableUserExtension>
public fun uniqueIndex(name: String, distinctNulls: Boolean, vararg columns: Column<*, *, TableUserExtension>): UniqueIndex<TableUserExtension>
public fun checkConstraint(name: String, constraint: Expression<Boolean, ColumnType.BOOLEAN, TableUserExtension>): CheckConstraint<TableUserExtension>
public fun <RuntimeType : Any, DatabaseType : ColumnType<RuntimeType>> defaultValue(c: Column<RuntimeType, DatabaseType, TableUserExtension>, expr: Expression<RuntimeType, DatabaseType, TableUserExtension>): DefaultConstraint<RuntimeType, DatabaseType, TableUserExtension>
public fun checkConstraint(name: String, constraint: Expression<Boolean, DatabaseType.BOOLEAN, TableUserExtension>): CheckConstraint<TableUserExtension>
public fun <RuntimeType : Any, DatabaseType : ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType<RuntimeType>> defaultValue(c: Column<RuntimeType, DatabaseType, TableUserExtension>, expr: Expression<RuntimeType, DatabaseType, TableUserExtension>): DefaultConstraint<RuntimeType, DatabaseType, TableUserExtension>
@Suppress("PropertyName")
public val rowId_column: Column<RowId<TableUserExtension>, ColumnType<RowId<TableUserExtension>>, TableUserExtension>
public val rowId_column: Column<RowId<TableUserExtension>, DatabaseType<RowId<TableUserExtension>>, TableUserExtension>
@Suppress("PropertyName")
public val rowId_uniqueConstraint: UniqueIndex<TableUserExtension>
public fun <TargetTableUserWrapper : Any> selfRowReference(
onDelete: ForeignRowReference.OnDeleteAction,
toColumn: Column<RowId<TargetTableUserWrapper>, ColumnType.ROW_ID<TargetTableUserWrapper>, TargetTableUserWrapper>,
toColumn: Column<RowId<TargetTableUserWrapper>, DatabaseType.ROW_ID<TargetTableUserWrapper>, TargetTableUserWrapper>,
): ForeignRowReference<TableUserExtension, TableUserExtension>
public fun <TargetTableUserWrapper : Any> foreignRowReference(
fromColumn: Column<RowId<TargetTableUserWrapper>, ColumnType.ROW_ID<TargetTableUserWrapper>, TableUserExtension>,
fromColumn: Column<RowId<TargetTableUserWrapper>, DatabaseType.ROW_ID<TargetTableUserWrapper>, TableUserExtension>,
toTable: Table<TargetTableUserWrapper, *>,
toColumn: Column<RowId<TargetTableUserWrapper>, ColumnType.ROW_ID<TargetTableUserWrapper>, TargetTableUserWrapper>,
toColumn: Column<RowId<TargetTableUserWrapper>, DatabaseType.ROW_ID<TargetTableUserWrapper>, TargetTableUserWrapper>,
onDelete: ForeignRowReference.OnDeleteAction,
): ForeignRowReference<TableUserExtension, TargetTableUserWrapper>
}

View File

@ -1,18 +1,18 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.table
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface TableUpdater<TableNewUserExtension : Any, TableOldUserExtension : Any> : TableCreator<TableNewUserExtension> {
public val oldExpressionBuilder: Expression.Builder<TableOldUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> keepColumn(c: Column<RuntimeType, DatabaseType, TableOldUserExtension>): Column<RuntimeType, DatabaseType, TableNewUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> renameAndKeepColumn(c: Column<RuntimeType, DatabaseType, TableOldUserExtension>, newName: String): Column<RuntimeType, DatabaseType, TableNewUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> mapAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newValue: Expression<RuntimeType, DatabaseType, TableOldUserExtension>, where: Expression<Boolean, ColumnType.BOOLEAN, TableNewUserExtension>?): Column<RuntimeType, DatabaseType, TableNewUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> mapAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newValue: Expression<RuntimeType, DatabaseType, TableOldUserExtension>): Column<RuntimeType, DatabaseType, TableNewUserExtension> = this.mapAndKeepColumn(c, newValue, null)
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> mapAndRenameAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newName: String, newValue: Expression<RuntimeType, DatabaseType, TableOldUserExtension>, where: Expression<Boolean, ColumnType.BOOLEAN, TableNewUserExtension>?): Column<RuntimeType, DatabaseType, TableNewUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> mapAndRenameAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newName: String, newValue: Expression<RuntimeType, DatabaseType, TableOldUserExtension>): Column<RuntimeType, DatabaseType, TableNewUserExtension> = this.mapAndRenameAndKeepColumn(c, newName, newValue, null)
public fun <RT, DT : DatabaseType<RT>> keepColumn(c: Column<RT, DT, TableOldUserExtension>): Column<RT, DT, TableNewUserExtension>
public fun <RT, DT : DatabaseType<RT>> renameAndKeepColumn(c: Column<RT, DT, TableOldUserExtension>, newName: String): Column<RT, DT, TableNewUserExtension>
public fun <RT, DT : DatabaseType<RT>> mapAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newValue: Expression<RT, DT, TableOldUserExtension>, where: Expression<Boolean, DatabaseType.BOOLEAN, TableNewUserExtension>?): Column<RT, DT, TableNewUserExtension>
public fun <RT, DT : DatabaseType<RT>> mapAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newValue: Expression<RT, DT, TableOldUserExtension>): Column<RT, DT, TableNewUserExtension> = this.mapAndKeepColumn(c, newValue, null)
public fun <RT, DT : DatabaseType<RT>> mapAndRenameAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newName: String, newValue: Expression<RT, DT, TableOldUserExtension>, where: Expression<Boolean, DatabaseType.BOOLEAN, TableNewUserExtension>?): Column<RT, DT, TableNewUserExtension>
public fun <RT, DT : DatabaseType<RT>> mapAndRenameAndKeepColumn(c: Column<*, *, TableOldUserExtension>, newName: String, newValue: Expression<RT, DT, TableOldUserExtension>): Column<RT, DT, TableNewUserExtension> = this.mapAndRenameAndKeepColumn(c, newName, newValue, null)
public fun deleteColumn(c: Column<*, *, TableOldUserExtension>)
public fun keepIndex(i: Index<TableOldUserExtension>): Index<TableNewUserExtension>
@ -27,8 +27,8 @@ public interface TableUpdater<TableNewUserExtension : Any, TableOldUserExtension
public fun renameAndKeepUniqueIndex(i: UniqueIndex<TableOldUserExtension>, newName: String): UniqueIndex<TableNewUserExtension>
public fun deleteUniqueIndex(i: UniqueIndex<TableOldUserExtension>)
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> keepDefaultValue(c: Column<RuntimeType, DatabaseType, TableNewUserExtension>, d: DefaultConstraint<RuntimeType, DatabaseType, TableOldUserExtension>): DefaultConstraint<RuntimeType, DatabaseType, TableNewUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> changeDefaultValue(c: Column<RuntimeType, DatabaseType, TableNewUserExtension>, d: DefaultConstraint<*, *, TableOldUserExtension>): DefaultConstraint<RuntimeType, DatabaseType, TableNewUserExtension>
public fun <RT, DT : DatabaseType<RT>> keepDefaultValue(c: Column<RT, DT, TableNewUserExtension>, d: DefaultConstraint<RT, DT, TableOldUserExtension>): DefaultConstraint<RT, DT, TableNewUserExtension>
public fun <RT, DT : DatabaseType<RT>> changeDefaultValue(c: Column<RT, DT, TableNewUserExtension>, d: DefaultConstraint<*, *, TableOldUserExtension>): DefaultConstraint<RT, DT, TableNewUserExtension>
public fun deleteDefaultValue(i: DefaultConstraint<*, *, TableOldUserExtension>)
public fun <TargetTableUserWrapper : Any> keepForeignRowReference(

View File

@ -1,285 +0,0 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.types
import kotlin.jvm.JvmField
import kotlin.jvm.JvmName
import kotlinx.datetime.Instant
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.LocalTime
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Table
/**
* Descriptor of a database type.
*
* @param RuntimeType Type in programming language to which database type is converted.
*/
@Suppress("ClassName", "RemoveRedundantQualifierName")
public interface ColumnType<@Suppress("unused") RuntimeType> {
/**
* Name of database type for debugging and errors.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("name")
public val name: String
/**
* Provider of database types descriptors.
*/
@Suppress("FunctionName", "PropertyName")
public interface Builder {
/**
* Type of internal row id. Can't be casted to types like integers or pointers.
* @param TableUserExtension User's extension type for target table. For static type checking.
* @param table Descriptor of table whose row_id type will be obtained.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("ROW_ID")
public fun <TableUserExtension : Any> ROW_ID(table: Table<TableUserExtension, *>): ColumnType<RowId<TableUserExtension>>
/**
* Descriptor of a boolean type. Fields of this type can contain only 2 values: `true` and `false`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("BOOLEAN")
public val BOOLEAN: BOOLEAN
/**
* Descriptor of a signed integer type with size at least 8 bits. Can contain values in range `-128..127`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S8")
public val INT_S8: INT_S8
/**
* Descriptor of an unsigned integer type with size at least 8 bits. Can contain values in range `0..255`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U8")
public val INT_U8: INT_U8
/**
* Descriptor of a signed integer type with size at least 16 bits. Can contain values in range `-32768..32767`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S16")
public val INT_S16: INT_S16
/**
* Descriptor of an unsigned integer type with size at least 16 bits. Can contain values in range `0..65535`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U16")
public val INT_U16: INT_U16
/**
* Descriptor of a signed integer type with size at least 32 bits. Can contain values in range `-2147483648..2147483647`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S32")
public val INT_S32: INT_S32
/**
* Descriptor of an unsigned integer type with size at least 32 bits. Can contain values in range `0..4294967295`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U32")
public val INT_U32: INT_U32
/**
* Descriptor of a signed integer type with size at least 64 bits. Can contain values in range `-9223372036854775808..9223372036854775807`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S64")
public val INT_S64: INT_S64
/**
* Descriptor of an unsigned integer type with size at least 64 bits. Can contain values in range `0..18446744073709551615`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U64")
public val INT_U64: INT_U64
/**
* Descriptor of a local date type in some format like `(year, month, day)`. Day component can contain values in `1..31`, month in `1..12` and year in `-32768..32767`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("LOCAL_DATE")
public val LOCAL_DATE: LOCAL_DATE
/**
* Descriptor of a local time type in some format like `(hour, minute, second)`. Hour component can contain values in `0..23`, minute in `0..59` and second in `0..59`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("LOCAL_TIME")
public val LOCAL_TIME: LOCAL_TIME
/**
* Descriptor of union of types [LOCAL_DATE][ColumnType.Builder.LOCAL_DATE] and [LOCAL_TIME][ColumnType.Builder.LOCAL_TIME].
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("LOCAL_DATETIME")
public val LOCAL_DATETIME: LOCAL_DATETIME
/**
* Descriptor of a timestamp type. Can contain values in `-9223372036854775808..9223372036854775807`
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INSTANT")
public val INSTANT: INSTANT
/**
* Descriptor of a single-precision floating-point number with size at least 32 bits. See [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754).
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("FLOAT_32")
public val FLOAT_32: FLOAT_32
/**
* Descriptor of a double-precision floating-point number with size at least 64 bits. See [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754).
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("FLOAT_64")
public val FLOAT_64: FLOAT_64
//todo
public val STRING: STRING
//todo
public fun STRING(size: UInt): STRING
//todo
public val BYTE_ARRAY: BYTE_ARRAY
//todo
public fun BYTE_ARRAY(size: UInt): BYTE_ARRAY
/**
* Returns descriptor of a new type, which can contain all values of [original type][notNullType] or `null` value.
*
* Descriptors of nullable types are returned without any modifications.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("nullableOf")
public fun <R : Any, D : ColumnType<R>> nullableOf(notNullType: D): Nullable<R, D>
}
// todo
public abstract class _VirtualType<R : Any>(@Suppress("MemberVisibilityCanBePrivate") @JvmField public val wraps: ColumnType<R>)
/**
* Descriptor of a nullable database type for static type-checking.
* @see ColumnType.Builder.nullableOf
*/
public interface Nullable<RuntimeType : Any, @Suppress("unused") DatabaseType : ColumnType<RuntimeType>> : ColumnType<RuntimeType?>
/**
* Descriptor of an internal row id type for static type-checking.
* @param TargetTableUserWrapper User's extension type for target table. For static type checking.
* @see ColumnType.Builder.ROW_ID
*/
public interface ROW_ID<TargetTableUserWrapper: Any> : ColumnType<RowId<TargetTableUserWrapper>>
/**
* Descriptor of a boolean type for static type-checking.
* @see ColumnType.Builder.BOOLEAN
*/
public interface BOOLEAN : ColumnType<Boolean>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_S8
*/
public interface INT_S8 : ColumnType<Byte>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_U8
*/
public interface INT_U8 : ColumnType<UByte>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_S16
*/
public interface INT_S16 : ColumnType<Short>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_U16
*/
public interface INT_U16 : ColumnType<UShort>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_S32
*/
public interface INT_S32 : ColumnType<Int>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_U32
*/
public interface INT_U32 : ColumnType<UInt>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_S64
*/
public interface INT_S64 : ColumnType<Long>
/**
* Descriptor of an integer type for static type-checking.
* @see ColumnType.Builder.INT_U64
*/
public interface INT_U64 : ColumnType<ULong>
/**
* Descriptor of a date type for static type-checking.
* @see ColumnType.Builder.LOCAL_DATE
*/
public interface LOCAL_DATE : ColumnType<LocalDate>
/**
* Descriptor of a time type for static type-checking.
* @see ColumnType.Builder.LOCAL_TIME
*/
public interface LOCAL_TIME : ColumnType<LocalTime>
/**
* Descriptor of a date-time type for static type-checking.
* @see ColumnType.Builder.LOCAL_DATETIME
*/
public interface LOCAL_DATETIME : ColumnType<LocalDateTime>
/**
* Descriptor of a date-time type for static type-checking.
* @see ColumnType.Builder.INSTANT
*/
public interface INSTANT : ColumnType<Instant>
/**
* Descriptor of a floating-point number type for static type-checking.
* @see ColumnType.Builder.FLOAT_32
*/
public interface FLOAT_32 : ColumnType<Float>
/**
* Descriptor of a floating-point number type for static type-checking.
* @see ColumnType.Builder.FLOAT_64
*/
public interface FLOAT_64 : ColumnType<Double>
/**
* Descriptor of a string type for static type-checking.
* @see ColumnType.Builder.STRING
*/
public interface STRING : ColumnType<String>
/**
* Descriptor of a raw binary data type for static type-checking.
* @see ColumnType.Builder.BYTE_ARRAY
*/
@OptIn(ExperimentalUnsignedTypes::class)
public interface BYTE_ARRAY : ColumnType<UByteArray>
}

View File

@ -0,0 +1,146 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.types
import kotlin.jvm.JvmField
import kotlin.jvm.JvmName
import kotlinx.datetime.Instant
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.LocalTime
/**
* Descriptor of a database type.
*
* @param RuntimeType Type in programming language to which database type is converted.
*/
@Suppress("ClassName", "RemoveRedundantQualifierName")
public interface DatabaseType<@Suppress("unused") RuntimeType> {
/**
* Name of database type for debugging and errors.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("name")
public val name: String
// todo
public abstract class _VirtualType<R : Any>(@Suppress("MemberVisibilityCanBePrivate") @JvmField public val wraps: DatabaseType<R>)
/**
* Descriptor of a nullable database type for static type-checking.
* @see DatabaseTypesProvider.nullableOf
*/
public interface Nullable<RT : Any, @Suppress("unused") DT : DatabaseType<RT>> : DatabaseType<RT?>
/**
* Descriptor of an internal row id type for static type-checking.
* @param TargetTableUserWrapper User's extension type for target table. For static type checking.
* @see DatabaseTypesProvider.ROW_ID
*/
public interface ROW_ID<TargetTableUserWrapper : Any> : DatabaseType<RowId<TargetTableUserWrapper>>
/**
* Descriptor of a boolean type for static type-checking.
* @see DatabaseTypesProvider.BOOLEAN
*/
public interface BOOLEAN : DatabaseType<Boolean>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_S8
*/
public interface INT_S8 : DatabaseType<Byte>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_U8
*/
public interface INT_U8 : DatabaseType<UByte>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_S16
*/
public interface INT_S16 : DatabaseType<Short>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_U16
*/
public interface INT_U16 : DatabaseType<UShort>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_S32
*/
public interface INT_S32 : DatabaseType<Int>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_U32
*/
public interface INT_U32 : DatabaseType<UInt>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_S64
*/
public interface INT_S64 : DatabaseType<Long>
/**
* Descriptor of an integer type for static type-checking.
* @see DatabaseTypesProvider.INT_U64
*/
public interface INT_U64 : DatabaseType<ULong>
/**
* Descriptor of a date type for static type-checking.
* @see DatabaseTypesProvider.LOCAL_DATE
*/
public interface LOCAL_DATE : DatabaseType<LocalDate>
/**
* Descriptor of a time type for static type-checking.
* @see DatabaseTypesProvider.LOCAL_TIME
*/
public interface LOCAL_TIME : DatabaseType<LocalTime>
/**
* Descriptor of a date-time type for static type-checking.
* @see DatabaseTypesProvider.LOCAL_DATETIME
*/
public interface LOCAL_DATETIME : DatabaseType<LocalDateTime>
/**
* Descriptor of a date-time type for static type-checking.
* @see DatabaseTypesProvider.INSTANT
*/
public interface INSTANT : DatabaseType<Instant>
/**
* Descriptor of a floating-point number type for static type-checking.
* @see DatabaseTypesProvider.FLOAT_32
*/
public interface FLOAT_32 : DatabaseType<Float>
/**
* Descriptor of a floating-point number type for static type-checking.
* @see DatabaseTypesProvider.FLOAT_64
*/
public interface FLOAT_64 : DatabaseType<Double>
/**
* Descriptor of a raw binary data type for static type-checking.
* @see DatabaseTypesProvider.BINARY_DATA
*/
@OptIn(ExperimentalUnsignedTypes::class)
public interface BINARY_DATA : DatabaseType<UByteArray> {
/**
* Maximum count of bytes that can be stored by values of this type ot `null` if there is no limit.
*/
public val maxSizeOrNull: UInt?
/**
* `true` if value can't hold less than [maxSizeOrNull][DatabaseType.BINARY_DATA.maxSizeOrNull] bytes.
*/
public val isFixedSize: Boolean
}
}

View File

@ -0,0 +1,151 @@
package ru.landgrafhomyak.serdha.api.v0.ddl.types
import kotlin.jvm.JvmName
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Table
/**
* Provider of database types descriptors.
*/
@Suppress("FunctionName", "PropertyName")
public interface DatabaseTypesProvider {
/**
* Type of internal row id. Can't be casted to types like integers or pointers.
* @param TableUserExtension User's extension type for target table. For static type checking.
* @param table Descriptor of table whose row_id type will be obtained.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("ROW_ID")
public fun <TableUserExtension : Any> ROW_ID(table: Table<TableUserExtension, *>): DatabaseType<RowId<TableUserExtension>>
/**
* Descriptor of a boolean type. Fields of this type can contain only 2 values: `true` and `false`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("BOOLEAN")
public val BOOLEAN: DatabaseType.BOOLEAN
/**
* Descriptor of a signed integer type with size at least 8 bits. Can contain values in range `-128..127`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S8")
public val INT_S8: DatabaseType.INT_S8
/**
* Descriptor of an unsigned integer type with size at least 8 bits. Can contain values in range `0..255`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U8")
public val INT_U8: DatabaseType.INT_U8
/**
* Descriptor of a signed integer type with size at least 16 bits. Can contain values in range `-32768..32767`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S16")
public val INT_S16: DatabaseType.INT_S16
/**
* Descriptor of an unsigned integer type with size at least 16 bits. Can contain values in range `0..65535`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U16")
public val INT_U16: DatabaseType.INT_U16
/**
* Descriptor of a signed integer type with size at least 32 bits. Can contain values in range `-2147483648..2147483647`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S32")
public val INT_S32: DatabaseType.INT_S32
/**
* Descriptor of an unsigned integer type with size at least 32 bits. Can contain values in range `0..4294967295`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U32")
public val INT_U32: DatabaseType.INT_U32
/**
* Descriptor of a signed integer type with size at least 64 bits. Can contain values in range `-9223372036854775808..9223372036854775807`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_S64")
public val INT_S64: DatabaseType.INT_S64
/**
* Descriptor of an unsigned integer type with size at least 64 bits. Can contain values in range `0..18446744073709551615`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INT_U64")
public val INT_U64: DatabaseType.INT_U64
/**
* Descriptor of a local date type in some format like `(year, month, day)`. Day component can contain values in `1..31`, month in `1..12` and year in `-32768..32767`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("LOCAL_DATE")
public val LOCAL_DATE: DatabaseType.LOCAL_DATE
/**
* Descriptor of a local time type in some format like `(hour, minute, second)`. Hour component can contain values in `0..23`, minute in `0..59` and second in `0..59`.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("LOCAL_TIME")
public val LOCAL_TIME: DatabaseType.LOCAL_TIME
/**
* Descriptor of union of types [LOCAL_DATE][DatabaseType.Builder.LOCAL_DATE] and [LOCAL_TIME][DatabaseType.Builder.LOCAL_TIME].
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("LOCAL_DATETIME")
public val LOCAL_DATETIME: DatabaseType.LOCAL_DATETIME
/**
* Descriptor of a timestamp type. Can contain values in `-9223372036854775808..9223372036854775807`
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("INSTANT")
public val INSTANT: DatabaseType.INSTANT
/**
* Descriptor of a single-precision floating-point number with size at least 32 bits. See [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754).
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("FLOAT_32")
public val FLOAT_32: DatabaseType.FLOAT_32
/**
* Descriptor of a double-precision floating-point number with size at least 64 bits. See [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754).
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("FLOAT_64")
public val FLOAT_64: DatabaseType.FLOAT_64
/**
* Descriptor of a raw binary data type without size restrictions (must be controlled by user).
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("BINARY_DATA")
public val BINARY_DATA: DatabaseType.BINARY_DATA
/**
* Descriptor of a raw binary data type that can holds maximum [size] bytes.
*
* @param size Maximum count of bytes that can be stored in the value of this type.
* @param isFixedSize If `true`, the type will restrict values with less than [size] bytes.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("BINARY_DATA")
public fun BINARY_DATA(size: UInt, isFixedSize: Boolean): DatabaseType.BINARY_DATA
/**
* Returns descriptor of a new type, which can contain all values of [original type][notNullType] or `null` value.
*
* Descriptors of nullable types are returned itself without any modifications.
*/
@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("nullableOf")
public fun <R : Any, D : DatabaseType<R>> nullableOf(notNullType: D): DatabaseType.Nullable<R, D>
}

View File

@ -2,8 +2,8 @@ package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Column
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface CreateCopyQueryScope<TargetTableUserExtension : Any, QueryUserExtension : Any> :_CreateInsertOrCopyQueryScope<TargetTableUserExtension, QueryUserExtension> {
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> insert(column: Column<RuntimeType, DatabaseType, TargetTableUserExtension>, expression: Expression<RuntimeType, DatabaseType, QueryUserExtension>)
public fun <RT, DT : DatabaseType<RT>> insert(column: Column<RT, DT, TargetTableUserExtension>, expression: Expression<RT, DT, QueryUserExtension>)
}

View File

@ -1,12 +1,12 @@
package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface CreateDeleteQueryScope<TargetTableUserExtension : Any, QueryUserExtension : Any> : _CommonCreateQueryScope<QueryUserExtension> {
public val targetTable: SelectedTable<TargetTableUserExtension, QueryUserExtension>
public fun where(expression: Expression<Boolean, ColumnType.BOOLEAN, QueryUserExtension>)
public fun where(expression: Expression<Boolean, DatabaseType.BOOLEAN, QueryUserExtension>)
public fun limit(size: UInt)

View File

@ -2,19 +2,19 @@ package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Column
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface CreateInsertQueryScope<TargetTableUserExtension : Any, QueryUserExtension : Any> :_CreateInsertOrCopyQueryScope<TargetTableUserExtension, QueryUserExtension> {
public interface CreateInsertQueryScope<TargetTableUserExtension : Any, QueryUserExtension : Any> : _CreateInsertOrCopyQueryScope<TargetTableUserExtension, QueryUserExtension> {
public class DataParam<@Suppress("unused") QueryUserExtension : Any> private constructor()
public val dataExpressionBuilder: Expression.Builder<DataParam<QueryUserExtension>>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> dataParam(name: String, type: DatabaseType): InputParam<RuntimeType, DatabaseType, DataParam<QueryUserExtension>>
public fun <RT, DT : DatabaseType<RT>> dataParam(name: String, type: DT): InputParam<RT, DT, DataParam<QueryUserExtension>>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> insertParam(
column: Column<RuntimeType, DatabaseType, TargetTableUserExtension>,
public fun <RT, DT : DatabaseType<RT>> insertParam(
column: Column<RT, DT, TargetTableUserExtension>,
paramName: String = column.name,
): InputParam<RuntimeType, DatabaseType, DataParam<QueryUserExtension>>
): InputParam<RT, DT, DataParam<QueryUserExtension>>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> insert(column: Column<RuntimeType, DatabaseType, TargetTableUserExtension>, expression: Expression<RuntimeType, DatabaseType, DataParam<QueryUserExtension>>)
public fun <RuntimeType, DT : DatabaseType<RuntimeType>> insert(column: Column<RuntimeType, DT, TargetTableUserExtension>, expression: Expression<RuntimeType, DT, DataParam<QueryUserExtension>>)
}

View File

@ -1,10 +1,10 @@
package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface CreateSelectQueryScope<QueryUserExtension : Any> : _CommonCreateQueryScope<QueryUserExtension>, _CommonCreateQueryScope._ReturningClauseScope<QueryUserExtension>{
public fun where(expression: Expression<Boolean, ColumnType.BOOLEAN, QueryUserExtension>)
public fun where(expression: Expression<Boolean, DatabaseType.BOOLEAN, QueryUserExtension>)
public fun limit(size: UInt)

View File

@ -2,16 +2,16 @@ package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Column
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface CreateUpdateQueryScope<TargetTableUserExtension : Any, QueryUserExtension : Any> : _CommonCreateQueryScope<QueryUserExtension> {
public val targetTable: SelectedTable<TargetTableUserExtension, QueryUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> selectOldColumnValue(c: Column<RuntimeType, DatabaseType, TargetTableUserExtension>): Expression<RuntimeType, DatabaseType, QueryUserExtension>
public fun <RuntimeType, DT : DatabaseType<RuntimeType>> selectOldColumnValue(c: Column<RuntimeType, DT, TargetTableUserExtension>): Expression<RuntimeType, DT, QueryUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> updateColumn(c: Column<RuntimeType, DatabaseType, TargetTableUserExtension>, e: Expression<RuntimeType, DatabaseType, QueryUserExtension>)
public fun <RuntimeType, DT : DatabaseType<RuntimeType>> updateColumn(c: Column<RuntimeType, DT, TargetTableUserExtension>, e: Expression<RuntimeType, DT, QueryUserExtension>)
public fun where(expression: Expression<Boolean, ColumnType.BOOLEAN, QueryUserExtension>)
public fun where(expression: Expression<Boolean, DatabaseType.BOOLEAN, QueryUserExtension>)
public fun limit(size: UInt)

View File

@ -1,9 +1,9 @@
package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
public interface InputParam<RuntimeType, DatabaseType : ColumnType<RuntimeType>, OwnerQueryUserExtension : Any> : Expression<RuntimeType, DatabaseType, OwnerQueryUserExtension> {
public interface InputParam<RT, DT : DatabaseType<RT>, OwnerQueryUserExtension : Any> : Expression<RT, DT, OwnerQueryUserExtension> {
public val name: String
public val userWrapper: OwnerQueryUserExtension
}

View File

@ -2,8 +2,7 @@ package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Column
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
public interface SelectedTable<SelectedTableUserExtension : Any, QueryUserExtension : Any> {
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> selectColumn(column: Column<RuntimeType, DatabaseType, SelectedTableUserExtension>): Expression<RuntimeType, DatabaseType, QueryUserExtension>
public fun <RT, DT : ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType<RT>> selectColumn(column: Column<RT, DT, SelectedTableUserExtension>): Expression<RT, DT, QueryUserExtension>
}

View File

@ -3,21 +3,22 @@ package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.LowLevelApi
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Column
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Table
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseTypesProvider
import ru.landgrafhomyak.serdha.api.v0.runtime.ParametersSetter
import ru.landgrafhomyak.serdha.api.v0.runtime._ParametersSetter
@Suppress("ClassName")
public interface _CommonCreateQueryScope<QueryUserExtension : Any> {
public val types: ColumnType.Builder
public val types: DatabaseTypesProvider
public fun <SelectedTableUserExtension : Any> selectTable(t: Table<SelectedTableUserExtension, *>): SelectedTable<SelectedTableUserExtension, QueryUserExtension>
public interface CanBeSubquery<@Suppress("unused") SelectedQueryUserExtension : Any>
public interface SubqueryParametersSetter<SubqueryUserExtension : Any, QueryUserExtension : Any> : ParametersSetter<SubqueryUserExtension> {
public operator fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> set(c: InputParam<RuntimeType, DatabaseType, QueryUserExtension>, value: Expression<RuntimeType, DatabaseType, QueryUserExtension>)
public operator fun <RT, DT : DatabaseType<RT>> set(c: InputParam<RT, DT, QueryUserExtension>, value: Expression<RT, DT, QueryUserExtension>)
}
public fun <SubqueryUserExtension : Any> selectQuery(q: CanBeSubquery<SubqueryUserExtension>, p: (SubqueryParametersSetter<SubqueryUserExtension, QueryUserExtension>) -> Unit): SelectedTable<SubqueryUserExtension, QueryUserExtension>
@ -54,12 +55,12 @@ public interface _CommonCreateQueryScope<QueryUserExtension : Any> {
): SelectedDiff<SubqueryUserExtension, QueryUserExtension> =
this._selectCopy(q, p) { rr -> for (e in data) r(e, rr) }
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> param(name: String, type: DatabaseType): InputParam<RuntimeType, DatabaseType, QueryUserExtension>
public fun <RT, DT : DatabaseType<RT>> param(name: String, type: DT): InputParam<RT, DT, QueryUserExtension>
public val expressionBuilder: Expression.Builder<QueryUserExtension>
public interface _ReturningClauseScope<QueryUserExtension : Any> {
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> returnExpression(expression: Expression<RuntimeType, DatabaseType, QueryUserExtension>): Column<RuntimeType, DatabaseType, QueryUserExtension>
public fun <RT, DT : DatabaseType<RT>> returnExpression(expression: Expression<RT, DT, QueryUserExtension>): Column<RT, DT, QueryUserExtension>
public val isDistinct: Boolean

View File

@ -2,8 +2,8 @@ package ru.landgrafhomyak.serdha.api.v0.dml
import ru.landgrafhomyak.serdha.api.v0.Expression
import ru.landgrafhomyak.serdha.api.v0.ddl.table.Column
import ru.landgrafhomyak.serdha.api.v0.ddl.types.ColumnType
import ru.landgrafhomyak.serdha.api.v0.ddl.table.UniqueIndex
import ru.landgrafhomyak.serdha.api.v0.ddl.types.DatabaseType
@Suppress("ClassName")
public interface _CreateInsertOrCopyQueryScope<TargetTableUserExtension : Any, QueryUserExtension : Any> : _CommonCreateQueryScope<QueryUserExtension> {
@ -11,9 +11,9 @@ public interface _CreateInsertOrCopyQueryScope<TargetTableUserExtension : Any, Q
@Suppress("ClassName")
public interface _UpsertClauseScope<TargetTableUserExtension : Any, QueryUserExtension : Any> {
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> oldColumnValue(c: Column<RuntimeType, DatabaseType, TargetTableUserExtension>): Expression<RuntimeType, DatabaseType, QueryUserExtension>
public fun <RT, DT : DatabaseType<RT>> oldColumnValue(c: Column<RT, DT, TargetTableUserExtension>): Expression<RT, DT, QueryUserExtension>
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> updateColumn(c: Column<RuntimeType, DatabaseType, TargetTableUserExtension>, e: Expression<RuntimeType, DatabaseType, QueryUserExtension>)
public fun <RT, DT : DatabaseType<RT>> updateColumn(c: Column<RT, DT, TargetTableUserExtension>, e: Expression<RT, DT, QueryUserExtension>)
}
public fun onConflictUpdate(u: UniqueIndex<TargetTableUserExtension>, c: (_UpsertClauseScope<TargetTableUserExtension, QueryUserExtension>) -> Unit)
@ -26,7 +26,7 @@ public interface _CreateInsertOrCopyQueryScope<TargetTableUserExtension : Any, Q
@Suppress("ClassName")
public interface _ReturningUpdatedClauseScope<TargetTableUserExtension : Any, QueryUserExtension : Any> : _CommonCreateQueryScope._ReturningClauseScope<QueryUserExtension> {
public fun <RuntimeType, DatabaseType : ColumnType<RuntimeType>> oldColumnValue(c: Column<RuntimeType, DatabaseType, TargetTableUserExtension>): Expression<RuntimeType, DatabaseType, QueryUserExtension>
public fun <RT, DT : DatabaseType<RT>> oldColumnValue(c: Column<RT, DT, TargetTableUserExtension>): Expression<RT, DT, QueryUserExtension>
}
public val returningUpdated: _ReturningUpdatedClauseScope<TargetTableUserExtension, QueryUserExtension>