Expand description
Welcome to Rust Rel8
This is a port of Haskell’s excellent Rel8 library which provides a type safe and expressive interface for constructing SQL queries.
Unlike other ORMs and query builders, this library does not provide a builder pattern on top of the AST for a SQL query, but instead allows you to write queries as if the tables themselves were just arrays in rust.
Re-exports§
pub use helper_utilities::ShortenLifetime;pub use table_modes::*;
Modules§
- helper_
tables - A set of helper tables that are equivalent to tuples.
- helper_
utilities - is_
nullable - Helper trait that is used to mark if a type could be
NULLon the SQL side. - table_
modes - The modes a table can be in
Structs§
- A
- A struct allowing manipulation of an aggregation
- Erased
Expr - A publicly exposed opaque type that is used by Table::visit and Table::visit_mut. Its purpose is to allow you to store Exprs in your types which implement the Table trait.
- Expr
- A type representing an expression in the query, can be passed around on the rust side to wire things up
- Insert
- Construct an insert statement, the result of the query
rowswill be inserted intointo. - List
Table - A table representing an array aggregation.
- Maybe
Table - A table which contains a tag indicating whether a query returned rows. Use Query::optional to construct this.
- Null
Table - A table wrapping another. This table’s rows are assumed null if any of the
non-nullable columns in
Tare null. - Over
- A struct representing an
OVERused by a window function. - Q
- An opaque value you can use to compose together queries.
- Query
- A value representing a sql select statement which produces rows of type
T. - Table
Schema - A table’s name and column names.
- Table
Using Mapper - A wrapper which implements Table for any type implementing MapTable in ExprMode.
- W
- A struct allowing insertion of window functions
- With
LtMarker - Private type used to restrict calls of ForLifetimeTable::with_lt to the library.
Enums§
- Visit
Table Mode - How to visit the columns in a table
Traits§
- ForLifetime
Table - A helper trait that allows us to talk about a Table with different
lifetimes. Conceptually it is a type level function of
lt -> T where T: Table<'lt>. - LitTable
- Trait for tables containing values which we can turn into literals
- MapTable
- This trait allows us to change the mode of a table by mapping all the fields with ModeMapper, ModeMapperRef, or ModeMapperMut.
- Mode
Mapper - This trait allows us to write a mapping function between two column modes.
- Mode
Mapper Mut - This trait allows us to write a mapping function between two column modes.
- Mode
Mapper Ref - This trait allows us to write a mapping function between two column modes.
- Sqlx
Value IfEnabled - Proxy trait for sqlx::Decode that we can switch off if not enabled
- Table
- A trait that represents a database result row.
- TableHKT
- A trait abstracting the mode of a user defined table, which allows us to talk about the same table in two different modes.
- Table
Loader Many Sqlx - Trait allowing loading of many Tables when using sqlx.
- Table
Loader Sqlx - Trait allowing loading of Tables when using sqlx.
- Table
Mode - Table modes, this trait is used to switch the types of a rust structs fields.
- Value
- This trait represents values we know to encode and decode from their database type.
Functions§
- query
- Open a context allowing you to manipulate a query.
Derive Macros§
- Table
Struct - Derive the necessary traits for Table structs