An inductive tuple of selectors for the given relation.
Moduleselda-0.5.2.1Haskell2010
Database.Selda.MakeSelectors
Utilities for creating selectors for non-record types.
In general, you should really use record types for your tables and
their record labels (i.e. #label) as selectors using
the OverloadedLabels extension instead.
- 1 type
- 1 class
- 2 values
- Packageselda-0.5.2.1
- Exports4
- LanguageHaskell2010
- LicenceMIT
- SourceMakeSelectors.hs
Any table type that can have selectors generated.
Instances4GSelectors
GSelectors t (a :*: (b :*: c)) => GSelectors t ((a :*: b) :*: c)Defined in selda-0.5.2.1 · Database.Selda.MakeSelectors(GSelectors t a, GSelectors t b, Sels t (a :*: b) ~ (Sels t a :*: Sels t b)) => GSelectors t (a :*: b)Defined in selda-0.5.2.1 · Database.Selda.MakeSelectors(SqlRow t, SqlType a) => GSelectors t (K1 i a)Defined in selda-0.5.2.1 · Database.Selda.MakeSelectors(GSelectors t f, Sels t f ~ Sels t (M1 x y f)) => GSelectors t (M1 x y f)Defined in selda-0.5.2.1 · Database.Selda.MakeSelectors
Generate selector functions for the given table. Selectors can be used to access the fields of a query result tuple, avoiding the need to pattern match on the entire tuple.
tbl :: Table (Int, Text)
tbl = table "foo" []
(tblBar :*: tblBaz) = selectors tbl
q :: Query s Text
q = do
row <- select tbl
return (row ! tblBaz)A pair of the table with the given name and columns, and all its selectors. For example:
tbl :: Table (Int, Text)
(tbl, tblBar :*: tblBaz)
= tableWithSelectors "foo" []
q :: Query s Text
q = tblBaz `from` select tbl