Module block_tools::db::use_diesel [−][src]
Modules
associations | Traits related to relationships between multiple tables. |
backend | Types which represent various database backends |
connection | Types related to database connections |
data_types | Structs to represent the primitive equivalent of SQL types where there is no existing Rust primitive, or where using it would be confusing (such as date and time types). This module will re-export all backend specific data structures when compiled against that backend. |
deserialize | Types and traits related to deserializing values from the database |
dsl | Includes various helper types and bare functions which are named too generically to be included in prelude, but are often used when using Diesel. |
expression | AST types representing various typed SQL expressions. |
expression_methods | Adds various methods to construct new expressions. These traits are exported by default, and implemented automatically. |
helper_types | Provide helper types for concisely writing the return type of functions. As with iterators, it is unfortunately difficult to return a partially constructed query without exposing the exact implementation of the function. Without higher kinded types, these various DSLs can't be combined into a single trait for boxing purposes. |
migration | Representation of migrations |
pg | Provides types and functions related to working with PostgreSQL |
prelude | Re-exports important traits and types. Meant to be glob imported when using Diesel. |
query_builder | Contains traits responsible for the actual construction of SQL statements |
query_dsl | Traits that construct SELECT statements |
query_source | Types related to describing schema, and interactions between tables. |
r2d2 | Connection pooling via r2d2. |
result | Errors, type aliases, and functions related to working with |
row | Contains the |
serialize | Types and traits related to serializing values for the database |
sql_types | Types which represent a SQL data type. |
types | Deprecated |
Macros
allow_tables_to_appear_in_same_query | Allow two or more tables which are otherwise unrelated to be used together in a query. |
diesel_infix_operator | Useful for libraries adding support for new SQL types. Apps should never need to call this. |
diesel_postfix_operator | Useful for libraries adding support for new SQL types. Apps should never need to call this. |
diesel_prefix_operator | Useful for libraries adding support for new SQL types. Apps should never need to call this. |
impl_query_id | Deprecated Provides a standard implementation of |
joinable | Allow two tables to be referenced in a join query without providing an
explicit |
no_arg_sql_function | Declare a 0 argument SQL function for use in your code. This will generate a
unit struct, which is an expression representing calling this function. See
|
not_none | Gets the value out of an option, or returns an error. |
numeric_expr | Indicates that an expression allows all numeric operators. If you create new
SQL functions that return a numeric type, you should invoke this macro that
type. Unfortunately, Rust disallows us from automatically implementing |
operator_allowed | Implements the Rust operator for a given type. If you create a new SQL
function, which returns a type that you'd like to use an operator on, you
should invoke this macro. Unfortunately, Rust disallows us from
automatically implementing |
sql_function | Declare a sql function for use in your code. |
table | Specifies that a table exists, and what columns it has. This will create a
new public module, with the same name, as the name of the table. In this
module, you'll find a unit struct named |
Structs
PgConnection | The connection string expected by |
Enums
ConnectionError | Errors which can occur during |
Traits
AppearsOnTable | Indicates that all elements of an expression are valid given a from clause. |
BelongingToDsl | Constructs a query that finds record(s) based on directional association with other record(s). |
BoolExpressionMethods | Methods present on boolean expressions |
BoxableExpression | Helper trait used when boxing expressions. |
Column | A column on a database table. Types which implement this trait should have
been generated by the |
Connection | A connection to a database |
EscapeExpressionMethods | Adds the |
Expression | Represents a typed fragment of SQL. |
ExpressionMethods | Methods present on all expressions, except tuples |
GroupByDsl | This trait is not yet part of Diesel's public API. It may change in the future without a major version bump. |
GroupedBy | The |
Identifiable | This trait indicates that a struct represents a single row in a database table. |
Insertable | Represents that a structure can be used to insert a new row into the
database. This is automatically implemented for |
IntoSql | Converts a type to its representation for use in Diesel's query builder. |
JoinOnDsl | Specify the |
JoinTo | Indicates that two tables can be joined without an explicit |
NullableExpressionMethods | Methods present on all expressions |
OptionalExtension | See the method documentation. |
PgArrayExpressionMethods | PostgreSQL specific methods present on array expressions. |
PgExpressionMethods | PostgreSQL specific methods which are present on all expressions. |
PgSortExpressionMethods | PostgreSQL expression methods related to sorting. |
PgTextExpressionMethods | PostgreSQL specific methods present on text expressions. |
PgTimestampExpressionMethods | PostgreSQL specific methods present on timestamp expressions. |
QueryDsl | Methods used to construct select statements. |
QuerySource | Represents a type which can appear in the |
Queryable | Trait indicating that a record can be queried from the database. |
RunQueryDsl | Methods used to execute queries. |
SaveChangesDsl | Sugar for types which implement both |
SelectableExpression | Indicates that an expression can be selected from a source. |
Table | A SQL database table. Types which implement this trait should have been
generated by the |
TextExpressionMethods | Methods present on text expressions |
Functions
debug_query | Takes a query |
delete | Creates a |
insert_into | Creates an |
insert_or_ignore_into | Creates an |
replace_into | Creates a |
select | Creates a bare select statement, with no from clause. Primarily used for testing diesel itself, but likely useful for third party crates as well. The given expressions must be selectable from anywhere. |
sql_query | Construct a full SQL query using raw SQL. |
update | Creates an |
Type Definitions
ConnectionResult | A specialized result type for establishing connections. |
QueryResult | A specialized result type for queries. |
Derive Macros
AsChangeset | |
AsExpression | |
Associations | |
DieselNumericOps | |
FromSqlRow | |
Identifiable | |
Insertable | |
QueryId | |
Queryable | |
QueryableByName | |
SqlType |