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<DB> Queryable<Date, DB> for NaiveDate where
DB: Backend + HasSqlType<Date>,
NaiveDate: FromSqlRow<Date, DB>,impl<DB> Queryable<Time, DB> for NaiveTime where
DB: Backend + HasSqlType<Time>,
NaiveTime: FromSqlRow<Time, DB>,impl<DB> Queryable<Timestamp, DB> for NaiveDateTime where
DB: Backend + HasSqlType<Timestamp>,
NaiveDateTime: FromSqlRow<Timestamp, DB>,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,impl<DB> Queryable<Bool, DB> for bool where
DB: Backend + HasSqlType<Bool>,
bool: FromSqlRow<Bool, DB>,impl<DB> Queryable<SmallInt, DB> for i16 where
DB: Backend + HasSqlType<SmallInt>,
i16: FromSqlRow<SmallInt, DB>,impl<DB> Queryable<Integer, DB> for i32 where
DB: Backend + HasSqlType<Integer>,
i32: FromSqlRow<Integer, DB>,impl<DB> Queryable<BigInt, DB> for i64 where
DB: Backend + HasSqlType<BigInt>,
i64: FromSqlRow<BigInt, DB>,impl<DB> Queryable<Float, DB> for f32 where
DB: Backend + HasSqlType<Float>,
f32: FromSqlRow<Float, DB>,impl<DB> Queryable<Double, DB> for f64 where
DB: Backend + HasSqlType<Double>,
f64: FromSqlRow<Double, DB>,impl<DB> Queryable<Text, DB> for String where
DB: Backend + HasSqlType<Text>,
String: FromSqlRow<Text, DB>,impl<DB> Queryable<Binary, DB> for Vec<u8> where
DB: Backend + HasSqlType<Binary>,
Vec<u8>: FromSqlRow<Binary, DB>,impl<A, SA, DB> Queryable<(SA,), DB> for (A,) where
DB: Backend,
A: Queryable<SA, DB>,
DB: HasSqlType<SA>,
DB: HasSqlType<(SA,)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,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)>,impl<DB> Queryable<Numeric, DB> for BigDecimal where
DB: Backend + HasSqlType<Numeric>,
BigDecimal: FromSqlRow<Numeric, DB>,impl<DB> Queryable<Datetime, DB> for NaiveDateTime where
DB: Backend + HasSqlType<Datetime>,
NaiveDateTime: FromSqlRow<Datetime, DB>,impl<DB> Queryable<Tinyint, DB> for i8 where
DB: Backend + HasSqlType<Tinyint>,
i8: FromSqlRow<Tinyint, DB>,impl Queryable<(Oid, Oid), Pg> for PgTypeMetadata
impl<T, ST> Queryable<Array<ST>, Pg> for Vec<T> where
T: FromSql<ST, Pg> + Queryable<ST, Pg>,
Pg: HasSqlType<ST>,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>>,impl<DB> Queryable<Timestamp, DB> for SystemTime where
DB: Backend + HasSqlType<Timestamp>,
SystemTime: FromSqlRow<Timestamp, DB>,impl<DB> Queryable<Timestamptz, DB> for NaiveDateTime where
DB: Backend + HasSqlType<Timestamptz>,
NaiveDateTime: FromSqlRow<Timestamptz, DB>,impl<DB> Queryable<Timestamptz, DB> for DateTime<Utc> where
DB: Backend + HasSqlType<Timestamptz>,
DateTime<Utc>: FromSqlRow<Timestamptz, DB>,impl<DB> Queryable<Timestamp, DB> for Timespec where
DB: Backend + HasSqlType<Timestamp>,
Timespec: FromSqlRow<Timestamp, DB>,impl<DB> Queryable<Date, DB> for PgDate where
DB: Backend + HasSqlType<Date>,
PgDate: FromSqlRow<Date, DB>,impl<DB> Queryable<Time, DB> for PgTime where
DB: Backend + HasSqlType<Time>,
PgTime: FromSqlRow<Time, DB>,impl<DB> Queryable<Timestamp, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamp>,
PgTimestamp: FromSqlRow<Timestamp, DB>,impl<DB> Queryable<Timestamptz, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamptz>,
PgTimestamp: FromSqlRow<Timestamptz, DB>,impl<DB> Queryable<Interval, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: FromSqlRow<Interval, DB>,impl<DB> Queryable<MacAddr, DB> for [u8; 6] where
DB: Backend + HasSqlType<MacAddr>,
[u8; 6]: FromSqlRow<MacAddr, DB>,impl<DB> Queryable<Inet, DB> for IpNetwork where
DB: Backend + HasSqlType<Inet>,
IpNetwork: FromSqlRow<Inet, DB>,impl<DB> Queryable<Cidr, DB> for IpNetwork where
DB: Backend + HasSqlType<Cidr>,
IpNetwork: FromSqlRow<Cidr, DB>,impl<DB> Queryable<Oid, DB> for u32 where
DB: Backend + HasSqlType<Oid>,
u32: FromSqlRow<Oid, DB>,impl<DB> Queryable<Numeric, DB> for PgNumeric where
DB: Backend + HasSqlType<Numeric>,
PgNumeric: FromSqlRow<Numeric, DB>,impl<DB> Queryable<Uuid, DB> for Uuid where
DB: Backend + HasSqlType<Uuid>,
Uuid: FromSqlRow<Uuid, DB>,impl<DB> Queryable<Json, DB> for Value where
DB: Backend + HasSqlType<Json>,
Value: FromSqlRow<Json, DB>,impl<DB> Queryable<Jsonb, DB> for Value where
DB: Backend + HasSqlType<Jsonb>,
Value: FromSqlRow<Jsonb, DB>,impl<DB> Queryable<Money, DB> for PgMoney where
DB: Backend + HasSqlType<Money>,
PgMoney: FromSqlRow<Money, DB>,impl<DB> Queryable<Date, DB> for String where
DB: Backend + HasSqlType<Date>,
String: FromSqlRow<Date, DB>,impl<DB> Queryable<Time, DB> for String where
DB: Backend + HasSqlType<Time>,
String: FromSqlRow<Time, DB>,impl<DB> Queryable<Timestamp, DB> for String where
DB: Backend + HasSqlType<Timestamp>,
String: FromSqlRow<Timestamp, DB>,