Runtime expression builder
This commit is contained in:
parent
f0ffe331af
commit
28ccd490c1
@ -0,0 +1,41 @@
|
||||
package ru.landgrafhomyak.serdha.api.v0.misc
|
||||
|
||||
import ru.landgrafhomyak.serdha.api.v0.runtime.ParametersSetter
|
||||
import ru.landgrafhomyak.serdha.api.v0.runtime.Row
|
||||
|
||||
public interface RuntimeExpression<ExpressionUserExtension : Any> {
|
||||
public val userExtension: ExpressionUserExtension
|
||||
|
||||
public interface RuntimeExpressionInput<RT, DT : DatabaseType<RT>, ExpressionUserExtension : Any> : Column<RT, DT, ExpressionUserExtension>
|
||||
public interface RuntimeExpressionOutput<RT, DT : DatabaseType<RT>, ExpressionUserExtension : Any> : InputParam<RT, DT, ExpressionUserExtension>
|
||||
|
||||
public fun interface InputLinker<ExpressionUserExtension : Any, QueryUserExtension : Any> {
|
||||
public fun link(linker: Scope<ExpressionUserExtension, QueryUserExtension>)
|
||||
|
||||
public interface Scope<ExpressionUserExtension : Any, QueryUserExtension : Any> {
|
||||
public operator fun <RT, DT : DatabaseType<RT>> set(p: RuntimeExpressionInput<RT, DT, ExpressionUserExtension>, e: Expression<RT, DT, QueryUserExtension>)
|
||||
}
|
||||
}
|
||||
|
||||
public fun interface OutputLinker<ExpressionUserExtension : Any, QueryUserExtension : Any> {
|
||||
public fun link(linker: Scope<ExpressionUserExtension, QueryUserExtension>)
|
||||
|
||||
public interface Scope<ExpressionUserExtension : Any, QueryUserExtension : Any> {
|
||||
public operator fun <RT, DT : DatabaseType<RT>> get(p: RuntimeExpressionOutput<RT, DT, ExpressionUserExtension>): Expression<RT, DT, QueryUserExtension>
|
||||
}
|
||||
}
|
||||
|
||||
public interface Creator<ExpressionUserExtension : Any> {
|
||||
public fun createExpression(creator: Scope<ExpressionUserExtension>): ExpressionUserExtension
|
||||
|
||||
public interface Scope<ExpressionUserExtension : Any> {
|
||||
public fun <RT, DT : DatabaseType<RT>> input(name: String, type: DT): RuntimeExpressionInput<RT, DT, ExpressionUserExtension>
|
||||
public fun <RT, DT : DatabaseType<RT>> output(name: String, type: DT): RuntimeExpressionOutput<RT, DT, ExpressionUserExtension>
|
||||
public var action: Action<ExpressionUserExtension>
|
||||
}
|
||||
}
|
||||
|
||||
public interface Action<ExpressionUserExtension : Any> {
|
||||
public fun calculate(input: Row<ExpressionUserExtension>, output: ParametersSetter<ExpressionUserExtension>)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user