Common way to declare parameters and columns in raw statements

This commit is contained in:
Andrew Golovashevich 2025-05-19 20:04:54 +03:00
parent 33acc115fb
commit 35a668ad37
2 changed files with 36 additions and 7 deletions

View File

@ -28,7 +28,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Void2Row<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Void2Row<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.Output<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_void2row(scope: Scope<USER_EXTENSION>)
@ -48,7 +50,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Void2RowOrNull<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Void2RowOrNull<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.Output<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_void2rowOrNull(scope: Scope<USER_EXTENSION>)
@ -69,7 +73,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Void2Table<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Void2Table<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.Output<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_void2table(selector: Selector<USER_EXTENSION>)
@ -89,7 +95,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Params2Void<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Params2Void<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.Input<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_params2void(scope: Scope<USER_EXTENSION>)
@ -109,7 +117,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Params2Row<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Params2Row<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.InputOutput<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_params2row(scope: Scope<USER_EXTENSION>)
@ -129,7 +139,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Params2RowOrNull<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Params2RowOrNull<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.InputOutput<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_params2rowOrNull(scope: Scope<USER_EXTENSION>)
@ -149,7 +161,9 @@ public interface RawStatement<sUE : Any?, IK : Any> : _Statement<sUE, IK> {
public interface Params2Table<sUE : Any, IK : Any> : RawStatement<sUE, IK>, _Statement.Params2Table<sUE, IK> {
override val uExt: sUE
public interface Constructor<@Suppress("unused") sUE : Any>
public interface Constructor<sUE : Any> {
public fun declareIO(scope: StatementIODeclarationScope.InputOutput<sUE>): sUE
}
public interface ImplementationsProvider<USER_EXTENSION : Any> {
public fun provideStatementImplementations_params2table(scope: Scope<USER_EXTENSION>)

View File

@ -0,0 +1,15 @@
package ru.landgrafhomyak.db.skeleton1.api.statement
import ru.landgrafhomyak.db.skeleton1.api.DatabaseType
public interface StatementIODeclarationScope<@Suppress("unused") sUE : Any, @Suppress("unused") IK : Any> {
public interface Input<sUE : Any, IK : Any> : StatementIODeclarationScope<sUE, IK> {
public fun <RT> inputParam(type: DatabaseType.ImplementationsProvider<RT>): InputParam<RT, sUE, IK>
}
public interface Output<sUE : Any, IK : Any> : StatementIODeclarationScope<sUE, IK> {
public fun <RT> outputColumn(type: DatabaseType.ImplementationsProvider<RT>): OutputColumn<RT, sUE, IK>
}
public interface InputOutput<sUE : Any, IK : Any> : StatementIODeclarationScope<sUE, IK>, Input<sUE, IK>, Output<sUE, IK>
}