Table of Contents

Method QueryAsync

Namespace
Qavren.Edge.Sqlite
Assembly
Qavren.Edge.Sqlite.dll

QueryAsync<T>(SqliteConnection, string, Func<SqliteDataReader, T>, IEnumerable<SqliteParameter>?, CancellationToken)

Runs sql and projects every row through map.

public static Task<IReadOnlyList<T>> QueryAsync<T>(this SqliteConnection connection, string sql, Func<SqliteDataReader, T> map, IEnumerable<SqliteParameter>? parameters = null, CancellationToken cancellationToken = default)

Parameters

connection SqliteConnection

The open connection to run the command on.

sql string

The SQL text to execute.

map Func<SqliteDataReader, T>

Projects each read row to a T.

parameters IEnumerable<SqliteParameter>

Parameters to bind, or null for none.

cancellationToken CancellationToken

Cancels the command.

Returns

Task<IReadOnlyList<T>>

Every row, in cursor order.

Type Parameters

T

Exceptions

ArgumentNullException

connection or map is null.

ArgumentException

sql is null, empty, or whitespace.