Removed universal constructor method and its scope, removed query builders, resolver for all variants of raw statements
This commit is contained in:
parent
d00ecc763e
commit
472b1c0bcd
@ -1,122 +0,0 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.queries
|
||||
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.Column
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.DatabaseType
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.QueryParam
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc._Selectable
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.runtime.InputRow
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.table.RowId
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.table.Table
|
||||
|
||||
public interface DeleteQuery<out qUE : Any> : _Query<qUE> {
|
||||
public interface SingleRow<out qUE : Any> : DeleteQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any> : _Query.Constructor<SingleRow<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): SingleRow<qUE> =
|
||||
outQueries.deleteSingleRow(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
|
||||
public fun createDeleteSingleRowWithReturning(context: Scope<qUE, ttUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rowToRemove")
|
||||
public val rowToRemove: QueryParam<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnRemovedValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, column: QueryParam<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
|
||||
public fun ifNoRowSkip()
|
||||
public fun ifNoRowJustReturn()
|
||||
public fun ifNoRowThrow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface FromSubquery<out qUE : Any> : DeleteQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any, sUE : Any> : _Query.Constructor<FromSubquery<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): FromSubquery<qUE> =
|
||||
outQueries.deleteFromSubquery(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rowToRemove")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("selector")
|
||||
public val selector: _Selectable<sUE>
|
||||
|
||||
public fun createDeleteFromSubqueryWithReturning(context: Scope<qUE, ttUE, sUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("src")
|
||||
public val src: _Selectable<sUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("selectorParams")
|
||||
public val selectorParams: InputRow.WithRedirect<sUE, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("_getSelectorColumn")
|
||||
@set:JvmName("selectorColumn")
|
||||
public var selectorColumn: Column<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>, sUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnFromSubquery(name: String, column: Column<RT, DT, sUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnRemovedValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, column: QueryParam<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
|
||||
public fun ifNoRowSkip()
|
||||
public fun ifNoRowJustReturn()
|
||||
public fun ifNoRowThrow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface MultipleRows<out qUE : Any> : DeleteQuery<qUE>, _Query.Table2Void<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any> : _Query.Constructor<MultipleRows<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): MultipleRows<qUE> =
|
||||
outQueries.deleteMultipleRows(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
|
||||
public fun createMultipleRows(context: Scope<qUE, ttUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rowsToRemove")
|
||||
public val rowsToRemove: QueryParam<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>, qUE>
|
||||
|
||||
public fun ifNoRowSkip()
|
||||
public fun ifNoRowThrow()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.queries
|
||||
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.Column
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.table.Table
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.DatabaseType
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.QueryParam
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc._Selectable
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.runtime.InputRow
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.table.UniqueIndex
|
||||
|
||||
public interface InsertQuery<out qUE : Any> : _Query<qUE> {
|
||||
@Suppress("ClassName")
|
||||
public interface _UpsertClauseScope<qUE : Any, tUE : Any> {
|
||||
public fun keepColumn(column: Column<*, *, tUE>)
|
||||
public fun overrideColumn(column: Column<*, *, tUE>)
|
||||
public fun <RT, DT : DatabaseType<RT>> setFromParam(dst: Column<RT, DT, qUE>, src: QueryParam<RT, DT, qUE>)
|
||||
public fun <RT> setConstant(dst: Column<RT, *, qUE>, src: RT)
|
||||
}
|
||||
|
||||
@Suppress("ClassName")
|
||||
public interface _CommonInsertCreatorScope<qUE : Any, ttUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
|
||||
public fun onConflictUpdate(u: UniqueIndex<ttUE>, c: (_UpsertClauseScope<qUE, ttUE>) -> Unit)
|
||||
public fun onConflictThrow(u: UniqueIndex<ttUE>)
|
||||
public fun onConflictSkip(u: UniqueIndex<ttUE>)
|
||||
}
|
||||
|
||||
|
||||
public interface SingleRow<out qUE : Any> : InsertQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any> : _Query.Constructor<SingleRow<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): SingleRow<qUE> =
|
||||
outQueries.insertSingleRow(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
|
||||
public fun createInsertSingleRowWithReturning(context: Scope<qUE, ttUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> insertConstant(dst: Column<RT, DT, ttUE>, src: RT)
|
||||
public fun <RT, DT : DatabaseType<RT>> insertParam(dst: Column<RT, DT, ttUE>, src: QueryParam<RT, DT, qUE>)
|
||||
|
||||
public fun onConflictReturnOnly(u: UniqueIndex<ttUE>)
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnInsertedValue(name: String, c: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, c: QueryParam<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface FromSubquery<out qUE : Any> : InsertQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any, sUE : Any> : _Query.Constructor<FromSubquery<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): FromSubquery<qUE> =
|
||||
outQueries.insertFromSubquery(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("selector")
|
||||
public val selector: _Selectable<sUE>
|
||||
|
||||
public fun createInsertSingleRowWithReturning(context: Scope<qUE, ttUE, sUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("src")
|
||||
public val src: _Selectable<sUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("sourceQueryParams")
|
||||
public val sourceQueryParams: InputRow.WithRedirect<sUE, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> insertConstant(dst: Column<RT, DT, ttUE>, src: RT)
|
||||
public fun <RT, DT : DatabaseType<RT>> insertParam(dst: Column<RT, DT, ttUE>, src: QueryParam<RT, DT, qUE>)
|
||||
public fun <RT, DT : DatabaseType<RT>> insertFromSubquery(dst: Column<RT, DT, ttUE>, src: Column<RT, DT, sUE>)
|
||||
|
||||
public fun onConflictReturnOnly(u: UniqueIndex<ttUE>)
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnFromSubquery(name: String, column: Column<RT, DT, sUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnInsertedValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, param: QueryParam<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface MultipleRows<out qUE : Any> : InsertQuery<qUE>, _Query.Table2Void<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any> : _Query.Constructor<MultipleRows<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): MultipleRows<qUE> =
|
||||
outQueries.insertMultipleRows(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
public fun createInsertMultipleRows(context: Scope<qUE, ttUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> inputColumn(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> insertColumn(dst: Column<RT, DT, ttUE>, src: QueryParam<RT, DT, qUE>)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -41,13 +41,15 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
|
||||
|
||||
public interface Void2Void {
|
||||
public interface Void2Void : _Statement.Void2Void {
|
||||
public interface Constructor<in STATEMENT_SCOPE : Any?, out RAW_STATEMENT : Any> {
|
||||
public fun createRawStatement_void2void(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
}
|
||||
}
|
||||
|
||||
public interface Void2Single<QUERY_USER_EXTENSION> {
|
||||
public interface Void2Row<QUERY_USER_EXTENSION : Any> : _Statement.Void2Row<QUERY_USER_EXTENSION> {
|
||||
override val uExt: QUERY_USER_EXTENSION
|
||||
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
@ -57,9 +59,9 @@ public interface RawStatement<out qUE : Any> {
|
||||
in GETTER_SCOPE : Any,
|
||||
in SETTER_SCOPE : Any
|
||||
> {
|
||||
public fun createRawStatement_void2single(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
public fun createRawStatement_void2row(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
|
||||
public fun linkRawStatement_void2single(
|
||||
public fun linkRawStatement_void2row(
|
||||
scope: _OutputConstructorScope<
|
||||
@UnsafeVariance QUERY_USER_EXTENSION, @UnsafeVariance TYPE_SCOPE, @UnsafeVariance TYPE_DESCRIPTOR, @UnsafeVariance GETTER_SCOPE, @UnsafeVariance SETTER_SCOPE
|
||||
>
|
||||
@ -67,7 +69,9 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Void2AtMostSingle<QUERY_USER_EXTENSION> {
|
||||
public interface Void2RowOrNull<QUERY_USER_EXTENSION : Any> : _Statement.Void2RowOrNull<QUERY_USER_EXTENSION> {
|
||||
override val uExt: QUERY_USER_EXTENSION
|
||||
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
@ -77,9 +81,9 @@ public interface RawStatement<out qUE : Any> {
|
||||
in GETTER_SCOPE : Any,
|
||||
in SETTER_SCOPE : Any
|
||||
> {
|
||||
public fun createRawStatement_void2atMostSingle(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
public fun createRawStatement_void2rowOrNull(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
|
||||
public fun linkRawStatement_void2atMostSingle(
|
||||
public fun linkRawStatement_void2rowOrNull(
|
||||
scope: _OutputConstructorScope<
|
||||
@UnsafeVariance QUERY_USER_EXTENSION, @UnsafeVariance TYPE_SCOPE, @UnsafeVariance TYPE_DESCRIPTOR, @UnsafeVariance GETTER_SCOPE, @UnsafeVariance SETTER_SCOPE
|
||||
>
|
||||
@ -87,7 +91,9 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Void2Table<QUERY_USER_EXTENSION> {
|
||||
public interface Void2Table<QUERY_USER_EXTENSION : Any> : _Statement.Void2Table<QUERY_USER_EXTENSION> {
|
||||
override val uExt: QUERY_USER_EXTENSION
|
||||
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
@ -107,7 +113,7 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Params2Void<QUERY_USER_EXTENSION> {
|
||||
public interface Params2Void<QUERY_USER_EXTENSION : Any> : _Statement.Params2Void<QUERY_USER_EXTENSION> {
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
@ -127,7 +133,7 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Params2Single<QUERY_USER_EXTENSION> {
|
||||
public interface Params2Row<QUERY_USER_EXTENSION : Any> : _Statement.Params2Row<QUERY_USER_EXTENSION> {
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
@ -137,9 +143,9 @@ public interface RawStatement<out qUE : Any> {
|
||||
in GETTER_SCOPE : Any,
|
||||
in SETTER_SCOPE : Any
|
||||
> {
|
||||
public fun createRawStatement_params2single(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
public fun createRawStatement_params2row(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
|
||||
public fun linkRawStatement_params2single(
|
||||
public fun linkRawStatement_params2row(
|
||||
scope: _IOConstructorScope<
|
||||
@UnsafeVariance QUERY_USER_EXTENSION, @UnsafeVariance TYPE_SCOPE, @UnsafeVariance TYPE_DESCRIPTOR, @UnsafeVariance GETTER_SCOPE, @UnsafeVariance SETTER_SCOPE
|
||||
>
|
||||
@ -147,7 +153,7 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Params2AtMostSingle<QUERY_USER_EXTENSION> {
|
||||
public interface Params2RowOrNull<QUERY_USER_EXTENSION : Any> : _Statement.Params2RowOrNull<QUERY_USER_EXTENSION> {
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
@ -157,9 +163,9 @@ public interface RawStatement<out qUE : Any> {
|
||||
in GETTER_SCOPE : Any,
|
||||
in SETTER_SCOPE : Any
|
||||
> {
|
||||
public fun createRawStatement_params2atMostSingle(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
public fun createRawStatement_params2rowOrNull(scope: STATEMENT_SCOPE): RAW_STATEMENT
|
||||
|
||||
public fun linkRawStatement_params2atMostSingle(
|
||||
public fun linkRawStatement_params2rowOrNull(
|
||||
scope: _OutputConstructorScope<
|
||||
@UnsafeVariance QUERY_USER_EXTENSION, @UnsafeVariance TYPE_SCOPE, @UnsafeVariance TYPE_DESCRIPTOR, @UnsafeVariance GETTER_SCOPE, @UnsafeVariance SETTER_SCOPE
|
||||
>
|
||||
@ -167,7 +173,7 @@ public interface RawStatement<out qUE : Any> {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Params2Table<QUERY_USER_EXTENSION> {
|
||||
public interface Params2Table<QUERY_USER_EXTENSION : Any> : _Statement.Params2Table<QUERY_USER_EXTENSION> {
|
||||
public interface Constructor<
|
||||
out QUERY_USER_EXTENSION : Any,
|
||||
in STATEMENT_SCOPE : Any?,
|
||||
|
@ -1,260 +0,0 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.queries
|
||||
|
||||
import kotlin.jvm.JvmField
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.Column
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.IntermediateColumn
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.DatabaseType
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.Mapper
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.FiltersScope
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.QueryParam
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.Reducer
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc._Selectable
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.runtime.InputRow
|
||||
|
||||
public interface SelectQuery<out qUE : Any> : _Query<qUE> {
|
||||
public enum class Order {
|
||||
ASC, DESC
|
||||
}
|
||||
|
||||
public abstract class JoinType {
|
||||
public class LeftJoin(
|
||||
@JvmField
|
||||
public val leftNull: Null,
|
||||
@JvmField
|
||||
public val behaviour: Behaviour
|
||||
) : JoinType() {
|
||||
@Suppress("ClassName")
|
||||
public abstract class Null {
|
||||
public object NULL_NOT_EXPECTED : Null()
|
||||
public object AS_ID : Null()
|
||||
public object SKIP : Null()
|
||||
public object JOIN_TO_NULL : Null()
|
||||
}
|
||||
|
||||
@Suppress("ClassName")
|
||||
public abstract class Behaviour {
|
||||
public object LEFT_TO_UNIQUE_RIGHT : Behaviour()
|
||||
public object LEFT_TO_UNIQUE_RIGHT_OR_TO_NULL : Behaviour()
|
||||
public object LEFT_FOR_EACH_RIGHT : Behaviour()
|
||||
public object LEFT_FOR_EACH_RIGHT_OR_TO_NULL : Behaviour()
|
||||
}
|
||||
}
|
||||
|
||||
public object CrossJoin : JoinType()
|
||||
}
|
||||
|
||||
@Suppress("ClassName")
|
||||
public interface _CommonSelectCreatorScope<qUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> paramAsColumn(param: QueryParam<RT, DT, qUE>): IntermediateColumn<RT, DT, qUE>
|
||||
|
||||
public fun <mUE : Any> createMapper(constructor: Mapper.Constructor<mUE>): Mapper<mUE>
|
||||
public fun <mUE : Any, oUE : Any> mapColumns(
|
||||
mapper: Mapper<mUE>,
|
||||
input: Mapper.InputLinker<mUE, qUE>,
|
||||
output: Mapper.OutputLinker<mUE, qUE, oUE>
|
||||
): oUE
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("filters")
|
||||
public val filters: FiltersScope<qUE>
|
||||
public fun orderBy(order: Order, vararg column: IntermediateColumn<*, *, qUE>)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("_getLimit")
|
||||
@set:JvmName("limit")
|
||||
public var limit: UInt
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("_getOffset")
|
||||
@set:JvmName("offset")
|
||||
public var offset: ULong
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, param: QueryParam<RT, DT, qUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnColumn(name: String, column: IntermediateColumn<RT, DT, qUE>): Column<RT, DT, qUE>
|
||||
}
|
||||
|
||||
public interface Simple<out qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, tUE : Any> : _Query.Constructor<Simple<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): Simple<qUE> =
|
||||
outQueries.select(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("source")
|
||||
public val source: _Selectable<tUE>
|
||||
|
||||
public fun createSelect(context: Scope<qUE, tUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, tUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("src")
|
||||
public val src: _Selectable<tUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("subqueryParams")
|
||||
public val subqueryParams: InputRow.WithRedirect<tUE, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> selectColumnFromSubquery(param: Column<RT, DT, tUE>): IntermediateColumn<RT, DT, qUE>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface WithJoin<out qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, lsqUE : Any, rsqUE : Any> : _Query.Constructor<WithJoin<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): WithJoin<qUE> =
|
||||
outQueries.selectWithJoin(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("left")
|
||||
public val left: _Selectable<lsqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("right")
|
||||
public val right: _Selectable<rsqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("joinType")
|
||||
public val joinType: JoinType
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("leftColumnToJoin")
|
||||
public val leftColumnToJoin: Column<*, *, lsqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rightColumnToJoin")
|
||||
public val rightColumnToJoin: Column<*, *, rsqUE>
|
||||
|
||||
public fun createSelectWithJoin(context: Scope<qUE, lsqUE, rsqUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, lsqUE : Any, rsqUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("lsq")
|
||||
public val lsq: _Selectable<lsqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rsq")
|
||||
public val rsq: _Selectable<rsqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("leftSubqueryParams")
|
||||
public val leftSubqueryParams: InputRow.WithRedirect<lsqUE, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rightSubqueryParams")
|
||||
public val rightSubqueryParams: InputRow.WithRedirect<rsqUE, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> selectColumnFromLeft(column: Column<RT, DT, lsqUE>): IntermediateColumn<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> selectColumnFromRight(column: Column<RT, DT, rsqUE>): IntermediateColumn<RT, DT, qUE>
|
||||
public fun <RT : Any, DT : DatabaseType<RT>> selectColumnFromRightAsNullable(column: Column<RT, DT, rsqUE>): IntermediateColumn<RT?, DatabaseType.Nullable<RT, DT>, qUE>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface Reducing<out qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, tUE : Any> : _Query.Constructor<Reducing<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): Reducing<qUE> =
|
||||
outQueries.selectReducing(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("source")
|
||||
public val source: _Selectable<tUE>
|
||||
|
||||
public fun createSelectWithReduce(context: Scope<qUE, tUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, tUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("src")
|
||||
public val src: _Selectable<tUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("sourceParams")
|
||||
public val sourceParams: InputRow.WithRedirect<tUE, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> selectColumnFromSubquery(param: Column<RT, DT, tUE>): IntermediateColumn<RT, DT, qUE>
|
||||
|
||||
public fun <rUE : Any> createReducer(constructor: Reducer.Constructor<rUE>): Reducer<rUE>
|
||||
public fun <mUE : Any, oUE : Any> reduceRows(
|
||||
reducer: Reducer<mUE>,
|
||||
linker: Reducer.Linker<mUE, qUE, oUE>,
|
||||
): oUE
|
||||
|
||||
public fun groupBy(vararg columns: IntermediateColumn<*, *, qUE>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface Folding<out qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, tUE : Any> : _Query.Constructor<Folding<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): Folding<qUE> =
|
||||
outQueries.selectFolding(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("source")
|
||||
public val source: _Selectable<tUE>
|
||||
|
||||
public fun createSelectWithFold(context: Scope<qUE, tUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, tUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("src")
|
||||
public val src: _Selectable<tUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("sourceParams")
|
||||
public val sourceParams: InputRow.WithRedirect<tUE, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> selectColumnFromSubquery(param: Column<RT, DT, tUE>): IntermediateColumn<RT, DT, qUE>
|
||||
|
||||
public fun <rUE : Any> createReducer(constructor: Reducer.Constructor<rUE>): Reducer<rUE>
|
||||
public fun <mUE : Any, oUE : Any> foldRows(
|
||||
reducer: Reducer<mUE>,
|
||||
linker: Reducer.Linker<mUE, qUE, oUE>,
|
||||
): oUE
|
||||
|
||||
public fun groupBy(vararg columns: IntermediateColumn<*, *, qUE>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface Union<out qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, fqUE : Any, lqUE : Any> : _Query.Constructor<Union<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): Union<qUE> =
|
||||
outQueries.selectUnion(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("first")
|
||||
public val first: _Selectable<fqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("last")
|
||||
public val last: _Selectable<lqUE>
|
||||
|
||||
public fun createSelectWithJoin(context: Scope<qUE, fqUE, lqUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, fqUE : Any, lqUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("fq")
|
||||
public val fq: _Selectable<fqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("lq")
|
||||
public val lq: _Selectable<lqUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("firstSubqueryParams")
|
||||
public val firstSubqueryParams: InputRow.WithRedirect<fqUE, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("lastSubqueryParams")
|
||||
public val lastSubqueryParams: InputRow.WithRedirect<lqUE, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> uniteColumns(first: Column<RT, DT, fqUE>, last: Column<RT, DT, lqUE>): IntermediateColumn<RT, DT, qUE>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.queries
|
||||
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.Column
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.table.Table
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.DatabaseType
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.QueryParam
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc._Selectable
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.runtime.InputRow
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.table.RowId
|
||||
|
||||
public interface UpdateQuery<out qUE : Any> : _Query<qUE> {
|
||||
public interface SingleRow<out qUE : Any> : UpdateQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any> : _Query.Constructor<SingleRow<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): SingleRow<qUE> =
|
||||
outQueries.updateSingleRow(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
public fun createUpdateSingleWithReturning(context: Scope<qUE, ttUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rowToUpdate")
|
||||
public val rowToUpdate: QueryParam<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithOldValue(dst: Column<RT, DT, ttUE>, src: Column<RT, DT, ttUE>)
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithParam(dst: Column<RT, DT, ttUE>, src: QueryParam<RT, DT, qUE>)
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnOldValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnNewValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, param: QueryParam<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
|
||||
public fun ifNoRowSkip()
|
||||
public fun ifNoRowJustReturn()
|
||||
public fun ifNoRowThrow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface FromSubquery<out qUE : Any> : UpdateQuery<qUE>, _Query.Params2Table<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any, sUE : Any> : _Query.Constructor<FromSubquery<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): FromSubquery<qUE> =
|
||||
outQueries.updateFromSubquery(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("selector")
|
||||
public val selector: _Selectable<sUE>
|
||||
|
||||
public fun createUpdateFromSubqueryWithReturning(context: Scope<qUE, ttUE, sUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("src")
|
||||
public val src: _Selectable<sUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
public fun <RT, DT : DatabaseType<RT>> queryParam(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("selectorParams")
|
||||
public val selectorParams: InputRow.WithRedirect<sUE, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("_getSelectorColumn")
|
||||
@set:JvmName("selectorColumn")
|
||||
public var selectorColumn: Column<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>, sUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithSubquery(dst: Column<RT, DT, ttUE>, src: Column<RT, DT, sUE>)
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithOldValue(dst: Column<RT, DT, ttUE>, src: Column<RT, DT, ttUE>)
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithParam(dst: Column<RT, DT, ttUE>, src: QueryParam<RT, DT, qUE>)
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> returnFromSubquery(name: String, column: Column<RT, DT, sUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnOldValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnNewValue(name: String, column: Column<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
public fun <RT, DT : DatabaseType<RT>> returnParam(name: String, param: QueryParam<RT, DT, ttUE>): Column<RT, DT, qUE>
|
||||
|
||||
public fun ifNoRowSkip()
|
||||
public fun ifNoRowJustReturn()
|
||||
public fun ifNoRowThrow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface MultipleRows<out qUE : Any> : UpdateQuery<qUE>, _Query.Table2Void<qUE> {
|
||||
public interface Constructor<qUE : Any, ttUE : Any> : _Query.Constructor<MultipleRows<qUE>> {
|
||||
override fun createQuery(internalQueries: _Query.Constructor.Scope, outQueries: _Query.Constructor.Scope): MultipleRows<qUE> =
|
||||
outQueries.updateMultipleRows(this)
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("targetTable")
|
||||
public val targetTable: Table<ttUE, *>
|
||||
public fun createUpdateMultipleRows(context: Scope<qUE, ttUE>): qUE
|
||||
|
||||
public interface Scope<qUE : Any, ttUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("tt")
|
||||
public val tt: Table<ttUE, *>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("types")
|
||||
public val types: DatabaseType.Provider
|
||||
public fun <RT, DT : DatabaseType<RT>> inputColumn(name: String, type: DT): QueryParam<RT, DT, qUE>
|
||||
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rowToUpdate")
|
||||
public val rowToUpdate: QueryParam<RowId<ttUE>, DatabaseType.ROW_ID<ttUE>, qUE>
|
||||
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithOldValue(dst: Column<RT, DT, ttUE>, src: Column<RT, DT, ttUE>)
|
||||
public fun <RT, DT : DatabaseType<RT>> updateColumnWithParam(dst: Column<RT, DT, ttUE>, src: QueryParam<RT, DT, qUE>)
|
||||
|
||||
public fun ifNoRowSkip()
|
||||
public fun ifNoRowThrow()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.queries
|
||||
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc._Selectable
|
||||
|
||||
|
||||
@Suppress("ClassName")
|
||||
public interface _Query<out qUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("uExt")
|
||||
public val uExt: qUE
|
||||
|
||||
public interface Table2Void<out qUE : Any> : _Query<qUE>
|
||||
public interface Params2Void<out qUE : Any> : _Query<qUE>
|
||||
public interface Params2Table<out qUE : Any> : _Query<qUE>, _Selectable<qUE>
|
||||
public interface Void2Table<out qUE : Any> : _Query<qUE>, _Selectable<qUE>
|
||||
|
||||
public interface Constructor<R> {
|
||||
public fun createQuery(internalQueries: Scope, outQueries: Scope): R
|
||||
|
||||
public interface _SelectsScope {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@JvmName("_composite")
|
||||
public operator fun <R> invoke(constructor: Constructor<R>): R
|
||||
|
||||
public fun <qUE : Any, sqUE : Any> select(constructor: SelectQuery.Simple.Constructor<qUE, sqUE>): SelectQuery.Simple<qUE>
|
||||
public fun <qUE : Any, lUE : Any, rUE : Any> selectWithJoin(constructor: SelectQuery.WithJoin.Constructor<qUE, lUE, rUE>): SelectQuery.WithJoin<qUE>
|
||||
public fun <qUE : Any, sqUE : Any> selectReducing(constructor: SelectQuery.Reducing.Constructor<qUE, sqUE>): SelectQuery.Reducing<qUE>
|
||||
public fun <qUE : Any, sqUE : Any> selectFolding(constructor: SelectQuery.Folding.Constructor<qUE, sqUE>): SelectQuery.Folding<qUE>
|
||||
public fun <qUE : Any, fqUE : Any, lqUE : Any> selectUnion(constructor: SelectQuery.Union.Constructor<qUE, fqUE, lqUE>): SelectQuery.Union<qUE>
|
||||
}
|
||||
|
||||
public interface Scope : _SelectsScope {
|
||||
public fun <qUE : Any, ttUE : Any> insertSingleRow(constructor: InsertQuery.SingleRow.Constructor<qUE, ttUE>): InsertQuery.SingleRow<qUE>
|
||||
public fun <qUE : Any, ttUE : Any, sUE : Any> insertFromSubquery(constructor: InsertQuery.FromSubquery.Constructor<qUE, ttUE, sUE>): InsertQuery.FromSubquery<qUE>
|
||||
public fun <qUE : Any, ttUE : Any> insertMultipleRows(constructor: InsertQuery.MultipleRows.Constructor<qUE, ttUE>): InsertQuery.MultipleRows<qUE>
|
||||
|
||||
public fun <qUE : Any, ttUE : Any> updateSingleRow(constructor: UpdateQuery.SingleRow.Constructor<qUE, ttUE>): UpdateQuery.SingleRow<qUE>
|
||||
public fun <qUE : Any, ttUE : Any, sUE : Any> updateFromSubquery(constructor: UpdateQuery.FromSubquery.Constructor<qUE, ttUE, sUE>): UpdateQuery.FromSubquery<qUE>
|
||||
public fun <qUE : Any, ttUE : Any> updateMultipleRows(constructor: UpdateQuery.MultipleRows.Constructor<qUE, ttUE>): UpdateQuery.MultipleRows<qUE>
|
||||
|
||||
public fun <qUE : Any, ttUE : Any> deleteSingleRow(constructor: DeleteQuery.SingleRow.Constructor<qUE, ttUE>): DeleteQuery.SingleRow<qUE>
|
||||
public fun <qUE : Any, ttUE : Any, sUE : Any> deleteFromSubquery(constructor: DeleteQuery.FromSubquery.Constructor<qUE, ttUE, sUE>): DeleteQuery.FromSubquery<qUE>
|
||||
public fun <qUE : Any, ttUE : Any> deleteMultipleRows(constructor: DeleteQuery.MultipleRows.Constructor<qUE, ttUE>): DeleteQuery.MultipleRows<qUE>
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.queries
|
||||
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc._Selectable
|
||||
|
||||
|
||||
@Suppress("ClassName")
|
||||
public interface _Statement<qUE : Any?> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("uExt")
|
||||
public val uExt: qUE
|
||||
|
||||
public interface Void2Void : _Statement<Nothing?> {
|
||||
override val uExt: Nothing?
|
||||
get() = null
|
||||
}
|
||||
|
||||
public interface Void2Row<qUE : Any> : _Statement<qUE>
|
||||
public interface Void2RowOrNull<qUE : Any> : _Statement<qUE>
|
||||
public interface Void2Table<qUE : Any> : _Statement<qUE>
|
||||
public interface Params2Void<qUE : Any> : _Statement<qUE>
|
||||
public interface Params2Row<qUE : Any> : _Statement<qUE>
|
||||
public interface Params2RowOrNull<qUE : Any> : _Statement<qUE>
|
||||
public interface Params2Table<qUE : Any> : _Statement<qUE>
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.raw
|
||||
|
||||
public interface DialectKey<
|
||||
RAW_STATEMENT,
|
||||
TYPE_SCOPE,
|
||||
TYPE_DESCRIPTOR ,
|
||||
GETTER_SCOPE,
|
||||
SETTER_SCOPE
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> {
|
||||
}
|
@ -1,5 +1,115 @@
|
||||
package ru.landgrafhomyak.db.sql_skeleton_0.api.raw
|
||||
|
||||
public interface DialectResolver<in K: DialectKey<*, *, *, *, *>, out R: Any> {
|
||||
public fun resolveSqlDialect(key: K): R?
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.misc.DatabaseType as _DatabaseType
|
||||
import ru.landgrafhomyak.db.sql_skeleton_0.api.queries.RawStatement as _RawQuery
|
||||
|
||||
public interface DialectResolver {
|
||||
public interface DatabaseType<RUNTIME_TYPE> {
|
||||
public suspend fun <
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<*, *, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _DatabaseType<RUNTIME_TYPE, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
|
||||
public interface RawQuery_Void2Void {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, *, *, *, *>
|
||||
): _RawQuery.Void2Void.Constructor<STATEMENT_SCOPE, RAW_STATEMENT>
|
||||
}
|
||||
|
||||
public interface RawQuery_Void2Row<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Void2Row.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
|
||||
public interface RawQuery_Void2RowOrNull<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Void2RowOrNull.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
|
||||
public interface RawQuery_Void2Table<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Void2Table.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
public interface RawQuery_Params2Void<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Params2Void.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
|
||||
public interface RawQuery_Params2Row<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Params2Row.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
public interface RawQuery_Params2RowOrNull<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Params2RowOrNull.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
|
||||
public interface RawQuery_Params2Table<out QUERY_USER_EXTENSION : Any> {
|
||||
public suspend fun <
|
||||
STATEMENT_SCOPE : Any?,
|
||||
RAW_STATEMENT : Any,
|
||||
TYPE_SCOPE : Any?,
|
||||
TYPE_DESCRIPTOR : Any,
|
||||
GETTER_SCOPE : Any,
|
||||
SETTER_SCOPE : Any
|
||||
> resolveDatabaseTypeByDialect(
|
||||
key: DialectKey<STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
): _RawQuery.Params2Table.Constructor<QUERY_USER_EXTENSION, STATEMENT_SCOPE, RAW_STATEMENT, TYPE_SCOPE, TYPE_DESCRIPTOR, GETTER_SCOPE, SETTER_SCOPE>
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user