Skip to content

StatementParameters

extension type StatementParameters(IList<Object?>)

Wrapper type for parameters that can be applied to a statement that has parameter bindings.

Constructors

StatementParameters()

StatementParameters(IList<Object?> _parameters)

Properties

toList no setter

List<Object?> get toList

Converts the parameters to a mutable List for use with database drivers that require one.

Implementation
dart
List<Object?> get toList => _parameters.toList();

Methods

concat()

Concatenates this instance with other, appending all of its parameters after the current ones.

Implementation
dart
StatementParameters concat(StatementParameters other) =>
    StatementParameters(_parameters.concat(other._parameters));

setParameter()

StatementParameters setParameter<A>(int n, A value)

Returns a new StatementParameters with value set at position n.

The parameter list is automatically padded with null values if n is beyond the current length.

Implementation
dart
StatementParameters setParameter<A>(int n, A value) =>
    StatementParameters(_parameters.padTo(n + 1, null).updated(n, value));

Static Methods

empty()

Creates an empty StatementParameters with no bound values.

Implementation
dart
static StatementParameters empty() => StatementParameters(nil());