Skip to main content

SQLTable

Trait SQLTable 

Source
pub trait SQLTable<'a, Type, Value>:
    SQLSchema<'a, Type, Value>
    + SQLTableInfo
    + Default
    + Clone
    + Copy
where Type: SQLSchemaType, Value: SQLParam + 'a,
{ type Select: SQLModel<'a, Value> + SQLPartial<'a, Value> + 'a; type ForeignKeys; type PrimaryKey; type Constraints; type Insert<T>: SQLModel<'a, Value> + Default; type Update: SQLModel<'a, Value> + 'a; type Aliased<Name: Tag + 'static>: SQLTable<'a, Type, Value>; // Required method fn alias<Name>() -> Self::Aliased<Name> where Name: Tag + 'static; }

Required Associated Types§

Source

type Select: SQLModel<'a, Value> + SQLPartial<'a, Value> + 'a

Source

type ForeignKeys

Source

type PrimaryKey

Source

type Constraints

Source

type Insert<T>: SQLModel<'a, Value> + Default

The type representing a model for INSERT operations on this table. Uses PhantomData with tuple markers to track which fields are set

Source

type Update: SQLModel<'a, Value> + 'a

The type representing a model for UPDATE operations on this table. This would be generated by the table macro.

Source

type Aliased<Name: Tag + 'static>: SQLTable<'a, Type, Value>

The aliased version of this table for self-joins and CTEs.

Required Methods§

Source

fn alias<Name>() -> Self::Aliased<Name>
where Name: Tag + 'static,

Creates a strongly-typed alias using the compile-time Tag name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, Type, Value, T> SQLTable<'a, Type, Value> for &T
where Type: SQLSchemaType, Value: SQLParam + 'a, T: SQLTable<'a, Type, Value>, &'r T: for<'r> SQLSchema<'a, Type, Value> + for<'r> SQLTableInfo + for<'r> Default + for<'r> Clone,

Source§

type Select = <T as SQLTable<'a, Type, Value>>::Select

Source§

type ForeignKeys = <T as SQLTable<'a, Type, Value>>::ForeignKeys

Source§

type PrimaryKey = <T as SQLTable<'a, Type, Value>>::PrimaryKey

Source§

type Constraints = <T as SQLTable<'a, Type, Value>>::Constraints

Source§

type Insert<I> = <T as SQLTable<'a, Type, Value>>::Insert<I>

Source§

type Update = <T as SQLTable<'a, Type, Value>>::Update

Source§

type Aliased<Name: Tag + 'static> = <T as SQLTable<'a, Type, Value>>::Aliased<Name>

Source§

fn alias<Name>() -> <&T as SQLTable<'a, Type, Value>>::Aliased<Name>
where Name: Tag + 'static,

Implementors§