Class SqlParameterCollector

Assembly: redb.Core.Pro.dll

Parameter collector for safe SQL query generation.
Prevents SQL injection, enables PostgreSQL/MSSQL query plan caching.
Database-agnostic: uses ISqlDialect for parameter formatting.

public class SqlParameterCollector

Inheritance

ObjectSqlParameterCollector

Properties

Count

Number of added parameters.

public int Count { get; }

Methods

AddParameter(object?)

Adds parameter and returns placeholder via dialect.

public string AddParameter(object? value)

AddParameterWithOffset(object?, int)

Adds parameter with specified index offset.

public string AddParameterWithOffset(object? value, int offset)

GetDebugComment()

Generates debug comment with parameters (like EF Core).

public string GetDebugComment()

SetSchemeId(long)

Sets SchemeId for debug output.

public void SetSchemeId(long schemeId)

ToArray()

Returns parameter array for FromSqlRaw/SqlQueryRaw.

public object?[] ToArray()

Constructors