Trait diesel::query_source::Queryable
[−]
[src]
pub trait Queryable<ST, DB> where
DB: Backend + HasSqlType<ST>, {
type Row: FromSqlRow<ST, DB>;
fn build(row: Self::Row) -> Self;
}
Trait indicating that a record can be queried from the database. This trait
can be derived automatically using diesel_codegen
. This trait can only be derived for
structs, not enums.
Associated Types
type Row: FromSqlRow<ST, DB>
Required Methods
Implementors
impl<T, ST, DB> Queryable<Nullable<ST>, DB> for Option<T> where
T: Queryable<ST, DB>,
DB: Backend + HasSqlType<ST>,
Option<T::Row>: FromSqlRow<Nullable<ST>, DB>,
ST: NotNull, type Row = Option<T::Row>;impl<DB> Queryable<Bool, DB> for bool where
DB: Backend + HasSqlType<Bool>,
bool: FromSqlRow<Bool, DB>, type Row = Self;impl<DB> Queryable<SmallInt, DB> for i16 where
DB: Backend + HasSqlType<SmallInt>,
i16: FromSqlRow<SmallInt, DB>, type Row = Self;impl<DB> Queryable<Integer, DB> for i32 where
DB: Backend + HasSqlType<Integer>,
i32: FromSqlRow<Integer, DB>, type Row = Self;impl<DB> Queryable<BigInt, DB> for i64 where
DB: Backend + HasSqlType<BigInt>,
i64: FromSqlRow<BigInt, DB>, type Row = Self;impl<DB> Queryable<Float, DB> for f32 where
DB: Backend + HasSqlType<Float>,
f32: FromSqlRow<Float, DB>, type Row = Self;impl<DB> Queryable<Double, DB> for f64 where
DB: Backend + HasSqlType<Double>,
f64: FromSqlRow<Double, DB>, type Row = Self;impl<DB> Queryable<Text, DB> for String where
DB: Backend + HasSqlType<Text>,
String: FromSqlRow<Text, DB>, type Row = Self;impl<DB> Queryable<Binary, DB> for Vec<u8> where
DB: Backend + HasSqlType<Binary>,
Vec<u8>: FromSqlRow<Binary, DB>, type Row = Self;impl<A, SA, DB> Queryable<(SA,), DB> for (A,) where
DB: Backend,
A: Queryable<SA, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<(SA,)>, type Row = (A::Row,);impl<A, B, SA, SB, DB> Queryable<(SA, SB), DB> for (A, B) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<(SA, SB)>, type Row = (A::Row, B::Row);impl<A, B, C, SA, SB, SC, DB> Queryable<(SA, SB, SC), DB> for (A, B, C) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<(SA, SB, SC)>, type Row = (A::Row, B::Row, C::Row);impl<A, B, C, D, SA, SB, SC, SD, DB> Queryable<(SA, SB, SC, SD), DB> for (A, B, C, D) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<(SA, SB, SC, SD)>, type Row = (A::Row, B::Row, C::Row, D::Row);impl<A, B, C, D, E, SA, SB, SC, SD, SE, DB> Queryable<(SA, SB, SC, SD, SE), DB> for (A, B, C, D, E) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<(SA, SB, SC, SD, SE)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row);impl<A, B, C, D, E, F, SA, SB, SC, SD, SE, SF, DB> Queryable<(SA, SB, SC, SD, SE, SF), DB> for (A, B, C, D, E, F) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row);impl<A, B, C, D, E, F, G, SA, SB, SC, SD, SE, SF, SG, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG), DB> for (A, B, C, D, E, F, G) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row);impl<A, B, C, D, E, F, G, H, SA, SB, SC, SD, SE, SF, SG, SH, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH), DB> for (A, B, C, D, E, F, G, H) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row);impl<A, B, C, D, E, F, G, H, I, SA, SB, SC, SD, SE, SF, SG, SH, SI, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI), DB> for (A, B, C, D, E, F, G, H, I) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row);impl<A, B, C, D, E, F, G, H, I, J, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ), DB> for (A, B, C, D, E, F, G, H, I, J) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row);impl<A, B, C, D, E, F, G, H, I, J, K, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK), DB> for (A, B, C, D, E, F, G, H, I, J, K) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
K: Queryable<SK, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<SK>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row, K::Row);impl<A, B, C, D, E, F, G, H, I, J, K, L, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL), DB> for (A, B, C, D, E, F, G, H, I, J, K, L) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
K: Queryable<SK, DB>,
L: Queryable<SL, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<SK>,
DB: HasSqlType<SL>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row, K::Row, L::Row);impl<A, B, C, D, E, F, G, H, I, J, K, L, M, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM), DB> for (A, B, C, D, E, F, G, H, I, J, K, L, M) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
K: Queryable<SK, DB>,
L: Queryable<SL, DB>,
M: Queryable<SM, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<SK>,
DB: HasSqlType<SL>,
DB: HasSqlType<SM>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row, K::Row, L::Row, M::Row);impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN), DB> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
K: Queryable<SK, DB>,
L: Queryable<SL, DB>,
M: Queryable<SM, DB>,
N: Queryable<SN, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<SK>,
DB: HasSqlType<SL>,
DB: HasSqlType<SM>,
DB: HasSqlType<SN>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row, K::Row, L::Row, M::Row, N::Row);impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO), DB> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
K: Queryable<SK, DB>,
L: Queryable<SL, DB>,
M: Queryable<SM, DB>,
N: Queryable<SN, DB>,
O: Queryable<SO, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<SK>,
DB: HasSqlType<SL>,
DB: HasSqlType<SM>,
DB: HasSqlType<SN>,
DB: HasSqlType<SO>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row, K::Row, L::Row, M::Row, N::Row, O::Row);impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SP, DB> Queryable<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SP), DB> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) where
DB: Backend,
A: Queryable<SA, DB>,
B: Queryable<SB, DB>,
C: Queryable<SC, DB>,
D: Queryable<SD, DB>,
E: Queryable<SE, DB>,
F: Queryable<SF, DB>,
G: Queryable<SG, DB>,
H: Queryable<SH, DB>,
I: Queryable<SI, DB>,
J: Queryable<SJ, DB>,
K: Queryable<SK, DB>,
L: Queryable<SL, DB>,
M: Queryable<SM, DB>,
N: Queryable<SN, DB>,
O: Queryable<SO, DB>,
P: Queryable<SP, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<SB>,
DB: HasSqlType<SC>,
DB: HasSqlType<SD>,
DB: HasSqlType<SE>,
DB: HasSqlType<SF>,
DB: HasSqlType<SG>,
DB: HasSqlType<SH>,
DB: HasSqlType<SI>,
DB: HasSqlType<SJ>,
DB: HasSqlType<SK>,
DB: HasSqlType<SL>,
DB: HasSqlType<SM>,
DB: HasSqlType<SN>,
DB: HasSqlType<SO>,
DB: HasSqlType<SP>,
DB: HasSqlType<(SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SP)>, type Row = (A::Row, B::Row, C::Row, D::Row, E::Row, F::Row, G::Row, H::Row, I::Row, J::Row, K::Row, L::Row, M::Row, N::Row, O::Row, P::Row);impl Queryable<(Oid, Oid), Pg> for PgTypeMetadata type Row = (u32, u32);
impl<T, ST> Queryable<Array<ST>, Pg> for Vec<T> where
T: FromSql<ST, Pg> + Queryable<ST, Pg>,
Pg: HasSqlType<ST>, type Row = Self;impl<T, ST> Queryable<Range<ST>, Pg> for (Bound<T>, Bound<T>) where
T: FromSql<ST, Pg> + Queryable<ST, Pg>,
Pg: HasSqlType<ST> + HasSqlType<Range<ST>>, type Row = Self;impl<DB> Queryable<Timestamp, DB> for SystemTime where
DB: Backend + HasSqlType<Timestamp>,
SystemTime: FromSqlRow<Timestamp, DB>, type Row = Self;impl<DB> Queryable<Date, DB> for PgDate where
DB: Backend + HasSqlType<Date>,
PgDate: FromSqlRow<Date, DB>, type Row = Self;impl<DB> Queryable<Time, DB> for PgTime where
DB: Backend + HasSqlType<Time>,
PgTime: FromSqlRow<Time, DB>, type Row = Self;impl<DB> Queryable<Timestamp, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamp>,
PgTimestamp: FromSqlRow<Timestamp, DB>, type Row = Self;impl<DB> Queryable<Timestamptz, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamptz>,
PgTimestamp: FromSqlRow<Timestamptz, DB>, type Row = Self;impl<DB> Queryable<Interval, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: FromSqlRow<Interval, DB>, type Row = Self;impl<DB> Queryable<Oid, DB> for u32 where
DB: Backend + HasSqlType<Oid>,
u32: FromSqlRow<Oid, DB>, type Row = Self;impl<DB> Queryable<Numeric, DB> for PgNumeric where
DB: Backend + HasSqlType<Numeric>,
PgNumeric: FromSqlRow<Numeric, DB>, type Row = Self;impl<DB> Queryable<Money, DB> for PgMoney where
DB: Backend + HasSqlType<Money>,
PgMoney: FromSqlRow<Money, DB>, type Row = Self;