Renaming '*Creator' -> '*Constructor'
This commit is contained in:
parent
3673235beb
commit
dd18416f70
@ -1,10 +1,10 @@
|
|||||||
package ru.landgrafhomyak.db.serdha0.api.module
|
package ru.landgrafhomyak.db.serdha0.api.module
|
||||||
|
|
||||||
import ru.landgrafhomyak.db.serdha0.api.table.Table
|
import ru.landgrafhomyak.db.serdha0.api.table.Table
|
||||||
import ru.landgrafhomyak.db.serdha0.api.queries.QueryCreator
|
import ru.landgrafhomyak.db.serdha0.api.queries.QueryConstructor
|
||||||
import ru.landgrafhomyak.db.serdha0.api.runtime.SynchronizedDatabase
|
import ru.landgrafhomyak.db.serdha0.api.runtime.SynchronizedDatabase
|
||||||
import ru.landgrafhomyak.db.serdha0.api.runtime.Transaction
|
import ru.landgrafhomyak.db.serdha0.api.runtime.Transaction
|
||||||
import ru.landgrafhomyak.db.serdha0.api.table.CreateTableScope
|
import ru.landgrafhomyak.db.serdha0.api.table.TableConstructor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope methods for creating new [module template][ModuleTemplate].
|
* Scope methods for creating new [module template][ModuleTemplate].
|
||||||
@ -13,32 +13,7 @@ import ru.landgrafhomyak.db.serdha0.api.table.CreateTableScope
|
|||||||
* @see ModuleTemplate.ModuleCreator.createSchema
|
* @see ModuleTemplate.ModuleCreator.createSchema
|
||||||
*/
|
*/
|
||||||
public interface CreateModuleScope {
|
public interface CreateModuleScope {
|
||||||
/**
|
|
||||||
* Functional interface for creating table.
|
|
||||||
*
|
|
||||||
* Can be implemented like a companion object that just calls [TableUserExtension]'s constructor with the same or similar signature.
|
|
||||||
*
|
|
||||||
* @param TableUserExtension User's type for containing table-related descriptors.
|
|
||||||
*
|
|
||||||
* @see CreateModuleScope.createTable
|
|
||||||
* @see CreateModuleScope.createSessionScopeTemporaryTable
|
|
||||||
* @see CreateModuleScope.createTransactionScopeTemporaryTable
|
|
||||||
* @see UpgradeModuleScope.TableUpgrade
|
|
||||||
*/
|
|
||||||
public interface TableCreator<TableUserExtension : Any> {
|
|
||||||
/**
|
|
||||||
* Scope method that uses [creator] to initialize table schema.
|
|
||||||
*
|
|
||||||
* @param creator Object with descriptor providers and factories.
|
|
||||||
* @return User's object with descriptors for future access.
|
|
||||||
*
|
|
||||||
* @see CreateModuleScope.createTable
|
|
||||||
* @see CreateModuleScope.createSessionScopeTemporaryTable
|
|
||||||
* @see CreateModuleScope.createTransactionScopeTemporaryTable
|
|
||||||
* @see UpgradeModuleScope.TableUpgrade
|
|
||||||
*/
|
|
||||||
public fun createTable(creator: CreateTableScope<TableUserExtension>): TableUserExtension
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates table in [specified namespace][namespace] with [specified name][name] and stores it in the database.
|
* Creates table in [specified namespace][namespace] with [specified name][name] and stores it in the database.
|
||||||
@ -52,7 +27,7 @@ public interface CreateModuleScope {
|
|||||||
* @param initializer Table-related descriptors initializer.
|
* @param initializer Table-related descriptors initializer.
|
||||||
* @return Table descriptor.
|
* @return Table descriptor.
|
||||||
*/
|
*/
|
||||||
public fun <TableUserExtension : Any> createTable(namespace: Namespace, name: String, initializer: TableCreator<TableUserExtension>): Table<TableUserExtension, Nothing>
|
public fun <TableUserExtension : Any> createTable(namespace: Namespace, name: String, initializer: TableConstructor<TableUserExtension>): Table<TableUserExtension, Nothing>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a temporary table that exits only until connection to the database not [closed][SynchronizedDatabase._close].
|
* Creates a temporary table that exits only until connection to the database not [closed][SynchronizedDatabase._close].
|
||||||
@ -65,7 +40,7 @@ public interface CreateModuleScope {
|
|||||||
* @param initializer Table-related descriptors initializer.
|
* @param initializer Table-related descriptors initializer.
|
||||||
* @return Table descriptor.
|
* @return Table descriptor.
|
||||||
*/
|
*/
|
||||||
public fun <TableUserExtension : Any> createSessionScopeTemporaryTable(namespace: Namespace, name: String, initializer: TableCreator<TableUserExtension>): Table<TableUserExtension, Nothing>
|
public fun <TableUserExtension : Any> createSessionScopeTemporaryTable(namespace: Namespace, name: String, initializer: TableConstructor<TableUserExtension>): Table<TableUserExtension, Nothing>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a temporary table that exits only inside [transaction][Transaction] and auto-deleted (or cleared, depends on driver implementation) when it [finished][Transaction._assertTransactionFinishedAndReleaseResources].
|
* Creates a temporary table that exits only inside [transaction][Transaction] and auto-deleted (or cleared, depends on driver implementation) when it [finished][Transaction._assertTransactionFinishedAndReleaseResources].
|
||||||
@ -78,17 +53,17 @@ public interface CreateModuleScope {
|
|||||||
* @param initializer Table-related descriptors initializer.
|
* @param initializer Table-related descriptors initializer.
|
||||||
* @return Table descriptor.
|
* @return Table descriptor.
|
||||||
*/
|
*/
|
||||||
public fun <TableUserExtension : Any> createTransactionScopeTemporaryTable(namespace: Namespace, name: String, initializer: TableCreator<TableUserExtension>): Table<TableUserExtension, Nothing>
|
public fun <TableUserExtension : Any> createTransactionScopeTemporaryTable(namespace: Namespace, name: String, initializer: TableConstructor<TableUserExtension>): Table<TableUserExtension, Nothing>
|
||||||
|
|
||||||
public val queries: QueryCreator.Scope
|
public val queries: QueryConstructor.Scope
|
||||||
|
|
||||||
public val temporarySubqueries: QueryCreator.Scope
|
public val temporarySubqueries: QueryConstructor.Scope
|
||||||
|
|
||||||
public val moduleConfiguringTemporaryQueries: QueryCreator.Scope
|
public val moduleConfiguringTemporaryQueries: QueryConstructor.Scope
|
||||||
|
|
||||||
public fun <qUE : Any> createQuery(creator: QueryCreator<qUE>): qUE
|
public fun <qUE : Any> createQuery(creator: QueryConstructor<qUE>): qUE
|
||||||
|
|
||||||
public fun <qUE : Any> createModuleConfiguringTemporaryQuery(creator: QueryCreator<qUE>): qUE
|
public fun <qUE : Any> createModuleConfiguringTemporaryQuery(creator: QueryConstructor<qUE>): qUE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces [specified namespace][rootNs] with schema provided by [template].
|
* Replaces [specified namespace][rootNs] with schema provided by [template].
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package ru.landgrafhomyak.db.serdha0.api.module
|
package ru.landgrafhomyak.db.serdha0.api.module
|
||||||
|
|
||||||
import ru.landgrafhomyak.db.serdha0.api.table.Table
|
import ru.landgrafhomyak.db.serdha0.api.table.Table
|
||||||
|
import ru.landgrafhomyak.db.serdha0.api.table.TableConstructor
|
||||||
import ru.landgrafhomyak.db.serdha0.api.table.UpdateTableScope
|
import ru.landgrafhomyak.db.serdha0.api.table.UpdateTableScope
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,7 +136,7 @@ public interface UpgradeModuleScope : CreateModuleScope {
|
|||||||
* @see CreateModuleScope.createSessionScopeTemporaryTable
|
* @see CreateModuleScope.createSessionScopeTemporaryTable
|
||||||
* @see CreateModuleScope.createTransactionScopeTemporaryTable
|
* @see CreateModuleScope.createTransactionScopeTemporaryTable
|
||||||
*/
|
*/
|
||||||
public fun <TableUserExtension : Any> createModuleUpgradeScopeTemporaryTable(namespace: Namespace, name: String, initializer: CreateModuleScope.TableCreator<TableUserExtension>): Table<TableUserExtension, Nothing>
|
public fun <TableUserExtension : Any> createModuleUpgradeScopeTemporaryTable(namespace: Namespace, name: String, initializer: TableConstructor<TableUserExtension>): Table<TableUserExtension, Nothing>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,10 +10,10 @@ import ru.landgrafhomyak.db.serdha0.api.table.Table
|
|||||||
|
|
||||||
public interface DeleteQuery<qUE : Any> : _Query<qUE> {
|
public interface DeleteQuery<qUE : Any> : _Query<qUE> {
|
||||||
public interface SingleRow<qUE : Any> : DeleteQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface SingleRow<qUE : Any> : DeleteQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
|
|
||||||
public fun createDeleteSingleRowWithReturning(creator: Scope<qUE, ttUE>): qUE
|
public fun createDeleteSingleRowWithReturning(context: Scope<qUE, ttUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any> {
|
public interface Scope<qUE : Any, ttUE : Any> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
@ -34,11 +34,11 @@ public interface DeleteQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface FromSubquery<qUE : Any> : DeleteQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface FromSubquery<qUE : Any> : DeleteQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any, sUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any, sUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
public val selector: _Selectable<sUE>
|
public val selector: _Selectable<sUE>
|
||||||
|
|
||||||
public fun createDeleteFromSubqueryWithReturning(creator: Scope<qUE, ttUE, sUE>): qUE
|
public fun createDeleteFromSubqueryWithReturning(context: Scope<qUE, ttUE, sUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> {
|
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
@ -62,10 +62,10 @@ public interface DeleteQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface MultipleRows<qUE : Any> : DeleteQuery<qUE>, _Query.Table2Void<qUE> {
|
public interface MultipleRows<qUE : Any> : DeleteQuery<qUE>, _Query.Table2Void<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
|
|
||||||
public fun createMultipleRows(creator: Scope<qUE, ttUE>): qUE
|
public fun createMultipleRows(context: Scope<qUE, ttUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any> {
|
public interface Scope<qUE : Any, ttUE : Any> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
|
@ -28,10 +28,10 @@ public interface InsertQuery<qUE : Any> : _Query<qUE> {
|
|||||||
|
|
||||||
|
|
||||||
public interface SingleRow<qUE : Any> : InsertQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface SingleRow<qUE : Any> : InsertQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
|
|
||||||
public fun createInsertSingleRowWithReturning(creator: Scope<qUE, ttUE>): qUE
|
public fun createInsertSingleRowWithReturning(context: Scope<qUE, ttUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
public interface Scope<qUE : Any, ttUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
@ -50,11 +50,11 @@ public interface InsertQuery<qUE : Any> : _Query<qUE> {
|
|||||||
|
|
||||||
|
|
||||||
public interface FromSubquery<qUE : Any> : InsertQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface FromSubquery<qUE : Any> : InsertQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any, sUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any, sUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
public val selector: _Selectable<sUE>
|
public val selector: _Selectable<sUE>
|
||||||
|
|
||||||
public fun createInsertSingleRowWithReturning(creator: Scope<qUE, ttUE, sUE>): qUE
|
public fun createInsertSingleRowWithReturning(context: Scope<qUE, ttUE, sUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
@ -77,9 +77,9 @@ public interface InsertQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface MultipleRows<qUE : Any> : InsertQuery<qUE>, _Query.Table2Void<qUE> {
|
public interface MultipleRows<qUE : Any> : InsertQuery<qUE>, _Query.Table2Void<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
public fun createInsertMultipleRows(creator: Scope<qUE, ttUE>): qUE
|
public fun createInsertMultipleRows(context: Scope<qUE, ttUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
public interface Scope<qUE : Any, ttUE : Any> : _CommonInsertCreatorScope<qUE, ttUE> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
|
@ -3,23 +3,23 @@ package ru.landgrafhomyak.db.serdha0.api.queries
|
|||||||
import ru.landgrafhomyak.db.serdha0.api.misc._Selectable
|
import ru.landgrafhomyak.db.serdha0.api.misc._Selectable
|
||||||
import ru.landgrafhomyak.db.serdha0.api.table.Table
|
import ru.landgrafhomyak.db.serdha0.api.table.Table
|
||||||
|
|
||||||
public interface QueryCreator<qUE : Any> {
|
public interface QueryConstructor<qUE : Any> {
|
||||||
public fun createQuery(internalQueries: Scope, outQueries: Scope): qUE
|
public fun createQuery(internalQueries: Scope, outQueries: Scope): qUE
|
||||||
|
|
||||||
public interface Scope {
|
public interface Scope {
|
||||||
public fun <qUE : Any, tUE : Any> deleteSingleRow(table: Table<tUE, *>, creator: DeleteQuery.SingleRow.Creator<qUE, tUE>): DeleteQuery.SingleRow<qUE>
|
public fun <qUE : Any, tUE : Any> deleteSingleRow(table: Table<tUE, *>, creator: DeleteQuery.SingleRow.Constructor<qUE, tUE>): DeleteQuery.SingleRow<qUE>
|
||||||
public fun <qUE : Any, tUE : Any, sUE : Any> deleteFromSubquery(table: Table<tUE, *>, selector: _Selectable<sUE>, creator: DeleteQuery.FromSubquery.Creator<qUE, tUE, sUE>): DeleteQuery.FromSubquery<qUE>
|
public fun <qUE : Any, tUE : Any, sUE : Any> deleteFromSubquery(table: Table<tUE, *>, selector: _Selectable<sUE>, creator: DeleteQuery.FromSubquery.Constructor<qUE, tUE, sUE>): DeleteQuery.FromSubquery<qUE>
|
||||||
public fun <qUE : Any, tUE : Any> deleteMultipleRows(table: Table<tUE, *>, creator: DeleteQuery.MultipleRows.Creator<qUE, tUE>): DeleteQuery.MultipleRows<qUE>
|
public fun <qUE : Any, tUE : Any> deleteMultipleRows(table: Table<tUE, *>, creator: DeleteQuery.MultipleRows.Constructor<qUE, tUE>): DeleteQuery.MultipleRows<qUE>
|
||||||
|
|
||||||
public fun <qUE : Any, tUE : Any> insertSingleRow(table: Table<tUE, *>, creator: InsertQuery.SingleRow.Creator<qUE, tUE>): InsertQuery.SingleRow<qUE>
|
public fun <qUE : Any, tUE : Any> insertSingleRow(table: Table<tUE, *>, creator: InsertQuery.SingleRow.Constructor<qUE, tUE>): InsertQuery.SingleRow<qUE>
|
||||||
public fun <qUE : Any, tUE : Any, sUE : Any> insertFromSubquery(table: Table<tUE, *>, selector: _Selectable<sUE>, creator: InsertQuery.FromSubquery.Creator<qUE, tUE, sUE>): InsertQuery.FromSubquery<qUE>
|
public fun <qUE : Any, tUE : Any, sUE : Any> insertFromSubquery(table: Table<tUE, *>, selector: _Selectable<sUE>, creator: InsertQuery.FromSubquery.Constructor<qUE, tUE, sUE>): InsertQuery.FromSubquery<qUE>
|
||||||
public fun <qUE : Any, tUE : Any> insertMultipleRows(table: Table<tUE, *>, creator: InsertQuery.MultipleRows.Creator<qUE, tUE>): InsertQuery.MultipleRows<qUE>
|
public fun <qUE : Any, tUE : Any> insertMultipleRows(table: Table<tUE, *>, creator: InsertQuery.MultipleRows.Constructor<qUE, tUE>): InsertQuery.MultipleRows<qUE>
|
||||||
|
|
||||||
public fun <qUE : Any, tUE : Any> select(table: _Selectable<tUE>, creator: SelectQuery.FromTable.Creator<qUE, tUE>): SelectQuery.FromTable<qUE>
|
public fun <qUE : Any, tUE : Any> select(table: _Selectable<tUE>, creator: SelectQuery.FromTable.Constructor<qUE, tUE>): SelectQuery.FromTable<qUE>
|
||||||
public fun <qUE : Any, lUE : Any, rUE : Any> selectWithJoin(left: _Selectable<lUE>, right: _Selectable<rUE>, creator: SelectQuery.WithJoin.Creator<qUE, lUE, rUE>): SelectQuery.WithJoin<qUE>
|
public fun <qUE : Any, lUE : Any, rUE : Any> selectWithJoin(left: _Selectable<lUE>, right: _Selectable<rUE>, creator: SelectQuery.WithJoin.Constructor<qUE, lUE, rUE>): SelectQuery.WithJoin<qUE>
|
||||||
|
|
||||||
public fun <qUE : Any, tUE : Any> updateSingleRow(table: Table<tUE, *>, creator: UpdateQuery.SingleRow.Creator<qUE, tUE>): UpdateQuery.SingleRow<qUE>
|
public fun <qUE : Any, tUE : Any> updateSingleRow(table: Table<tUE, *>, creator: UpdateQuery.SingleRow.Constructor<qUE, tUE>): UpdateQuery.SingleRow<qUE>
|
||||||
public fun <qUE : Any, tUE : Any, sUE : Any> updateFromSubquery(table: Table<tUE, *>, selector: _Selectable<sUE>, creator: UpdateQuery.FromSubquery.Creator<qUE, tUE, sUE>): UpdateQuery.FromSubquery<qUE>
|
public fun <qUE : Any, tUE : Any, sUE : Any> updateFromSubquery(table: Table<tUE, *>, selector: _Selectable<sUE>, creator: UpdateQuery.FromSubquery.Constructor<qUE, tUE, sUE>): UpdateQuery.FromSubquery<qUE>
|
||||||
public fun <qUE : Any, tUE : Any> updateMultipleRows(table: Table<tUE, *>, creator: UpdateQuery.MultipleRows.Creator<qUE, tUE>): UpdateQuery.MultipleRows<qUE>
|
public fun <qUE : Any, tUE : Any> updateMultipleRows(table: Table<tUE, *>, creator: UpdateQuery.MultipleRows.Constructor<qUE, tUE>): UpdateQuery.MultipleRows<qUE>
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -52,14 +52,14 @@ public interface SelectQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface WithJoin<qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface WithJoin<qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, lsqUE : Any, rsqUE : Any> : _CommonSelectCreatorScope<qUE> {
|
public interface Constructor<qUE : Any, lsqUE : Any, rsqUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||||
public val left: _Selectable<lsqUE>
|
public val left: _Selectable<lsqUE>
|
||||||
public val right: _Selectable<rsqUE>
|
public val right: _Selectable<rsqUE>
|
||||||
public val joinType: JoinType
|
public val joinType: JoinType
|
||||||
public val referenceColumn: Column<*, *, lsqUE>
|
public val referenceColumn: Column<*, *, lsqUE>
|
||||||
public val targetColumn: Column<*, *, rsqUE>
|
public val targetColumn: Column<*, *, rsqUE>
|
||||||
|
|
||||||
public fun createSelectWithJoin(creator: Scope<qUE, lsqUE, rsqUE>): qUE
|
public fun createSelectWithJoin(context: Scope<qUE, lsqUE, rsqUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, lsqUE : Any, rsqUE : Any> {
|
public interface Scope<qUE : Any, lsqUE : Any, rsqUE : Any> {
|
||||||
public val lsqUExt: lsqUE
|
public val lsqUExt: lsqUE
|
||||||
@ -76,10 +76,10 @@ public interface SelectQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface FromTable<qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface FromTable<qUE : Any> : SelectQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, tUE : Any> {
|
public interface Constructor<qUE : Any, tUE : Any> {
|
||||||
public val table: _Selectable<tUE>
|
public val table: _Selectable<tUE>
|
||||||
|
|
||||||
public fun createSelect(creator: Scope<qUE, tUE>): qUE
|
public fun createSelect(context: Scope<qUE, tUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, tUE : Any> : _CommonSelectCreatorScope<qUE> {
|
public interface Scope<qUE : Any, tUE : Any> : _CommonSelectCreatorScope<qUE> {
|
||||||
public val tUExt: tUE
|
public val tUExt: tUE
|
||||||
|
@ -9,9 +9,9 @@ import ru.landgrafhomyak.db.serdha0.api.runtime.InputRow
|
|||||||
|
|
||||||
public interface UpdateQuery<qUE : Any> : _Query<qUE> {
|
public interface UpdateQuery<qUE : Any> : _Query<qUE> {
|
||||||
public interface SingleRow<qUE : Any> : UpdateQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface SingleRow<qUE : Any> : UpdateQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
public fun createUpdateSingleWithReturning(table: Table<ttUE, *>, creator: Scope<qUE, ttUE>): qUE
|
public fun createUpdateSingleWithReturning(context: Scope<qUE, ttUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any> {
|
public interface Scope<qUE : Any, ttUE : Any> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
@ -36,11 +36,11 @@ public interface UpdateQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface FromSubquery<qUE : Any> : UpdateQuery<qUE>, _Query.Params2Table<qUE> {
|
public interface FromSubquery<qUE : Any> : UpdateQuery<qUE>, _Query.Params2Table<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any, sUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any, sUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
public val selector: _Selectable<sUE>
|
public val selector: _Selectable<sUE>
|
||||||
|
|
||||||
public fun createUpdateFromSubqueryWithReturning(creator: Scope<qUE, ttUE, sUE>): qUE
|
public fun createUpdateFromSubqueryWithReturning(context: Scope<qUE, ttUE, sUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> {
|
public interface Scope<qUE : Any, ttUE : Any, sUE : Any> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
@ -69,9 +69,9 @@ public interface UpdateQuery<qUE : Any> : _Query<qUE> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface MultipleRows<qUE : Any> : UpdateQuery<qUE>, _Query.Table2Void<qUE> {
|
public interface MultipleRows<qUE : Any> : UpdateQuery<qUE>, _Query.Table2Void<qUE> {
|
||||||
public interface Creator<qUE : Any, ttUE : Any> {
|
public interface Constructor<qUE : Any, ttUE : Any> {
|
||||||
public val targetTable: Table<ttUE, *>
|
public val targetTable: Table<ttUE, *>
|
||||||
public fun createUpdateMultipleRows(creator: Scope<qUE, ttUE>): qUE
|
public fun createUpdateMultipleRows(context: Scope<qUE, ttUE>): qUE
|
||||||
|
|
||||||
public interface Scope<qUE : Any, ttUE : Any> {
|
public interface Scope<qUE : Any, ttUE : Any> {
|
||||||
public val tt: Table<ttUE, *>
|
public val tt: Table<ttUE, *>
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
package ru.landgrafhomyak.db.serdha0.api.table
|
|
||||||
|
|
||||||
import ru.landgrafhomyak.db.serdha0.api.misc.Column
|
|
||||||
import ru.landgrafhomyak.db.serdha0.api.misc.DatabaseType
|
|
||||||
|
|
||||||
public interface CreateTableScope<tUE : Any> {
|
|
||||||
public val types: DatabaseType.Provider
|
|
||||||
|
|
||||||
public fun <RT, DT : DatabaseType<RT>> column(name: String, type: DT): Column<RT, DT, tUE>
|
|
||||||
|
|
||||||
public fun index(name: String, vararg columns: Column<*, *, tUE>): Index<tUE>
|
|
||||||
|
|
||||||
public fun uniqueIndex(name: String, distinctNulls: Boolean, vararg columns: Column<*, *, tUE>): UniqueIndex<tUE>
|
|
||||||
public fun <cUE : Any> checkConstraint(name: String, creator: CheckConstraint.Creator<cUE, tUE>, recheckExistingRows: Boolean = false): CheckConstraint<tUE>
|
|
||||||
public fun <cUE : Any, RT : Any, DT : DatabaseType<RT>> defaultValue(c: Column<RT, DT, tUE>, creator: DefaultConstraint.Creator<cUE, RT, DT, tUE>): DefaultConstraint<tUE>
|
|
||||||
|
|
||||||
@Suppress("PropertyName")
|
|
||||||
public val rowId_column: Column<RowId<tUE>, DatabaseType<RowId<tUE>>, tUE>
|
|
||||||
|
|
||||||
@Suppress("PropertyName")
|
|
||||||
public val rowId_uniqueConstraint: UniqueIndex<tUE>
|
|
||||||
|
|
||||||
public fun <ttUE : Any> selfRowReference(
|
|
||||||
columnName: String,
|
|
||||||
onDelete: ForeignRowReference.OnDelete,
|
|
||||||
): ForeignRowReference<tUE, tUE, RowId<tUE>, DatabaseType.ROW_ID<tUE>>
|
|
||||||
|
|
||||||
public fun <ttUE : Any, RT, DT : DatabaseType<RT>> selfRowReference(
|
|
||||||
columnName: String,
|
|
||||||
type: DT,
|
|
||||||
onDelete: ForeignRowReference.OnDelete,
|
|
||||||
): ForeignRowReference<tUE, tUE, RT, DT>
|
|
||||||
|
|
||||||
public fun <ttUE : Any> foreignRowReference(
|
|
||||||
columnName: String,
|
|
||||||
toTable: Table<ttUE, *>,
|
|
||||||
onDelete: ForeignRowReference.OnDelete,
|
|
||||||
): ForeignRowReference<tUE, ttUE, RowId<ttUE>, DatabaseType.ROW_ID<ttUE>>
|
|
||||||
|
|
||||||
public fun <ttUE : Any, RT, DT : DatabaseType<RT>> foreignRowReference(
|
|
||||||
columnName: String,
|
|
||||||
type: DT,
|
|
||||||
toTable: Table<ttUE, *>,
|
|
||||||
onDelete: ForeignRowReference.OnDelete,
|
|
||||||
): ForeignRowReference<tUE, ttUE, RT, DT>
|
|
||||||
}
|
|
@ -0,0 +1,52 @@
|
|||||||
|
package ru.landgrafhomyak.db.serdha0.api.table
|
||||||
|
|
||||||
|
import ru.landgrafhomyak.db.serdha0.api.misc.Column
|
||||||
|
import ru.landgrafhomyak.db.serdha0.api.misc.DatabaseType
|
||||||
|
|
||||||
|
|
||||||
|
public interface TableConstructor<TableUserExtension : Any> {
|
||||||
|
public fun createTable(context: Scope<TableUserExtension>): TableUserExtension
|
||||||
|
|
||||||
|
|
||||||
|
public interface Scope<tUE : Any> {
|
||||||
|
public val types: DatabaseType.Provider
|
||||||
|
|
||||||
|
public fun <RT, DT : DatabaseType<RT>> column(name: String, type: DT): Column<RT, DT, tUE>
|
||||||
|
|
||||||
|
public fun index(name: String, vararg columns: Column<*, *, tUE>): Index<tUE>
|
||||||
|
|
||||||
|
public fun uniqueIndex(name: String, distinctNulls: Boolean, vararg columns: Column<*, *, tUE>): UniqueIndex<tUE>
|
||||||
|
public fun <cUE : Any> checkConstraint(name: String, creator: CheckConstraint.Creator<cUE, tUE>, recheckExistingRows: Boolean = false): CheckConstraint<tUE>
|
||||||
|
public fun <cUE : Any, RT : Any, DT : DatabaseType<RT>> defaultValue(c: Column<RT, DT, tUE>, creator: DefaultConstraint.Creator<cUE, RT, DT, tUE>): DefaultConstraint<tUE>
|
||||||
|
|
||||||
|
@Suppress("PropertyName")
|
||||||
|
public val rowId_column: Column<RowId<tUE>, DatabaseType<RowId<tUE>>, tUE>
|
||||||
|
|
||||||
|
@Suppress("PropertyName")
|
||||||
|
public val rowId_uniqueConstraint: UniqueIndex<tUE>
|
||||||
|
|
||||||
|
public fun selfRowReference(
|
||||||
|
columnName: String,
|
||||||
|
onDelete: ForeignRowReference.OnDelete,
|
||||||
|
): ForeignRowReference<tUE, tUE, RowId<tUE>, DatabaseType.ROW_ID<tUE>>
|
||||||
|
|
||||||
|
public fun <RT, DT : DatabaseType<RT>> selfRowReference(
|
||||||
|
columnName: String,
|
||||||
|
type: DT,
|
||||||
|
onDelete: ForeignRowReference.OnDelete,
|
||||||
|
): ForeignRowReference<tUE, tUE, RT, DT>
|
||||||
|
|
||||||
|
public fun <ttUE : Any> foreignRowReference(
|
||||||
|
columnName: String,
|
||||||
|
toTable: Table<ttUE, *>,
|
||||||
|
onDelete: ForeignRowReference.OnDelete,
|
||||||
|
): ForeignRowReference<tUE, ttUE, RowId<ttUE>, DatabaseType.ROW_ID<ttUE>>
|
||||||
|
|
||||||
|
public fun <ttUE : Any, RT, DT : DatabaseType<RT>> foreignRowReference(
|
||||||
|
columnName: String,
|
||||||
|
type: DT,
|
||||||
|
toTable: Table<ttUE, *>,
|
||||||
|
onDelete: ForeignRowReference.OnDelete,
|
||||||
|
): ForeignRowReference<tUE, ttUE, RT, DT>
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user