Hoogle Search
Within LTS Haskell 24.66 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
esqueleto Database.Esqueleto.Internal.Internal No documentation available.
-
esqueleto Database.Esqueleto.Internal.Internal Class that enables one to use toBaseId to convert an entity's key on a query into another (cf. toBaseId).
aliasedEntityColumnIdent :: Ident -> FieldDef -> Identesqueleto Database.Esqueleto.Internal.Internal No documentation available.
collectIdents :: FromClause -> Set Identesqueleto Database.Esqueleto.Internal.Internal No documentation available.
fromBaseId :: ToBaseId ent => SqlExpr (Value (Key (BaseEnt ent))) -> SqlExpr (Value (Key ent))esqueleto Database.Esqueleto.Internal.Internal The inverse of toBaseId. Note that this is somewhat less "safe" than toBaseId. Calling toBaseId will usually mean that a foreign key constraint is present that guarantees the presence of the base ID. fromBaseId has no such guarantee. Consider the code example given in toBaseId:
Bar barNum Int Foo bar BarId fooNum Int Primary bar
instance ToBaseId Foo where type BaseEnt Foo = Bar toBaseIdWitness barId = FooKey barId
The type of toBaseId for Foo would be:toBaseId :: SqlExpr (Value FooId) -> SqlExpr (Value BarId)
The foreign key constraint on Foo means that every FooId points to a BarId in the database. However, fromBaseId will not have this:fromBaseId :: SqlExpr (Value BarId) -> SqlExpr (Value FooId)
-
esqueleto Database.Esqueleto.Internal.Internal As fromBaseId, but works on Maybe keys.
initialIdentState :: IdentStateesqueleto Database.Esqueleto.Internal.Internal No documentation available.
newIdentFor :: DBName -> SqlQuery Identesqueleto Database.Esqueleto.Internal.Internal toBaseId :: ToBaseId ent => SqlExpr (Value (Key ent)) -> SqlExpr (Value (Key (BaseEnt ent)))esqueleto Database.Esqueleto.Internal.Internal Convert an entity's key into another entity's. This function is to be used when you change an entity's Id to be that of another entity. For example:
Bar barNum Int Foo bar BarId fooNum Int Primary bar
In this example, Bar is said to be the BaseEnt(ity), and Foo the child. To model this in Esqueleto, declare:instance ToBaseId Foo where type BaseEnt Foo = Bar toBaseIdWitness barId = FooKey barId
Now you're able to write queries such as:select $ from $ (bar `InnerJoin` foo) -> do on (toBaseId (foo ^. FooId) ==. bar ^. BarId) return (bar, foo)
Note: this function may be unsafe to use in conditions not like the one of the example above.-
esqueleto Database.Esqueleto.Internal.Internal