Skip to main content

SQLTable

Trait SQLTable 

Source
pub trait SQLTable<'a, Type: SQLSchemaType, Value: SQLParam + 'a>:
    SQLSchema<'a, Type, Value>
    + SQLTableInfo
    + Default
    + Clone
    + Copy {
    type Select: SQLModel<'a, Value> + SQLPartial<'a, Value> + Default + '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: Tag + 'static>() -> Self::Aliased<Name>;
}

Required Associated Types§

Source

type Select: SQLModel<'a, Value> + SQLPartial<'a, Value> + Default + '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: Tag + 'static>() -> Self::Aliased<Name>

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", so this trait is not object safe.

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>, for<'r> &'r T: SQLSchema<'a, Type, Value> + SQLTableInfo + Default + 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: Tag + 'static>() -> Self::Aliased<Name>

Implementors§