SQLQuery
classin packageklyn.data.sql
public final class SQLQuery<T>:
SQLQuery

Re-executable typed result of an explicit SQL query.

SQLQuery<T> is intentionally not Queryable<T>: raw SQL forms an explicit provider boundary and cannot be composed as KQL without materialization. T must be one of the entity types declared by the owning factory.

Example
rows = manager.sqlQuery<User>(
"select id, login from T_Users where id > ?",
SQLParameters(10)
).toList()
Properties
Modifier and Type Member Description
public readonly property sql
sql as String:
Explicit provider SQL text; bound values are not included.
Constructors
Modifier and Type Member Description
public SQLQuery
SQLQuery( session as SQLProviderSession, configuration as SQLConfiguration, mapping as SQLMappedEntity, tracker as SQLIdentityTracker, sql as String, parameters as SQLParameters, scope as PolicyScopeState = null ):
Creates a typed raw SQL query bound to one manager session.
Methods
Modifier and Type Member Description
public stream
stream() as QueryStream<T>:
Opens one independent forward-only SQL cursor.
public toList
toList() as List<T>:
Materializes all rows and closes the underlying SQL resources.