pub struct TableMapper {
    pub table_name: String,
    pub canonical_table_alias: String,
    /* private fields */
}
Expand description

Translates Toql fields into columns or SQL expressions.

It’s needed by the SQL Builder to turn a Query into a SQL Builder Result.

The Toql derive generates the TabeMapper instructions and puts them into the Mapped trait. Every ToqlApi function quickly checks, if TableMapperRegistry contains the TableMapper. If the mapper is missing it will call TreeMap to map an entity and all its dependencies. TreeMap itself uses from_mapped to map an entity.

Fields

table_name: String

Database table name

canonical_table_alias: String

Calculated alias from table_name

Implementations

Create new mapper for table or table alias. Example: ::new("Book") or new("Book b"). If you use an alias you must map all SQL columns with the alias too.

Create a new mapper with a custom handler. Use this to provide custom filter functions for all fields.

Create a new mapper from a struct that implements the Mapped trait.

Create a new mapper from a struct that implements the Mapped trait with a custom FieldHandler.

Returns joined mapper for a path name, if any.

Returns true, if path name refers to a partial join table.

Returns joined mapper for a path name, if any.

Map a column with default FieldOptions

Convenience function for generic TableMapper::map_expr_with_options.

Map a join with default JoinOptions

Map a join with options.

Map a merge with default MergeOptions.

Map a merge with default MergeOptions.

Map a predicate expression with default PredicateOptions.

Map a predicate expression.

Map a selection.

Restrict deleted this struct with a role expression.

Restrict loading this struct with a role expression.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more