← Back to Stormify Documentation

Sp

sealed class Sp

Stored-procedure parameter. The three modes (IN / OUT / INOUT) are distinct subclasses so each carries exactly the API it needs:

  • In — sends a value to the procedure. No post-execute state.

  • Out — receives a typed value from the procedure; exposes Out.value.

  • InOut — sends a value and receives a (possibly modified) typed value back.

Parameters are designed to be held as references at the call site so the caller can read the post-execute values directly without tracking positional indices or parameter names:

val count = spOut<Int>()
val msg = spOut<String>()
stormify.procedure("tally", 42, count, msg)
println("${count.value}, ${msg.value}") // Int?, String? — fully typed

From Java, use the companion factories that accept Class<T>:

Sp.Out<Integer> count = Sp.outParam(Integer.class);
Sp.Out<String> msg = Sp.outParam(String.class);
stormify.procedure("tally", 42, count, msg);
Integer v = count.getValue();

Raw non-Sp arguments passed to procedure(...) are automatically wrapped as In parameters, so the common case needs no factory calls:

stormify.procedure("greet", "hello", 42, outRef)  // two IN + one OUT

Inheritors

Types

Link copied to clipboard
object Companion

Factory entry points for stored-procedure parameters.

Link copied to clipboard
class In(val value: Any?) : Sp

IN parameter. The value is sent to the procedure as-is.

Link copied to clipboard
class InOut<T : Any>(val type: KClass<T>, val input: T) : Sp

INOUT parameter. The input value is sent to the procedure. After the call returns, value holds whatever the procedure left there (which may differ from input).

Link copied to clipboard
class Out<T : Any>(val type: KClass<T>) : Sp

OUT parameter. After procedure(...) returns, value holds the typed value produced by the procedure, or null if it was not populated.