Skip to content

ribs_sql

Purely functional, type-safe SQL query execution and composition.

Provides combinators for building SQL queries, parameter binding, and a Transactor abstraction for executing IO operations against various database backends.

Classes

ClassDescription
ConnectionIO<A>A program that requires a SqlConnection to produce a value of type A.
ConnectionRill<A>A deferred streaming query that produces a Rill that output elements of type A when transacted.
FragmentA composable SQL fragment consisting of a SQL string and its bound parameters.
Get<A>Describes how to read a value of type A from a single column position in a database result Row.
ParameterizedQuery<P, A>A parameterized query template. Binds parameters at call time.
Put<A>Describes how to encode a value of type A into a SQL parameter slot.
Query<A>A SELECT query that reads rows of type A using the given Fragment and Read codec.
Read<A>Describes how to read a value of type A from a database result Row. A Read may consume multiple columns.
ReadWrite<A>A bidirectional codec that can both read and write values of type A.
SqlConnectionAbstract interface for a database connection.
StrategyDefines the lifecycle hooks for transaction management.
TransactorManages the lifecycle of a SqlConnection and provides the ability to run ConnectionIO programs using it.
Update<A>An INSERT, UPDATE, or DELETE statement parameterized by A.
Update0A no-parameter UPDATE/INSERT/DDL statement.
UpdateReturning<A, B>An INSERT...RETURNING (or similar) statement that writes A parameters and reads back B value(s).
Write<A>Describes how to encode a value of type A into SQL parameter slots. A Write may occupy multiple parameter positions.

Extensions

ExtensiononDescription
FragmentStringOpsString
FragmentUpdateOpsFragment
ParameterizedQueryStringOpsStringExtension to construct a ParameterizedQuery from a plain SQL string with no parameters.
QueryFragmentOpsFragmentExtension to construct a Query from a Fragment.
QueryStringOpsStringExtension to construct a Query from a plain SQL string with no parameters.
ReadOptionOps<A>Read<A>Adds nullable column support to Read.
Tuple10ReadOps<A, B, C, D, E, F, G, H, I, J>Record
Tuple10ReadWriteOps<A, B, C, D, E, F, G, H, I, J>Record
Tuple10WriteOps<A, B, C, D, E, F, G, H, I, J>Record
Tuple11ReadOps<A, B, C, D, E, F, G, H, I, J, K>Record
Tuple11ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K>Record
Tuple11WriteOps<A, B, C, D, E, F, G, H, I, J, K>Record
Tuple12ReadOps<A, B, C, D, E, F, G, H, I, J, K, L>Record
Tuple12ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L>Record
Tuple12WriteOps<A, B, C, D, E, F, G, H, I, J, K, L>Record
Tuple13ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M>Record
Tuple13ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M>Record
Tuple13WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M>Record
Tuple14ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N>Record
Tuple14ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N>Record
Tuple14WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N>Record
Tuple15ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>Record
Tuple15ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>Record
Tuple15WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>Record
Tuple16ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>Record
Tuple16ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>Record
Tuple16WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>Record
Tuple17ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>Record
Tuple17ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>Record
Tuple17WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>Record
Tuple18ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>Record
Tuple18ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>Record
Tuple18WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>Record
Tuple19ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>Record
Tuple19ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>Record
Tuple19WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>Record
Tuple20ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>Record
Tuple20ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>Record
Tuple20WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>Record
Tuple21ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>Record
Tuple21ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>Record
Tuple21WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>Record
Tuple22ReadOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V>Record
Tuple22ReadWriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V>Record
Tuple22WriteOps<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V>Record
Tuple2ReadOps<A, B>Record
Tuple2ReadWriteOps<A, B>Record
Tuple2WriteOps<A, B>Record
Tuple3ReadOps<A, B, C>Record
Tuple3ReadWriteOps<A, B, C>Record
Tuple3WriteOps<A, B, C>Record
Tuple4ReadOps<A, B, C, D>Record
Tuple4ReadWriteOps<A, B, C, D>Record
Tuple4WriteOps<A, B, C, D>Record
Tuple5ReadOps<A, B, C, D, E>Record
Tuple5ReadWriteOps<A, B, C, D, E>Record
Tuple5WriteOps<A, B, C, D, E>Record
Tuple6ReadOps<A, B, C, D, E, F>Record
Tuple6ReadWriteOps<A, B, C, D, E, F>Record
Tuple6WriteOps<A, B, C, D, E, F>Record
Tuple7ReadOps<A, B, C, D, E, F, G>Record
Tuple7ReadWriteOps<A, B, C, D, E, F, G>Record
Tuple7WriteOps<A, B, C, D, E, F, G>Record
Tuple8ReadOps<A, B, C, D, E, F, G, H>Record
Tuple8ReadWriteOps<A, B, C, D, E, F, G, H>Record
Tuple8WriteOps<A, B, C, D, E, F, G, H>Record
Tuple9ReadOps<A, B, C, D, E, F, G, H, I>Record
Tuple9ReadWriteOps<A, B, C, D, E, F, G, H, I>Record
Tuple9WriteOps<A, B, C, D, E, F, G, H, I>Record
UpdateStringOpsStringConvenience extensions for constructing updates from SQL strings.
WriteOptionOps<A>Write<A>Adds nullable column support to Write.

Extension Types

Extension TypeDescription
RowAlias type for IList<Object?> used to abstract row types used by different database drivers.
StatementParametersWrapper type for parameters that can be applied to a statement that has parameter bindings.