Skip to main content

Definition

Assembly: CloudNimble.BlazorEssentials.TursoDb.dll Namespace: CloudNimble.BlazorEssentials.TursoDb Inheritance: System.Object

Syntax

CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement<TResult>

Summary

Represents a prepared SQL statement that can be executed multiple times with different parameters for improved performance.

Type Parameters

  • TResult - The type of result returned by queries.

Examples

var statement = Database.Prepare&lt;User&gt;("SELECT * FROM users WHERE age &gt; ?");
var youngUsers = await statement.QueryAsync(18);
var olderUsers = await statement.QueryAsync(65);

Constructors

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Sql

Gets the SQL statement.

Syntax

public string Sql { get; }

Property Value

Type: string

StatementId

Gets the unique identifier for this prepared statement.

Syntax

public string StatementId { get; }

Property Value

Type: string

Methods

DisposeAsync

Syntax

public System.Threading.Tasks.ValueTask DisposeAsync()

Returns

Type: System.Threading.Tasks.ValueTask

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

QueryAsync

Executes the prepared statement as a query and returns all matching rows.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> QueryAsync(params object[] parameters)

Parameters

NameTypeDescription
parametersobject?[]The parameters for the statement.

Returns

Type: System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> A list of matching results.

QuerySingleAsync

Executes the prepared statement as a query and returns the first matching row or null.

Syntax

public System.Threading.Tasks.Task<TResult> QuerySingleAsync(params object[] parameters)

Parameters

NameTypeDescription
parametersobject?[]The parameters for the statement.

Returns

Type: System.Threading.Tasks.Task<TResult?> The first matching result or null.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?
  • System.IAsyncDisposable