on dev help sign in
some things
38d7ee0Eitan Chatav
squeel-postgresql/squeel-postgresql.cabal+1
@@ -13,6 +13,7 @@ cabal-version: >=1.10
13library
13library
14 hs-source-dirs: src
14 hs-source-dirs: src
15 exposed-modules:
15 exposed-modules:
16+ Squeel.PostgreSQL
16 Squeel.PostgreSQL.Binary
17 Squeel.PostgreSQL.Binary
17 Squeel.PostgreSQL.PQ
18 Squeel.PostgreSQL.PQ
18 Squeel.PostgreSQL.Statement
19 Squeel.PostgreSQL.Statement
squeel-postgresql/src/Squeel/PostgreSQL.hsnew file+11
@@ -0,0 +1,11 @@
1+module Squeel.PostgreSQL
2+ ( module Squeel.PostgreSQL.Binary
3+ , module Squeel.PostgreSQL.PQ
4+ , module Squeel.PostgreSQL.Schema
5+ , module Squeel.PostgreSQL.Statement
6+ ) where
7+
8+import Squeel.PostgreSQL.Binary
9+import Squeel.PostgreSQL.PQ
10+import Squeel.PostgreSQL.Schema
11+import Squeel.PostgreSQL.Statement
squeel-postgresql/src/Squeel/PostgreSQL/Schema.hs+7
@@ -68,6 +68,13 @@ data PGType
68 | PGJsonb
68 | PGJsonb
69
69
70class ToOid pg where toOid :: Proxy# pg -> LibPQ.Oid
70class ToOid pg where toOid :: Proxy# pg -> LibPQ.Oid
71+--staticTypeInfo
72+instance ToOid 'PGBool where toOid _ = LibPQ.Oid 16
73+instance ToOid 'PGBytea where toOid _ = LibPQ.Oid 17
74+instance ToOid 'PGInt8 where toOid _ = LibPQ.Oid 20
75+instance ToOid 'PGInt2 where toOid _ = LibPQ.Oid 21
76+instance ToOid 'PGInt4 where toOid _ = LibPQ.Oid 23
77+instance ToOid 'PGText where toOid _ = LibPQ.Oid 26
71class ToOids pgs where toOids :: Proxy# pgs -> [LibPQ.Oid]
78class ToOids pgs where toOids :: Proxy# pgs -> [LibPQ.Oid]
72instance ToOids '[] where toOids _ = []
79instance ToOids '[] where toOids _ = []
73instance (ToOid pg, ToOids pgs) => ToOids (pg ': pgs) where
80instance (ToOid pg, ToOids pgs) => ToOids (pg ': pgs) where
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+3−3
@@ -378,9 +378,9 @@ newtype Statement
378 = UnsafeStatement { renderStatement :: ByteString }
378 = UnsafeStatement { renderStatement :: ByteString }
379
379
380(.>>.)
380(.>>.)
381− :: Statement params schema0 schema1 '[]
381+ :: Statement '[] schema0 schema1 '[]
382− -> Statement params schema1 schema2 results
382+ -> Statement '[] schema1 schema2 results
383− -> Statement params schema0 schema2 results
383+ -> Statement '[] schema0 schema2 results
384statement1 .>>. statement2 = UnsafeStatement $
384statement1 .>>. statement2 = UnsafeStatement $
385 renderStatement statement1 <> " " <> renderStatement statement2
385 renderStatement statement1 <> " " <> renderStatement statement2
386
386