Zero-reflection type-safe SQL AST, Postgres/SQLite/D1 dialect compiler, closure SAVEPOINT transactions, and query executor for unmbt/ciallo
fn expand_named_sql(dialect : DialectKind, sql : String, params : Array[(String, SqlValue)]) -> CompiledSql raise DataError#callsite(autofill(loc))
async fn[E : SqlExecutor, C, P : FromRow, K : Eq + Hash + ToSqlValue] preload_belongs_to(exec : E, children : Array[C], child_fk~ : (C) -> K, parent_table~ : String, pk_col~ : String, parent_key~ : (P) -> K, loc~ : SourceLoc) -> Array[(C, P?)] raise DataError#callsite(autofill(loc))
async fn[E : SqlExecutor, P, C : FromRow, K : Eq + Hash + ToSqlValue] preload_has_many(exec : E, parents : Array[P], parent_key~ : (P) -> K, child_table~ : String, fk_col~ : String, child_fk~ : (C) -> K, loc~ : SourceLoc) -> Array[(P, Array[C])] raise DataError#callsite(autofill(loc))
async fn[E : SqlExecutor] raw_exec(exec : E, sql : String, params? : Array[(String, SqlValue)], loc~ : SourceLoc) -> ExecResult raise DataErrorfn[A, B, C] select3(a : Projection[A], b : Projection[B], c : Projection[C]) -> SelectBuilder3[A, B, C]Install
Download zipZero-reflection type-safe SQL AST, Postgres/SQLite/D1 dialect compiler, closure SAVEPOINT transactions, and query executor for unmbt/ciallo