Table of Contents

Class SqlQueryReaderFactory

Namespace
LfrlAnvil.Sql.Statements.Compilers
Assembly
LfrlAnvil.Sql.Core.dll

Represents a factory of delegates used by query reader expression instances.

public class SqlQueryReaderFactory : ISqlQueryReaderFactory
Inheritance
SqlQueryReaderFactory
Implements
Derived
Inherited Members
Extension Methods

Properties

ColumnTypeDefinitions

Specifies ISqlColumnTypeDefinitionProvider instance attached to this factory.

public ISqlColumnTypeDefinitionProvider ColumnTypeDefinitions { get; }

Property Value

ISqlColumnTypeDefinitionProvider

DataReaderType

Specifies the DB data reader type.

public Type DataReaderType { get; }

Property Value

Type

Dialect

SQL dialect that this factory is associated with.

public SqlDialect Dialect { get; }

Property Value

SqlDialect

SupportsAsync

Specifies whether or not generic asynchronous query readers can be constructed by this factory.

public bool SupportsAsync { get; }

Property Value

bool

Methods

Create(SqlQueryReaderCreationOptions?)

Creates a new SqlQueryReader instance.

[Pure]
public SqlQueryReader Create(SqlQueryReaderCreationOptions? options = null)

Parameters

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlQueryReader

New SqlQueryReader instance.

CreateAsync(SqlQueryReaderCreationOptions?)

Creates a new SqlAsyncQueryReader instance.

[Pure]
public SqlAsyncQueryReader CreateAsync(SqlQueryReaderCreationOptions? options = null)

Parameters

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlAsyncQueryReader

New SqlAsyncQueryReader instance.

CreateAsyncExpression(Type, SqlQueryReaderCreationOptions?)

Creates a new SqlAsyncQueryReaderExpression instance.

[Pure]
public SqlAsyncQueryReaderExpression CreateAsyncExpression(Type rowType, SqlQueryReaderCreationOptions? options = null)

Parameters

rowType Type

Row type.

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlAsyncQueryReaderExpression

New SqlAsyncQueryReaderExpression instance.

Exceptions

SqlCompilerException

When rowType is not a valid row type or does not contain a valid constructor or does not contain any valid members or this factory does not support asynchronous expressions.

CreateAsyncScalar()

Creates a new SqlAsyncScalarQueryReader instance.

[Pure]
public SqlAsyncScalarQueryReader CreateAsyncScalar()

Returns

SqlAsyncScalarQueryReader

New SqlAsyncScalarQueryReader instance.

CreateAsyncScalarExpression(Type, bool)

Creates a new SqlAsyncScalarQueryReaderExpression instance.

[Pure]
public SqlAsyncScalarQueryReaderExpression CreateAsyncScalarExpression(Type resultType, bool isNullable = false)

Parameters

resultType Type

Value type.

isNullable bool

Specifies whether or not the result is nullable. Equal to false by default.

Returns

SqlAsyncScalarQueryReaderExpression

New SqlAsyncScalarQueryReaderExpression instance.

Exceptions

SqlCompilerException

When resultType is not a valid result type or this factory does not support asynchronous expressions.

CreateExpression(Type, SqlQueryReaderCreationOptions?)

Creates a new SqlQueryReaderExpression instance.

[Pure]
public SqlQueryReaderExpression CreateExpression(Type rowType, SqlQueryReaderCreationOptions? options = null)

Parameters

rowType Type

Row type.

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlQueryReaderExpression

New SqlQueryReaderExpression instance.

Exceptions

SqlCompilerException

When rowType is not a valid row type or does not contain a valid constructor or does not contain any valid members.

CreateScalar()

Creates a new SqlScalarQueryReader instance.

[Pure]
public SqlScalarQueryReader CreateScalar()

Returns

SqlScalarQueryReader

New SqlScalarQueryReader instance.

CreateScalarExpression(Type, bool)

Creates a new SqlScalarQueryReaderExpression instance.

[Pure]
public SqlScalarQueryReaderExpression CreateScalarExpression(Type resultType, bool isNullable = false)

Parameters

resultType Type

Value type.

isNullable bool

Specifies whether or not the result is nullable. Equal to false by default.

Returns

SqlScalarQueryReaderExpression

New SqlScalarQueryReaderExpression instance.

Exceptions

SqlCompilerException

When resultType is not a valid result type.