opaleye 0.4.1.0 → 0.4.2.0
raw patch · 21 files changed
+324/−139 lines, 21 filesdep +aesondep ~basedep ~contravariantdep ~product-profunctorsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: aeson
Dependency ranges changed: base, contravariant, product-profunctors, profunctors, semigroups, time, transformers
API changes (from Hackage documentation)
- Opaleye.Constant: constantExplicit :: Constant haskells columns -> haskells -> columns
- Opaleye.Constant: instance Applicative (Constant a)
- Opaleye.Constant: instance Default Constant (CI Text) (Column PGCitext)
- Opaleye.Constant: instance Default Constant Bool (Column PGBool)
- Opaleye.Constant: instance Default Constant ByteString (Column PGBytea)
- Opaleye.Constant: instance Default Constant ByteString (Column PGJson)
- Opaleye.Constant: instance Default Constant ByteString (Column PGJsonb)
- Opaleye.Constant: instance Default Constant Day (Column PGDate)
- Opaleye.Constant: instance Default Constant Double (Column PGFloat8)
- Opaleye.Constant: instance Default Constant Int (Column PGInt4)
- Opaleye.Constant: instance Default Constant Int64 (Column PGInt8)
- Opaleye.Constant: instance Default Constant LocalTime (Column PGTimestamp)
- Opaleye.Constant: instance Default Constant String (Column PGText)
- Opaleye.Constant: instance Default Constant Text (Column PGText)
- Opaleye.Constant: instance Default Constant TimeOfDay (Column PGTime)
- Opaleye.Constant: instance Default Constant UTCTime (Column PGTimestamptz)
- Opaleye.Constant: instance Default Constant UUID (Column PGUuid)
- Opaleye.Constant: instance Default Constant haskell (Column sql) => Default Constant (Maybe haskell) (Column (Nullable sql))
- Opaleye.Constant: instance Functor (Constant a)
- Opaleye.Constant: instance ProductProfunctor Constant
- Opaleye.Constant: instance Profunctor Constant
- Opaleye.Constant: instance SumProfunctor Constant
- Opaleye.Internal.Aggregate: instance Applicative (Aggregator a)
- Opaleye.Internal.Aggregate: instance Functor (Aggregator a)
- Opaleye.Internal.Aggregate: instance ProductProfunctor Aggregator
- Opaleye.Internal.Aggregate: instance Profunctor Aggregator
- Opaleye.Internal.Aggregate: instance SumProfunctor Aggregator
- Opaleye.Internal.Binary: instance Applicative (Binaryspec a)
- Opaleye.Internal.Binary: instance Default Binaryspec (Column a) (Column a)
- Opaleye.Internal.Binary: instance Functor (Binaryspec a)
- Opaleye.Internal.Binary: instance ProductProfunctor Binaryspec
- Opaleye.Internal.Binary: instance Profunctor Binaryspec
- Opaleye.Internal.Column: instance (PGNum a, PGFractional a) => Fractional (Column a)
- Opaleye.Internal.Column: instance PGNum a => Num (Column a)
- Opaleye.Internal.Column: instance Show (Column a)
- Opaleye.Internal.Distinct: instance Applicative (Distinctspec a)
- Opaleye.Internal.Distinct: instance Default Distinctspec (Column a) (Column a)
- Opaleye.Internal.Distinct: instance Functor (Distinctspec a)
- Opaleye.Internal.Distinct: instance ProductProfunctor Distinctspec
- Opaleye.Internal.Distinct: instance Profunctor Distinctspec
- Opaleye.Internal.Distinct: instance SumProfunctor Distinctspec
- Opaleye.Internal.HaskellDB.PrimQuery: instance Read AggrOp
- Opaleye.Internal.HaskellDB.PrimQuery: instance Read BinOp
- Opaleye.Internal.HaskellDB.PrimQuery: instance Read Literal
- Opaleye.Internal.HaskellDB.PrimQuery: instance Read PrimExpr
- Opaleye.Internal.HaskellDB.PrimQuery: instance Read Symbol
- Opaleye.Internal.HaskellDB.PrimQuery: instance Read UnOp
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show AggrOp
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show BinOp
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show Literal
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show OrderDirection
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show OrderExpr
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show OrderNulls
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show OrderOp
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show PrimExpr
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show Symbol
- Opaleye.Internal.HaskellDB.PrimQuery: instance Show UnOp
- Opaleye.Internal.HaskellDB.PrimQuery: orderDirection :: OrderOp -> OrderDirection
- Opaleye.Internal.HaskellDB.PrimQuery: orderNulls :: OrderOp -> OrderNulls
- Opaleye.Internal.HaskellDB.Sql: instance Show SqlColumn
- Opaleye.Internal.HaskellDB.Sql: instance Show SqlExpr
- Opaleye.Internal.HaskellDB.Sql: instance Show SqlOrder
- Opaleye.Internal.HaskellDB.Sql: instance Show SqlOrderDirection
- Opaleye.Internal.HaskellDB.Sql: instance Show SqlOrderNulls
- Opaleye.Internal.HaskellDB.Sql: instance Show SqlTable
- Opaleye.Internal.HaskellDB.Sql: newtype SqlTable
- Opaleye.Internal.HaskellDB.Sql: sqlOrderDirection :: SqlOrder -> SqlOrderDirection
- Opaleye.Internal.HaskellDB.Sql: sqlOrderNulls :: SqlOrder -> SqlOrderNulls
- Opaleye.Internal.HaskellDB.Sql.Generate: sqlDelete :: SqlGenerator -> TableName -> [PrimExpr] -> SqlDelete
- Opaleye.Internal.HaskellDB.Sql.Generate: sqlExpr :: SqlGenerator -> PrimExpr -> SqlExpr
- Opaleye.Internal.HaskellDB.Sql.Generate: sqlInsert :: SqlGenerator -> TableName -> [Attribute] -> NonEmpty [PrimExpr] -> SqlInsert
- Opaleye.Internal.HaskellDB.Sql.Generate: sqlLiteral :: SqlGenerator -> Literal -> String
- Opaleye.Internal.HaskellDB.Sql.Generate: sqlQuote :: SqlGenerator -> String -> String
- Opaleye.Internal.HaskellDB.Sql.Generate: sqlUpdate :: SqlGenerator -> TableName -> [PrimExpr] -> Assoc -> SqlUpdate
- Opaleye.Internal.Join: instance Default NullMaker (Column (Nullable a)) (Column (Nullable a))
- Opaleye.Internal.Join: instance Default NullMaker (Column a) (Column (Nullable a))
- Opaleye.Internal.Join: instance ProductProfunctor NullMaker
- Opaleye.Internal.Join: instance Profunctor NullMaker
- Opaleye.Internal.Order: instance Contravariant Order
- Opaleye.Internal.Order: instance Decidable Order
- Opaleye.Internal.Order: instance Divisible Order
- Opaleye.Internal.Order: instance Monoid (Order a)
- Opaleye.Internal.Order: instance Semigroup (Order a)
- Opaleye.Internal.PackMap: instance Applicative (PackMap a b s)
- Opaleye.Internal.PackMap: instance Functor (PackMap a b s)
- Opaleye.Internal.PackMap: instance ProductProfunctor (PackMap a b)
- Opaleye.Internal.PackMap: instance Profunctor (PackMap a b)
- Opaleye.Internal.PackMap: instance SumProfunctor (PackMap a b)
- Opaleye.Internal.PrimQuery: instance Show BinOp
- Opaleye.Internal.PrimQuery: instance Show JoinType
- Opaleye.Internal.PrimQuery: instance Show LimitOp
- Opaleye.Internal.PrimQuery: instance Show PrimQuery
- Opaleye.Internal.QueryArr: instance Applicative (QueryArr a)
- Opaleye.Internal.QueryArr: instance Arrow QueryArr
- Opaleye.Internal.QueryArr: instance Category QueryArr
- Opaleye.Internal.QueryArr: instance Functor (QueryArr a)
- Opaleye.Internal.QueryArr: instance ProductProfunctor QueryArr
- Opaleye.Internal.QueryArr: instance Profunctor QueryArr
- Opaleye.Internal.RunQuery: instance (Typeable b, QueryRunnerColumnDefault a b) => QueryRunnerColumnDefault (PGArray a) [b]
- Opaleye.Internal.RunQuery: instance Applicative (QueryRunner c)
- Opaleye.Internal.RunQuery: instance Functor (QueryRunner c)
- Opaleye.Internal.RunQuery: instance ProductProfunctor QueryRunner
- Opaleye.Internal.RunQuery: instance Profunctor QueryRunner
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGBool Bool
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGBytea ByteString
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGCitext (CI Text)
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGDate Day
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGFloat8 Double
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGInt4 Int
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGInt8 Int64
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGJson String
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGJsonb String
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGText String
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGText Text
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGTime TimeOfDay
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGTimestamp LocalTime
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGTimestamptz UTCTime
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault PGUuid UUID
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault a b => Default QueryRunner (Column a) b
- Opaleye.Internal.RunQuery: instance QueryRunnerColumnDefault a b => QueryRunnerColumnDefault (Nullable a) (Maybe b)
- Opaleye.Internal.RunQuery: instance SumProfunctor QueryRunner
- Opaleye.Internal.Sql: String :: TableName
- Opaleye.Internal.Sql: attrs :: From -> SelectAttrs
- Opaleye.Internal.Sql: bOp :: Binary -> BinOp
- Opaleye.Internal.Sql: bSelect1 :: Binary -> Select
- Opaleye.Internal.Sql: bSelect2 :: Binary -> Select
- Opaleye.Internal.Sql: criteria :: From -> [SqlExpr]
- Opaleye.Internal.Sql: data TableName
- Opaleye.Internal.Sql: groupBy :: From -> Maybe (NonEmpty SqlExpr)
- Opaleye.Internal.Sql: instance Show BinOp
- Opaleye.Internal.Sql: instance Show Binary
- Opaleye.Internal.Sql: instance Show From
- Opaleye.Internal.Sql: instance Show Join
- Opaleye.Internal.Sql: instance Show JoinType
- Opaleye.Internal.Sql: instance Show Select
- Opaleye.Internal.Sql: instance Show SelectAttrs
- Opaleye.Internal.Sql: instance Show Values
- Opaleye.Internal.Sql: jCond :: Join -> SqlExpr
- Opaleye.Internal.Sql: jJoinType :: Join -> JoinType
- Opaleye.Internal.Sql: jTables :: Join -> (Select, Select)
- Opaleye.Internal.Sql: limit :: From -> Maybe Int
- Opaleye.Internal.Sql: offset :: From -> Maybe Int
- Opaleye.Internal.Sql: orderBy :: From -> [(SqlExpr, SqlOrder)]
- Opaleye.Internal.Sql: tables :: From -> [Select]
- Opaleye.Internal.Sql: vAttrs :: Values -> SelectAttrs
- Opaleye.Internal.Sql: vValues :: Values -> [[SqlExpr]]
- Opaleye.Internal.Table: instance Applicative (TableProperties a)
- Opaleye.Internal.Table: instance Applicative (Writer a)
- Opaleye.Internal.Table: instance Functor (Table a)
- Opaleye.Internal.Table: instance Functor (TableProperties a)
- Opaleye.Internal.Table: instance Functor (Writer a)
- Opaleye.Internal.Table: instance Monoid (Zip a)
- Opaleye.Internal.Table: instance ProductProfunctor TableProperties
- Opaleye.Internal.Table: instance ProductProfunctor Writer
- Opaleye.Internal.Table: instance Profunctor TableProperties
- Opaleye.Internal.Table: instance Profunctor Writer
- Opaleye.Internal.Table: unZip :: Zip a -> NonEmpty [a]
- Opaleye.Internal.TableMaker: instance Applicative (ColumnMaker a)
- Opaleye.Internal.TableMaker: instance Applicative (ViewColumnMaker a)
- Opaleye.Internal.TableMaker: instance Default ColumnMaker (Column a) (Column a)
- Opaleye.Internal.TableMaker: instance Default ViewColumnMaker String (Column a)
- Opaleye.Internal.TableMaker: instance Functor (ColumnMaker a)
- Opaleye.Internal.TableMaker: instance Functor (ViewColumnMaker a)
- Opaleye.Internal.TableMaker: instance ProductProfunctor ColumnMaker
- Opaleye.Internal.TableMaker: instance ProductProfunctor ViewColumnMaker
- Opaleye.Internal.TableMaker: instance Profunctor ColumnMaker
- Opaleye.Internal.TableMaker: instance Profunctor ViewColumnMaker
- Opaleye.Internal.Tag: instance Read Tag
- Opaleye.Internal.Tag: instance Show Tag
- Opaleye.Internal.Unpackspec: instance Applicative (Unpackspec a)
- Opaleye.Internal.Unpackspec: instance Default Unpackspec (Column a) (Column a)
- Opaleye.Internal.Unpackspec: instance Functor (Unpackspec a)
- Opaleye.Internal.Unpackspec: instance ProductProfunctor Unpackspec
- Opaleye.Internal.Unpackspec: instance Profunctor Unpackspec
- Opaleye.Internal.Unpackspec: instance SumProfunctor Unpackspec
- Opaleye.Internal.Values: instance Applicative (Valuesspec a)
- Opaleye.Internal.Values: instance Default Valuesspec (Column PGInt4) (Column PGInt4)
- Opaleye.Internal.Values: instance Functor (Valuesspec a)
- Opaleye.Internal.Values: instance ProductProfunctor Valuesspec
- Opaleye.Internal.Values: instance Profunctor Valuesspec
- Opaleye.Order: instance PGOrd PGBool
- Opaleye.Order: instance PGOrd PGCitext
- Opaleye.Order: instance PGOrd PGDate
- Opaleye.Order: instance PGOrd PGFloat4
- Opaleye.Order: instance PGOrd PGFloat8
- Opaleye.Order: instance PGOrd PGInt2
- Opaleye.Order: instance PGOrd PGInt4
- Opaleye.Order: instance PGOrd PGInt8
- Opaleye.Order: instance PGOrd PGNumeric
- Opaleye.Order: instance PGOrd PGText
- Opaleye.Order: instance PGOrd PGTime
- Opaleye.Order: instance PGOrd PGTimestamp
- Opaleye.Order: instance PGOrd PGTimestamptz
- Opaleye.PGTypes: instance PGFractional PGFloat8
- Opaleye.PGTypes: instance PGNum PGFloat8
- Opaleye.PGTypes: instance PGNum PGInt4
- Opaleye.PGTypes: instance PGNum PGInt8
+ Opaleye.Constant: [constantExplicit] :: Constant haskells columns -> haskells -> columns
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Lazy.Text) (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGCitext)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Text) (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGCitext)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Aeson.Types.Internal.Value (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGJson)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Aeson.Types.Internal.Value (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGJsonb)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.ByteString.Internal.ByteString (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGBytea)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.ByteString.Internal.ByteString (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGJson)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.ByteString.Internal.ByteString (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGJsonb)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.ByteString.Lazy.Internal.ByteString (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGBytea)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.ByteString.Lazy.Internal.ByteString (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGJson)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.ByteString.Lazy.Internal.ByteString (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGJsonb)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Text.Internal.Lazy.Text (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGText)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Text.Internal.Text (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGText)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Time.Calendar.Days.Day (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGDate)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Time.Clock.UTC.UTCTime (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGTimestamptz)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Time.LocalTime.LocalTime.LocalTime (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGTimestamp)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.Time.LocalTime.TimeOfDay.TimeOfDay (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGTime)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant Data.UUID.Types.Internal.UUID (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGUuid)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant GHC.Base.String (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGText)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant GHC.Int.Int64 (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGInt8)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant GHC.Types.Bool (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGBool)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant GHC.Types.Double (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGFloat8)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant GHC.Types.Int (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGInt4)
+ Opaleye.Constant: instance Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant haskell (Opaleye.Internal.Column.Column sql) => Data.Profunctor.Product.Default.Default Opaleye.Constant.Constant (GHC.Base.Maybe haskell) (Opaleye.Internal.Column.Column (Opaleye.Internal.Column.Nullable sql))
+ Opaleye.Constant: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Constant.Constant
+ Opaleye.Constant: instance Data.Profunctor.Product.SumProfunctor Opaleye.Constant.Constant
+ Opaleye.Constant: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Constant.Constant
+ Opaleye.Constant: instance GHC.Base.Applicative (Opaleye.Constant.Constant a)
+ Opaleye.Constant: instance GHC.Base.Functor (Opaleye.Constant.Constant a)
+ Opaleye.Internal.Aggregate: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Aggregate.Aggregator
+ Opaleye.Internal.Aggregate: instance Data.Profunctor.Product.SumProfunctor Opaleye.Internal.Aggregate.Aggregator
+ Opaleye.Internal.Aggregate: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Aggregate.Aggregator
+ Opaleye.Internal.Aggregate: instance GHC.Base.Applicative (Opaleye.Internal.Aggregate.Aggregator a)
+ Opaleye.Internal.Aggregate: instance GHC.Base.Functor (Opaleye.Internal.Aggregate.Aggregator a)
+ Opaleye.Internal.Binary: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Binary.Binaryspec (Opaleye.Internal.Column.Column a) (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Binary: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Binary.Binaryspec
+ Opaleye.Internal.Binary: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Binary.Binaryspec
+ Opaleye.Internal.Binary: instance GHC.Base.Applicative (Opaleye.Internal.Binary.Binaryspec a)
+ Opaleye.Internal.Binary: instance GHC.Base.Functor (Opaleye.Internal.Binary.Binaryspec a)
+ Opaleye.Internal.Column: instance (Opaleye.Internal.Column.PGNum a, Opaleye.Internal.Column.PGFractional a) => GHC.Real.Fractional (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Column: instance GHC.Show.Show (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Column: instance Opaleye.Internal.Column.PGNum a => GHC.Num.Num (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Distinct: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Distinct.Distinctspec (Opaleye.Internal.Column.Column a) (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Distinct: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Distinct.Distinctspec
+ Opaleye.Internal.Distinct: instance Data.Profunctor.Product.SumProfunctor Opaleye.Internal.Distinct.Distinctspec
+ Opaleye.Internal.Distinct: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Distinct.Distinctspec
+ Opaleye.Internal.Distinct: instance GHC.Base.Applicative (Opaleye.Internal.Distinct.Distinctspec a)
+ Opaleye.Internal.Distinct: instance GHC.Base.Functor (Opaleye.Internal.Distinct.Distinctspec a)
+ Opaleye.Internal.HaskellDB.PrimQuery: [orderDirection] :: OrderOp -> OrderDirection
+ Opaleye.Internal.HaskellDB.PrimQuery: [orderNulls] :: OrderOp -> OrderNulls
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Read.Read Opaleye.Internal.HaskellDB.PrimQuery.AggrOp
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Read.Read Opaleye.Internal.HaskellDB.PrimQuery.BinOp
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Read.Read Opaleye.Internal.HaskellDB.PrimQuery.Literal
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Read.Read Opaleye.Internal.HaskellDB.PrimQuery.PrimExpr
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Read.Read Opaleye.Internal.HaskellDB.PrimQuery.Symbol
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Read.Read Opaleye.Internal.HaskellDB.PrimQuery.UnOp
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.AggrOp
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.BinOp
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.Literal
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.OrderDirection
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.OrderExpr
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.OrderNulls
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.OrderOp
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.PrimExpr
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.Symbol
+ Opaleye.Internal.HaskellDB.PrimQuery: instance GHC.Show.Show Opaleye.Internal.HaskellDB.PrimQuery.UnOp
+ Opaleye.Internal.HaskellDB.Sql: [sqlOrderDirection] :: SqlOrder -> SqlOrderDirection
+ Opaleye.Internal.HaskellDB.Sql: [sqlOrderNulls] :: SqlOrder -> SqlOrderNulls
+ Opaleye.Internal.HaskellDB.Sql: [sqlTableName] :: SqlTable -> String
+ Opaleye.Internal.HaskellDB.Sql: [sqlTableSchemaName] :: SqlTable -> Maybe String
+ Opaleye.Internal.HaskellDB.Sql: data SqlTable
+ Opaleye.Internal.HaskellDB.Sql: instance GHC.Show.Show Opaleye.Internal.HaskellDB.Sql.SqlColumn
+ Opaleye.Internal.HaskellDB.Sql: instance GHC.Show.Show Opaleye.Internal.HaskellDB.Sql.SqlExpr
+ Opaleye.Internal.HaskellDB.Sql: instance GHC.Show.Show Opaleye.Internal.HaskellDB.Sql.SqlOrder
+ Opaleye.Internal.HaskellDB.Sql: instance GHC.Show.Show Opaleye.Internal.HaskellDB.Sql.SqlOrderDirection
+ Opaleye.Internal.HaskellDB.Sql: instance GHC.Show.Show Opaleye.Internal.HaskellDB.Sql.SqlOrderNulls
+ Opaleye.Internal.HaskellDB.Sql: instance GHC.Show.Show Opaleye.Internal.HaskellDB.Sql.SqlTable
+ Opaleye.Internal.HaskellDB.Sql.Generate: [sqlDelete] :: SqlGenerator -> SqlTable -> [PrimExpr] -> SqlDelete
+ Opaleye.Internal.HaskellDB.Sql.Generate: [sqlExpr] :: SqlGenerator -> PrimExpr -> SqlExpr
+ Opaleye.Internal.HaskellDB.Sql.Generate: [sqlInsert] :: SqlGenerator -> SqlTable -> [Attribute] -> NonEmpty [PrimExpr] -> SqlInsert
+ Opaleye.Internal.HaskellDB.Sql.Generate: [sqlLiteral] :: SqlGenerator -> Literal -> String
+ Opaleye.Internal.HaskellDB.Sql.Generate: [sqlQuote] :: SqlGenerator -> String -> String
+ Opaleye.Internal.HaskellDB.Sql.Generate: [sqlUpdate] :: SqlGenerator -> SqlTable -> [PrimExpr] -> Assoc -> SqlUpdate
+ Opaleye.Internal.Join: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Join.NullMaker (Opaleye.Internal.Column.Column (Opaleye.Internal.Column.Nullable a)) (Opaleye.Internal.Column.Column (Opaleye.Internal.Column.Nullable a))
+ Opaleye.Internal.Join: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Join.NullMaker (Opaleye.Internal.Column.Column a) (Opaleye.Internal.Column.Column (Opaleye.Internal.Column.Nullable a))
+ Opaleye.Internal.Join: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Join.NullMaker
+ Opaleye.Internal.Join: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Join.NullMaker
+ Opaleye.Internal.Operators: (.&&) :: Column PGBool -> Column PGBool -> Column PGBool
+ Opaleye.Internal.Operators: (.==) :: Default EqPP columns columns => columns -> columns -> Column PGBool
+ Opaleye.Internal.Operators: EqPP :: (a -> a -> Column PGBool) -> EqPP a b
+ Opaleye.Internal.Operators: data EqPP a b
+ Opaleye.Internal.Operators: eqExplicit :: EqPP columns a -> columns -> columns -> Column PGBool
+ Opaleye.Internal.Operators: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Operators.EqPP (Opaleye.Internal.Column.Column a) (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Operators: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Operators.EqPP
+ Opaleye.Internal.Operators: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Operators.EqPP
+ Opaleye.Internal.Order: instance Data.Functor.Contravariant.Contravariant Opaleye.Internal.Order.Order
+ Opaleye.Internal.Order: instance Data.Functor.Contravariant.Divisible.Decidable Opaleye.Internal.Order.Order
+ Opaleye.Internal.Order: instance Data.Functor.Contravariant.Divisible.Divisible Opaleye.Internal.Order.Order
+ Opaleye.Internal.Order: instance Data.Semigroup.Semigroup (Opaleye.Internal.Order.Order a)
+ Opaleye.Internal.Order: instance GHC.Base.Monoid (Opaleye.Internal.Order.Order a)
+ Opaleye.Internal.PackMap: instance Data.Profunctor.Product.ProductProfunctor (Opaleye.Internal.PackMap.PackMap a b)
+ Opaleye.Internal.PackMap: instance Data.Profunctor.Product.SumProfunctor (Opaleye.Internal.PackMap.PackMap a b)
+ Opaleye.Internal.PackMap: instance Data.Profunctor.Unsafe.Profunctor (Opaleye.Internal.PackMap.PackMap a b)
+ Opaleye.Internal.PackMap: instance GHC.Base.Applicative (Opaleye.Internal.PackMap.PackMap a b s)
+ Opaleye.Internal.PackMap: instance GHC.Base.Functor (Opaleye.Internal.PackMap.PackMap a b s)
+ Opaleye.Internal.PrimQuery: TableIdentifier :: Maybe String -> String -> TableIdentifier
+ Opaleye.Internal.PrimQuery: [tiSchemaName] :: TableIdentifier -> Maybe String
+ Opaleye.Internal.PrimQuery: [tiTableName] :: TableIdentifier -> String
+ Opaleye.Internal.PrimQuery: data TableIdentifier
+ Opaleye.Internal.PrimQuery: instance GHC.Show.Show Opaleye.Internal.PrimQuery.BinOp
+ Opaleye.Internal.PrimQuery: instance GHC.Show.Show Opaleye.Internal.PrimQuery.JoinType
+ Opaleye.Internal.PrimQuery: instance GHC.Show.Show Opaleye.Internal.PrimQuery.LimitOp
+ Opaleye.Internal.PrimQuery: instance GHC.Show.Show Opaleye.Internal.PrimQuery.PrimQuery
+ Opaleye.Internal.PrimQuery: instance GHC.Show.Show Opaleye.Internal.PrimQuery.TableIdentifier
+ Opaleye.Internal.PrimQuery: tiToSqlTable :: TableIdentifier -> SqlTable
+ Opaleye.Internal.QueryArr: instance Control.Arrow.Arrow Opaleye.Internal.QueryArr.QueryArr
+ Opaleye.Internal.QueryArr: instance Control.Category.Category Opaleye.Internal.QueryArr.QueryArr
+ Opaleye.Internal.QueryArr: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.QueryArr.QueryArr
+ Opaleye.Internal.QueryArr: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.QueryArr.QueryArr
+ Opaleye.Internal.QueryArr: instance GHC.Base.Applicative (Opaleye.Internal.QueryArr.QueryArr a)
+ Opaleye.Internal.QueryArr: instance GHC.Base.Functor (Opaleye.Internal.QueryArr.QueryArr a)
+ Opaleye.Internal.RunQuery: instance (Data.Typeable.Internal.Typeable b, Opaleye.Internal.RunQuery.QueryRunnerColumnDefault a b) => Opaleye.Internal.RunQuery.QueryRunnerColumnDefault (Opaleye.PGTypes.PGArray a) [b]
+ Opaleye.Internal.RunQuery: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.RunQuery.QueryRunner
+ Opaleye.Internal.RunQuery: instance Data.Profunctor.Product.SumProfunctor Opaleye.Internal.RunQuery.QueryRunner
+ Opaleye.Internal.RunQuery: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.RunQuery.QueryRunner
+ Opaleye.Internal.RunQuery: instance GHC.Base.Applicative (Opaleye.Internal.RunQuery.QueryRunner c)
+ Opaleye.Internal.RunQuery: instance GHC.Base.Functor (Opaleye.Internal.RunQuery.QueryRunner c)
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGBool GHC.Types.Bool
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGBytea Data.ByteString.Internal.ByteString
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGBytea Data.ByteString.Lazy.Internal.ByteString
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGCitext (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Lazy.Text)
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGCitext (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Text)
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGDate Data.Time.Calendar.Days.Day
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGFloat8 GHC.Types.Double
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGInt4 GHC.Types.Int
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGInt8 GHC.Int.Int64
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGJson Data.Aeson.Types.Internal.Value
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGJson GHC.Base.String
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGJsonb Data.Aeson.Types.Internal.Value
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGJsonb GHC.Base.String
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGText Data.Text.Internal.Lazy.Text
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGText Data.Text.Internal.Text
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGText GHC.Base.String
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGTime Data.Time.LocalTime.TimeOfDay.TimeOfDay
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGTimestamp Data.Time.LocalTime.LocalTime.LocalTime
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGTimestamptz Data.Time.Clock.UTC.UTCTime
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault Opaleye.PGTypes.PGUuid Data.UUID.Types.Internal.UUID
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault a b => Data.Profunctor.Product.Default.Default Opaleye.Internal.RunQuery.QueryRunner (Opaleye.Internal.Column.Column a) b
+ Opaleye.Internal.RunQuery: instance Opaleye.Internal.RunQuery.QueryRunnerColumnDefault a b => Opaleye.Internal.RunQuery.QueryRunnerColumnDefault (Opaleye.Internal.Column.Nullable a) (GHC.Base.Maybe b)
+ Opaleye.Internal.Sql: [attrs] :: From -> SelectAttrs
+ Opaleye.Internal.Sql: [bOp] :: Binary -> BinOp
+ Opaleye.Internal.Sql: [bSelect1] :: Binary -> Select
+ Opaleye.Internal.Sql: [bSelect2] :: Binary -> Select
+ Opaleye.Internal.Sql: [criteria] :: From -> [SqlExpr]
+ Opaleye.Internal.Sql: [groupBy] :: From -> Maybe (NonEmpty SqlExpr)
+ Opaleye.Internal.Sql: [jCond] :: Join -> SqlExpr
+ Opaleye.Internal.Sql: [jJoinType] :: Join -> JoinType
+ Opaleye.Internal.Sql: [jTables] :: Join -> (Select, Select)
+ Opaleye.Internal.Sql: [limit] :: From -> Maybe Int
+ Opaleye.Internal.Sql: [offset] :: From -> Maybe Int
+ Opaleye.Internal.Sql: [orderBy] :: From -> [(SqlExpr, SqlOrder)]
+ Opaleye.Internal.Sql: [tables] :: From -> [Select]
+ Opaleye.Internal.Sql: [vAttrs] :: Values -> SelectAttrs
+ Opaleye.Internal.Sql: [vValues] :: Values -> [[SqlExpr]]
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.BinOp
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.Binary
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.From
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.Join
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.JoinType
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.Select
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.SelectAttrs
+ Opaleye.Internal.Sql: instance GHC.Show.Show Opaleye.Internal.Sql.Values
+ Opaleye.Internal.Table: TableWithSchema :: String -> String -> (TableProperties writerColumns viewColumns) -> Table writerColumns viewColumns
+ Opaleye.Internal.Table: [tablePropertiesView] :: TableProperties writerColumns viewColumns -> View viewColumns
+ Opaleye.Internal.Table: [tablePropertiesWriter] :: TableProperties writerColumns viewColumns -> Writer writerColumns viewColumns
+ Opaleye.Internal.Table: [unZip] :: Zip a -> NonEmpty [a]
+ Opaleye.Internal.Table: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Table.TableProperties
+ Opaleye.Internal.Table: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Table.Writer
+ Opaleye.Internal.Table: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Table.TableProperties
+ Opaleye.Internal.Table: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Table.Writer
+ Opaleye.Internal.Table: instance GHC.Base.Applicative (Opaleye.Internal.Table.TableProperties a)
+ Opaleye.Internal.Table: instance GHC.Base.Applicative (Opaleye.Internal.Table.Writer a)
+ Opaleye.Internal.Table: instance GHC.Base.Functor (Opaleye.Internal.Table.Table a)
+ Opaleye.Internal.Table: instance GHC.Base.Functor (Opaleye.Internal.Table.TableProperties a)
+ Opaleye.Internal.Table: instance GHC.Base.Functor (Opaleye.Internal.Table.Writer a)
+ Opaleye.Internal.Table: instance GHC.Base.Monoid (Opaleye.Internal.Table.Zip a)
+ Opaleye.Internal.Table: tableIdentifier :: Table writerColumns viewColumns -> TableIdentifier
+ Opaleye.Internal.Table: tableProperties :: Table writerColumns viewColumns -> TableProperties writerColumns viewColumns
+ Opaleye.Internal.TableMaker: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.TableMaker.ColumnMaker (Opaleye.Internal.Column.Column a) (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.TableMaker: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.TableMaker.ViewColumnMaker GHC.Base.String (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.TableMaker: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.TableMaker.ColumnMaker
+ Opaleye.Internal.TableMaker: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.TableMaker.ViewColumnMaker
+ Opaleye.Internal.TableMaker: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.TableMaker.ColumnMaker
+ Opaleye.Internal.TableMaker: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.TableMaker.ViewColumnMaker
+ Opaleye.Internal.TableMaker: instance GHC.Base.Applicative (Opaleye.Internal.TableMaker.ColumnMaker a)
+ Opaleye.Internal.TableMaker: instance GHC.Base.Applicative (Opaleye.Internal.TableMaker.ViewColumnMaker a)
+ Opaleye.Internal.TableMaker: instance GHC.Base.Functor (Opaleye.Internal.TableMaker.ColumnMaker a)
+ Opaleye.Internal.TableMaker: instance GHC.Base.Functor (Opaleye.Internal.TableMaker.ViewColumnMaker a)
+ Opaleye.Internal.Tag: instance GHC.Read.Read Opaleye.Internal.Tag.Tag
+ Opaleye.Internal.Tag: instance GHC.Show.Show Opaleye.Internal.Tag.Tag
+ Opaleye.Internal.Unpackspec: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Unpackspec.Unpackspec (Opaleye.Internal.Column.Column a) (Opaleye.Internal.Column.Column a)
+ Opaleye.Internal.Unpackspec: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Unpackspec.Unpackspec
+ Opaleye.Internal.Unpackspec: instance Data.Profunctor.Product.SumProfunctor Opaleye.Internal.Unpackspec.Unpackspec
+ Opaleye.Internal.Unpackspec: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Unpackspec.Unpackspec
+ Opaleye.Internal.Unpackspec: instance GHC.Base.Applicative (Opaleye.Internal.Unpackspec.Unpackspec a)
+ Opaleye.Internal.Unpackspec: instance GHC.Base.Functor (Opaleye.Internal.Unpackspec.Unpackspec a)
+ Opaleye.Internal.Values: instance Data.Profunctor.Product.Default.Default Opaleye.Internal.Values.Valuesspec (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGInt4) (Opaleye.Internal.Column.Column Opaleye.PGTypes.PGInt4)
+ Opaleye.Internal.Values: instance Data.Profunctor.Product.ProductProfunctor Opaleye.Internal.Values.Valuesspec
+ Opaleye.Internal.Values: instance Data.Profunctor.Unsafe.Profunctor Opaleye.Internal.Values.Valuesspec
+ Opaleye.Internal.Values: instance GHC.Base.Applicative (Opaleye.Internal.Values.Valuesspec a)
+ Opaleye.Internal.Values: instance GHC.Base.Functor (Opaleye.Internal.Values.Valuesspec a)
+ Opaleye.Operators: (./==) :: Default EqPP columns columns => columns -> columns -> Column PGBool
+ Opaleye.Operators: (.===) :: Default EqPP columns columns => columns -> columns -> Column PGBool
+ Opaleye.Operators: keepWhen :: (a -> Column PGBool) -> QueryArr a a
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGBool
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGCitext
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGDate
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGFloat4
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGFloat8
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGInt2
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGInt4
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGInt8
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGNumeric
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGText
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGTime
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGTimestamp
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGTimestamptz
+ Opaleye.Order: instance Opaleye.Order.PGOrd Opaleye.PGTypes.PGUuid
+ Opaleye.PGTypes: instance Opaleye.Internal.Column.PGFractional Opaleye.PGTypes.PGFloat8
+ Opaleye.PGTypes: instance Opaleye.Internal.Column.PGNum Opaleye.PGTypes.PGFloat8
+ Opaleye.PGTypes: instance Opaleye.Internal.Column.PGNum Opaleye.PGTypes.PGInt4
+ Opaleye.PGTypes: instance Opaleye.Internal.Column.PGNum Opaleye.PGTypes.PGInt8
+ Opaleye.PGTypes: pgValueJSON :: ToJSON a => a -> Column PGJson
+ Opaleye.PGTypes: pgValueJSONB :: ToJSON a => a -> Column PGJsonb
+ Opaleye.Table: TableWithSchema :: String -> String -> (TableProperties writerColumns viewColumns) -> Table writerColumns viewColumns
- Opaleye.Internal.HaskellDB.Sql: SqlTable :: String -> SqlTable
+ Opaleye.Internal.HaskellDB.Sql: SqlTable :: Maybe String -> String -> SqlTable
- Opaleye.Internal.HaskellDB.Sql.Default: defaultSqlDelete :: SqlGenerator -> TableName -> [PrimExpr] -> SqlDelete
+ Opaleye.Internal.HaskellDB.Sql.Default: defaultSqlDelete :: SqlGenerator -> SqlTable -> [PrimExpr] -> SqlDelete
- Opaleye.Internal.HaskellDB.Sql.Default: defaultSqlInsert :: SqlGenerator -> TableName -> [Attribute] -> NonEmpty [PrimExpr] -> SqlInsert
+ Opaleye.Internal.HaskellDB.Sql.Default: defaultSqlInsert :: SqlGenerator -> SqlTable -> [Attribute] -> NonEmpty [PrimExpr] -> SqlInsert
- Opaleye.Internal.HaskellDB.Sql.Default: defaultSqlUpdate :: SqlGenerator -> TableName -> [PrimExpr] -> Assoc -> SqlUpdate
+ Opaleye.Internal.HaskellDB.Sql.Default: defaultSqlUpdate :: SqlGenerator -> SqlTable -> [PrimExpr] -> Assoc -> SqlUpdate
- Opaleye.Internal.HaskellDB.Sql.Generate: SqlGenerator :: (TableName -> [PrimExpr] -> Assoc -> SqlUpdate) -> (TableName -> [PrimExpr] -> SqlDelete) -> (TableName -> [Attribute] -> NonEmpty [PrimExpr] -> SqlInsert) -> (PrimExpr -> SqlExpr) -> (Literal -> String) -> (String -> String) -> SqlGenerator
+ Opaleye.Internal.HaskellDB.Sql.Generate: SqlGenerator :: (SqlTable -> [PrimExpr] -> Assoc -> SqlUpdate) -> (SqlTable -> [PrimExpr] -> SqlDelete) -> (SqlTable -> [Attribute] -> NonEmpty [PrimExpr] -> SqlInsert) -> (PrimExpr -> SqlExpr) -> (Literal -> String) -> (String -> String) -> SqlGenerator
- Opaleye.Internal.PrimQuery: BaseTable :: String -> [(Symbol, PrimExpr)] -> PrimQuery
+ Opaleye.Internal.PrimQuery: BaseTable :: TableIdentifier -> [(Symbol, PrimExpr)] -> PrimQuery
- Opaleye.Internal.PrimQuery: type PrimQueryFold p = (p, String -> [(Symbol, PrimExpr)] -> p, NonEmpty p -> [PrimExpr] -> p, [(Symbol, (Maybe AggrOp, PrimExpr))] -> p -> p, [OrderExpr] -> p -> p, LimitOp -> p -> p, JoinType -> PrimExpr -> p -> p -> p, [Symbol] -> [[PrimExpr]] -> p, BinOp -> [(Symbol, (PrimExpr, PrimExpr))] -> (p, p) -> p)
+ Opaleye.Internal.PrimQuery: type PrimQueryFold p = (p, TableIdentifier -> [(Symbol, PrimExpr)] -> p, NonEmpty p -> [PrimExpr] -> p, [(Symbol, (Maybe AggrOp, PrimExpr))] -> p -> p, [OrderExpr] -> p -> p, LimitOp -> p -> p, JoinType -> PrimExpr -> p -> p -> p, [Symbol] -> [[PrimExpr]] -> p, BinOp -> [(Symbol, (PrimExpr, PrimExpr))] -> (p, p) -> p)
- Opaleye.Internal.Sql: baseTable :: String -> [(Symbol, PrimExpr)] -> Select
+ Opaleye.Internal.Sql: baseTable :: TableIdentifier -> [(Symbol, PrimExpr)] -> Select
- Opaleye.Internal.Table: TableProperties :: (Writer writerColumns viewColumns) -> (View viewColumns) -> TableProperties writerColumns viewColumns
+ Opaleye.Internal.Table: TableProperties :: Writer writerColumns viewColumns -> View viewColumns -> TableProperties writerColumns viewColumns
- Opaleye.Manipulation: runInsertReturning :: Default QueryRunner returned haskells => Connection -> Table columnsW columnsR -> columnsW -> (columnsR -> returned) -> IO [haskells]
+ Opaleye.Manipulation: runInsertReturning :: (Default QueryRunner returned haskells) => Connection -> Table columnsW columnsR -> columnsW -> (columnsR -> returned) -> IO [haskells]
- Opaleye.Manipulation: runUpdateReturning :: Default QueryRunner returned haskells => Connection -> Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column PGBool) -> (columnsR -> returned) -> IO [haskells]
+ Opaleye.Manipulation: runUpdateReturning :: (Default QueryRunner returned haskells) => Connection -> Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column PGBool) -> (columnsR -> returned) -> IO [haskells]
Files
- CHANGELOG.md +7/−0
- Doc/Tutorial/TutorialBasic.lhs +4/−0
- README.md +7/−2
- Test/Test.hs +5/−5
- opaleye.cabal +6/−4
- src/Opaleye/Constant.hs +7/−0
- src/Opaleye/Internal/Column.hs +2/−3
- src/Opaleye/Internal/HaskellDB/Sql.hs +4/−1
- src/Opaleye/Internal/HaskellDB/Sql/Default.hs +8/−8
- src/Opaleye/Internal/HaskellDB/Sql/Generate.hs +3/−3
- src/Opaleye/Internal/HaskellDB/Sql/Print.hs +7/−3
- src/Opaleye/Internal/Operators.hs +42/−0
- src/Opaleye/Internal/PrimQuery.hs +14/−3
- src/Opaleye/Internal/RunQuery.hs +7/−0
- src/Opaleye/Internal/Sql.hs +3/−5
- src/Opaleye/Internal/Table.hs +21/−7
- src/Opaleye/Manipulation.hs +127/−85
- src/Opaleye/Operators.hs +41/−9
- src/Opaleye/Order.hs +1/−0
- src/Opaleye/PGTypes.hs +7/−0
- src/Opaleye/Table.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,10 @@+## 0.4.2.0++* Added `.===` and `./==` for comparison of product types+* Added `keepWhen` as an alternative to `restrict`+* Added `constant` conversion to and from Aeson+* Added `pgValueJSON` and `pgValueJSONB`+ ## 0.4.1.0 * Added `Opaleye.Constant` for lifting constant values
Doc/Tutorial/TutorialBasic.lhs view
@@ -64,6 +64,10 @@ > , required "age" > , required "address" )) +By default, the table `"personTable"` is looked up in PostgreSQL's+default `"public"` schema. If we wanted to specify a different schema we+could have used the `TableWithSchema` constructor instead of `Table`.+ To query a table we use `queryTable`. (Here and in a few other places in Opaleye there is some typeclass
README.md view
@@ -20,12 +20,17 @@ composable at a very fine level of granularity, promoting code reuse and high levels of abstraction. +## Getting Opaleye++* Github: https://github.com/tomjaguarpaw/haskell-opaleye+* Hackage: https://hackage.haskell.org/package/opaleye+ ## Tutorials Please get started with Opaleye by referring to these two tutorials -* [Basic tutorial](Doc/Tutorial/TutorialBasic.lhs)-* [Manipulation tutorial](Doc/Tutorial/TutorialManipulation.lhs)+* [Basic tutorial](https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/Doc/Tutorial/TutorialBasic.lhs)+* [Manipulation tutorial](https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/Doc/Tutorial/TutorialManipulation.lhs) # Contact
Test/Test.hs view
@@ -137,7 +137,7 @@ table5 :: O.Table (Maybe (Column O.PGInt4), Maybe (Column O.PGInt4)) (Column O.PGInt4, Column O.PGInt4)-table5 = O.Table "table5" (PP.p2 (O.optional "column1", O.optional "column2"))+table5 = O.TableWithSchema "public" "table5" (PP.p2 (O.optional "column1", O.optional "column2")) table6 :: O.Table (Column O.PGText, Column O.PGText) (Column O.PGText, Column O.PGText) table6 = O.Table "table6" (PP.p2 (O.required "column1", O.required "column2"))@@ -209,8 +209,8 @@ -- table names are treated as lower case unless the name is quoted! dropAndCreateTable :: String -> (String, [String]) -> PGS.Query dropAndCreateTable columnType (t, cols) = String.fromString drop_- where drop_ = "DROP TABLE IF EXISTS \"" ++ t ++ "\";"- ++ "CREATE TABLE \"" ++ t ++ "\""+ where drop_ = "DROP TABLE IF EXISTS \"public\".\"" ++ t ++ "\";"+ ++ "CREATE TABLE \"public\".\"" ++ t ++ "\"" ++ " (" ++ commas cols ++ ");" integer c = ("\"" ++ c ++ "\"" ++ " " ++ columnType) commas = L.intercalate "," . map integer@@ -225,8 +225,8 @@ -- table names are treated as lower case unless the name is quoted! dropAndCreateTableSerial :: (String, [String]) -> PGS.Query dropAndCreateTableSerial (t, cols) = String.fromString drop_- where drop_ = "DROP TABLE IF EXISTS \"" ++ t ++ "\";"- ++ "CREATE TABLE \"" ++ t ++ "\""+ where drop_ = "DROP TABLE IF EXISTS \"public\".\"" ++ t ++ "\";"+ ++ "CREATE TABLE \"public\".\"" ++ t ++ "\"" ++ " (" ++ commas cols ++ ");" integer c = ("\"" ++ c ++ "\"" ++ " SERIAL") commas = L.intercalate "," . map integer
opaleye.cabal view
@@ -1,6 +1,6 @@ name: opaleye copyright: Copyright (c) 2014-2015 Purely Agile Limited-version: 0.4.1.0+version: 0.4.2.0 synopsis: An SQL-generating DSL targeting PostgreSQL description: An SQL-generating DSL targeting PostgreSQL. Allows Postgres queries to be written within Haskell in a@@ -27,17 +27,18 @@ build-depends: -- attoparsec can be removed once postgresql-simple patch in -- Internal.RunQuery is merged upstream- attoparsec >= 0.10.3 && < 0.14+ aeson >= 0.6 && < 0.11+ , attoparsec >= 0.10.3 && < 0.14 , base >= 4 && < 5 , base16-bytestring >= 0.1.1.6 && < 0.2 , case-insensitive >= 1.2 && < 1.3 , bytestring >= 0.10 && < 0.11 , contravariant >= 1.2 && < 1.4- , postgresql-simple >= 0.4.8.0 && < 0.5+ , postgresql-simple >= 0.4.8.0 && < 0.6 , pretty >= 1.1.1.0 && < 1.2 , product-profunctors >= 0.6.2 && < 0.7 , profunctors >= 4.0 && < 5.2- , semigroups >= 0.13 && < 0.17+ , semigroups >= 0.13 && < 0.18 , text >= 0.11 && < 1.3 , transformers >= 0.3 && < 0.5 , time >= 1.4 && < 1.6@@ -67,6 +68,7 @@ Opaleye.Internal.Helpers, Opaleye.Internal.Join, Opaleye.Internal.Order,+ Opaleye.Internal.Operators, Opaleye.Internal.Optimize, Opaleye.Internal.PackMap, Opaleye.Internal.PGTypes,
src/Opaleye/Constant.hs view
@@ -6,6 +6,7 @@ import qualified Opaleye.Column as C import qualified Opaleye.PGTypes as T +import qualified Data.Aeson as Ae import qualified Data.CaseInsensitive as CI import qualified Data.Int as Int import qualified Data.Text as ST@@ -89,11 +90,17 @@ instance D.Default Constant LBS.ByteString (Column T.PGJson) where def = Constant T.pgLazyJSON +instance D.Default Constant Ae.Value (Column T.PGJson) where+ def = Constant T.pgValueJSON+ instance D.Default Constant SBS.ByteString (Column T.PGJsonb) where def = Constant T.pgStrictJSONB instance D.Default Constant LBS.ByteString (Column T.PGJsonb) where def = Constant T.pgLazyJSONB++instance D.Default Constant Ae.Value (Column T.PGJsonb) where+ def = Constant T.pgValueJSONB -- { Boilerplate instances
src/Opaleye/Internal/Column.hs view
@@ -2,9 +2,8 @@ import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ --- | The 'Num' and 'Fractional' instances for 'Column' 'a' are too--- general. For example, they allow you to add two 'Column'--- 'String's. This will be fixed in a subsequent release.+-- | Numeric 'Column' types are instances of 'Num', so you can use+-- '*', '/', '+', '-' on them. newtype Column a = Column HPQ.PrimExpr deriving Show data Nullable a = Nullable
src/Opaleye/Internal/HaskellDB/Sql.hs view
@@ -11,7 +11,10 @@ -- * SQL data type ----------------------------------------------------------- -newtype SqlTable = SqlTable String deriving Show+data SqlTable = SqlTable+ { sqlTableSchemaName :: Maybe String+ , sqlTableName :: String+ } deriving Show newtype SqlColumn = SqlColumn String deriving Show
src/Opaleye/Internal/HaskellDB/Sql/Default.hs view
@@ -50,29 +50,29 @@ defaultSqlUpdate :: SqlGenerator- -> TableName -- ^ Name of the table to update.+ -> SqlTable -- ^ Table to update -> [PrimExpr] -- ^ Conditions which must all be true for a row -- to be updated. -> Assoc -- ^ Update the data with this. -> SqlUpdate-defaultSqlUpdate gen name criteria assigns- = SqlUpdate (SqlTable name) (toSqlAssoc gen assigns) (map (sqlExpr gen) criteria)+defaultSqlUpdate gen tbl criteria assigns+ = SqlUpdate tbl (toSqlAssoc gen assigns) (map (sqlExpr gen) criteria) defaultSqlInsert :: SqlGenerator- -> TableName+ -> SqlTable -> [Attribute] -> NEL.NonEmpty [PrimExpr] -> SqlInsert-defaultSqlInsert gen name attrs exprs =- SqlInsert (SqlTable name) (map toSqlColumn attrs) ((fmap . map) (sqlExpr gen) exprs)+defaultSqlInsert gen tbl attrs exprs =+ SqlInsert tbl (map toSqlColumn attrs) ((fmap . map) (sqlExpr gen) exprs) defaultSqlDelete :: SqlGenerator- -> TableName -- ^ Name of the table+ -> SqlTable -> [PrimExpr] -- ^ Criteria which must all be true for a row -- to be deleted. -> SqlDelete-defaultSqlDelete gen name criteria = SqlDelete (SqlTable name) (map (sqlExpr gen) criteria)+defaultSqlDelete gen tbl criteria = SqlDelete tbl (map (sqlExpr gen) criteria) defaultSqlExpr :: SqlGenerator -> PrimExpr -> SqlExpr
src/Opaleye/Internal/HaskellDB/Sql/Generate.hs view
@@ -11,9 +11,9 @@ data SqlGenerator = SqlGenerator {- sqlUpdate :: TableName -> [PrimExpr] -> Assoc -> SqlUpdate,- sqlDelete :: TableName -> [PrimExpr] -> SqlDelete,- sqlInsert :: TableName -> [Attribute] -> NEL.NonEmpty [PrimExpr] -> SqlInsert,+ sqlUpdate :: SqlTable -> [PrimExpr] -> Assoc -> SqlUpdate,+ sqlDelete :: SqlTable -> [PrimExpr] -> SqlDelete,+ sqlInsert :: SqlTable -> [Attribute] -> NEL.NonEmpty [PrimExpr] -> SqlInsert, sqlExpr :: PrimExpr -> SqlExpr, sqlLiteral :: Literal -> String, -- | Turn a string into a quoted string. Quote characters
src/Opaleye/Internal/HaskellDB/Sql/Print.hs view
@@ -104,10 +104,14 @@ ppColumn :: SqlColumn -> Doc ppColumn (SqlColumn s) = doubleQuotes (text s) --- Postgres treats upper case letters in table names as lower case,--- unless the name is quoted!+-- Postgres treats schema and table names as lower case unless quoted. ppTable :: SqlTable -> Doc-ppTable (SqlTable s) = doubleQuotes (text s)+ppTable st = case sqlTableSchemaName st of+ Just sn -> doubleQuotes (text sn) <> text "." <> tname+ Nothing -> tname+ where+ tname = doubleQuotes (text (sqlTableName st))+ ppSqlExpr :: SqlExpr -> Doc ppSqlExpr expr =
+ src/Opaleye/Internal/Operators.hs view
@@ -0,0 +1,42 @@+{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-}+{-# LANGUAGE ScopedTypeVariables #-}++module Opaleye.Internal.Operators where++import Opaleye.Internal.Column (Column)+import qualified Opaleye.Internal.Column as C+import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ+import qualified Opaleye.PGTypes as T++import Data.Profunctor (Profunctor, dimap)+import Data.Profunctor.Product (ProductProfunctor, empty, (***!))+import qualified Data.Profunctor.Product.Default as D++infix 4 .==+(.==) :: forall columns. D.Default EqPP columns columns+ => columns -> columns -> Column T.PGBool+(.==) = eqExplicit (D.def :: EqPP columns columns)++infixr 3 .&&+(.&&) :: Column T.PGBool -> Column T.PGBool -> Column T.PGBool+(.&&) = C.binOp HPQ.OpAnd++data EqPP a b = EqPP (a -> a -> Column T.PGBool)++eqExplicit :: EqPP columns a -> columns -> columns -> Column T.PGBool+eqExplicit (EqPP f) = f++instance D.Default EqPP (Column a) (Column a) where+ def = EqPP C.unsafeEq++-- { Boilerplate instances++instance Profunctor EqPP where+ dimap f _ (EqPP h) = EqPP (\a a' -> h (f a) (f a'))++instance ProductProfunctor EqPP where+ empty = EqPP (\() () -> T.pgBool True)+ EqPP f ***! EqPP f' = EqPP (\a a' ->+ f (fst a) (fst a') .&& f' (snd a) (snd a'))++-- }
src/Opaleye/Internal/PrimQuery.hs view
@@ -3,6 +3,7 @@ import Prelude hiding (product) import qualified Data.List.NonEmpty as NEL+import qualified Opaleye.Internal.HaskellDB.Sql as HSql import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ import Opaleye.Internal.HaskellDB.PrimQuery (Symbol) @@ -12,13 +13,23 @@ data BinOp = Except | Union | UnionAll deriving Show data JoinType = LeftJoin deriving Show +data TableIdentifier = TableIdentifier+ { tiSchemaName :: Maybe String+ , tiTableName :: String+ } deriving Show++tiToSqlTable :: TableIdentifier -> HSql.SqlTable+tiToSqlTable ti = HSql.SqlTable { HSql.sqlTableSchemaName = tiSchemaName ti+ , HSql.sqlTableName = tiTableName ti }++ -- In the future it may make sense to introduce this datatype -- type Bindings a = [(Symbol, a)] -- We use a 'NEL.NonEmpty' for Product because otherwise we'd have to check -- for emptiness explicity in the SQL generation phase. data PrimQuery = Unit- | BaseTable String [(Symbol, HPQ.PrimExpr)]+ | BaseTable TableIdentifier [(Symbol, HPQ.PrimExpr)] | Product (NEL.NonEmpty PrimQuery) [HPQ.PrimExpr] | Aggregate [(Symbol, (Maybe HPQ.AggrOp, HPQ.PrimExpr))] PrimQuery | Order [HPQ.OrderExpr] PrimQuery@@ -29,7 +40,7 @@ deriving Show type PrimQueryFold p = ( p- , String -> [(Symbol, HPQ.PrimExpr)] -> p+ , TableIdentifier -> [(Symbol, HPQ.PrimExpr)] -> p , NEL.NonEmpty p -> [HPQ.PrimExpr] -> p , [(Symbol, (Maybe HPQ.AggrOp, HPQ.PrimExpr))] -> p -> p , [HPQ.OrderExpr] -> p -> p@@ -44,7 +55,7 @@ binary) = fix fold where fold self primQ = case primQ of Unit -> unit- BaseTable n s -> baseTable n s+ BaseTable ti syms -> baseTable ti syms Product pqs pes -> product (fmap self pqs) pes Aggregate aggrs pq -> aggregate aggrs (self pq) Order pes pq -> order pes (self pq)
src/Opaleye/Internal/RunQuery.hs view
@@ -24,6 +24,7 @@ import Data.Profunctor.Product (empty, (***!)) import qualified Data.Profunctor.Product.Default as D +import qualified Data.Aeson as Ae import qualified Data.CaseInsensitive as CI import qualified Data.Text as ST import qualified Data.Text.Lazy as LT@@ -173,9 +174,15 @@ queryRunnerColumnDefault = QueryRunnerColumn (P.rmap (const ()) U.unpackspecColumn) jsonFieldParser +instance QueryRunnerColumnDefault T.PGJson Ae.Value where+ queryRunnerColumnDefault = fieldQueryRunnerColumn+ instance QueryRunnerColumnDefault T.PGJsonb String where queryRunnerColumnDefault = QueryRunnerColumn (P.rmap (const ()) U.unpackspecColumn) jsonbFieldParser++instance QueryRunnerColumnDefault T.PGJsonb Ae.Value where+ queryRunnerColumnDefault = fieldQueryRunnerColumn -- No CI String instance since postgresql-simple doesn't define FromField (CI String)
src/Opaleye/Internal/Sql.hs view
@@ -61,8 +61,6 @@ data JoinType = LeftJoin deriving Show data BinOp = Except | Union | UnionAll deriving Show -data TableName = String- data Returning a = Returning a (NEL.NonEmpty HSql.SqlExpr) sqlQueryGenerator :: PQ.PrimQueryFold Select@@ -79,10 +77,10 @@ unit :: Select unit = SelectFrom newSelect { attrs = SelectAttrs (ensureColumns []) } -baseTable :: String -> [(Symbol, HPQ.PrimExpr)] -> Select-baseTable name columns = SelectFrom $+baseTable :: PQ.TableIdentifier -> [(Symbol, HPQ.PrimExpr)] -> Select+baseTable ti columns = SelectFrom $ newSelect { attrs = SelectAttrs (ensureColumns (map sqlBinding columns))- , tables = [Table (HSql.SqlTable name)] }+ , tables = [Table (HSql.SqlTable (PQ.tiSchemaName ti) (PQ.tiTableName ti))] } product :: NEL.NonEmpty Select -> [HPQ.PrimExpr] -> Select product ss pes = SelectFrom $
src/Opaleye/Internal/Table.hs view
@@ -45,12 +45,25 @@ -- , quantity = required \"quantity\" -- , radius = required \"radius\" }) -- @-data Table writerColumns viewColumns =- Table String (TableProperties writerColumns viewColumns)+data Table writerColumns viewColumns+ = Table String (TableProperties writerColumns viewColumns)+ -- ^ Uses the default schema name (@"public"@).+ | TableWithSchema String String (TableProperties writerColumns viewColumns)+ -- ^ Schema name (@"public"@ by default in PostgreSQL), table name,+ -- table properties. -data TableProperties writerColumns viewColumns =- TableProperties (Writer writerColumns viewColumns) (View viewColumns)+tableIdentifier :: Table writerColumns viewColumns -> PQ.TableIdentifier+tableIdentifier (Table t _) = PQ.TableIdentifier Nothing t+tableIdentifier (TableWithSchema s t _) = PQ.TableIdentifier (Just s) t +tableProperties :: Table writerColumns viewColumns -> TableProperties writerColumns viewColumns+tableProperties (Table _ p) = p+tableProperties (TableWithSchema _ _ p) = p++data TableProperties writerColumns viewColumns = TableProperties+ { tablePropertiesWriter :: Writer writerColumns viewColumns+ , tablePropertiesView :: View viewColumns }+ data View columns = View columns -- There's no reason the second parameter should exist except that we@@ -71,10 +84,10 @@ -> Tag.Tag -> (columns, PQ.PrimQuery) queryTable cm table tag = (primExprs, primQ) where- (Table tableName (TableProperties _ (View tableCols))) = table+ View tableCols = tablePropertiesView (tableProperties table) (primExprs, projcols) = runColumnMaker cm tag tableCols primQ :: PQ.PrimQuery- primQ = PQ.BaseTable tableName projcols+ primQ = PQ.BaseTable (tableIdentifier table) projcols runColumnMaker :: TM.ColumnMaker tablecolumns columns -> Tag.Tag@@ -158,6 +171,7 @@ (***!) = PP.defaultProfunctorProduct instance Functor (Table a) where- fmap f (Table s tp) = Table s (fmap f tp)+ fmap f (Table t tp) = Table t (fmap f tp)+ fmap f (TableWithSchema s t tp) = TableWithSchema s t (fmap f tp) -- }
src/Opaleye/Manipulation.hs view
@@ -11,6 +11,7 @@ import qualified Opaleye.Internal.Table as TI import Opaleye.Internal.Column (Column(Column)) import Opaleye.Internal.Helpers ((.:), (.:.), (.::), (.::.))+import qualified Opaleye.Internal.PrimQuery as PQ import qualified Opaleye.Internal.Unpackspec as U import Opaleye.PGTypes (PGBool) @@ -27,24 +28,9 @@ import Data.String (fromString) import qualified Data.List.NonEmpty as NEL -arrangeInsert :: T.Table columns a -> columns -> HSql.SqlInsert-arrangeInsert t c = arrangeInsertMany t (return c)--arrangeInsertSql :: T.Table columns a -> columns -> String-arrangeInsertSql = show . HPrint.ppInsert .: arrangeInsert- runInsert :: PGS.Connection -> T.Table columns columns' -> columns -> IO Int64 runInsert conn = PGS.execute_ conn . fromString .: arrangeInsertSql -arrangeInsertMany :: T.Table columns a -> NEL.NonEmpty columns -> HSql.SqlInsert-arrangeInsertMany (T.Table tableName (TI.TableProperties writer _)) columns = insert- where (columnExprs, columnNames) = TI.runWriter' writer columns- insert = SG.sqlInsert SD.defaultSqlGenerator- tableName columnNames columnExprs--arrangeInsertManySql :: T.Table columns a -> NEL.NonEmpty columns -> String-arrangeInsertManySql = show . HPrint.ppInsert .: arrangeInsertMany- runInsertMany :: PGS.Connection -> T.Table columns columns' -> [columns]@@ -54,40 +40,140 @@ Nothing -> return 0 Just columns' -> (PGS.execute_ conn . fromString .: arrangeInsertManySql) table columns' +-- | @runInsertReturning@'s use of the 'D.Default' typeclass means that the+-- compiler will have trouble inferring types. It is strongly+-- recommended that you provide full type signatures when using+-- @runInsertReturning@.+runInsertReturning :: (D.Default RQ.QueryRunner returned haskells)+ => PGS.Connection+ -> T.Table columnsW columnsR+ -> columnsW+ -> (columnsR -> returned)+ -> IO [haskells]+runInsertReturning = runInsertReturningExplicit D.def++-- | Where the predicate is true, update rows using the supplied+-- function.+runUpdate :: PGS.Connection -> T.Table columnsW columnsR+ -> (columnsR -> columnsW) -> (columnsR -> Column PGBool)+ -> IO Int64+runUpdate conn = PGS.execute_ conn . fromString .:. arrangeUpdateSql++-- | @runUpdateReturning@'s use of the 'D.Default' typeclass means+-- that the compiler will have trouble inferring types. It is+-- strongly recommended that you provide full type signatures when+-- using @runInsertReturning@.+runUpdateReturning :: (D.Default RQ.QueryRunner returned haskells)+ => PGS.Connection+ -> T.Table columnsW columnsR+ -> (columnsR -> columnsW)+ -> (columnsR -> Column PGBool)+ -> (columnsR -> returned)+ -> IO [haskells]+runUpdateReturning = runUpdateReturningExplicit D.def++-- | Delete rows where the predicate is true.+runDelete :: PGS.Connection -> T.Table a columnsR -> (columnsR -> Column PGBool)+ -> IO Int64+runDelete conn = PGS.execute_ conn . fromString .: arrangeDeleteSql++-- | You probably don't need this, but can just use+-- 'runInsertReturning' instead. You only need it if you want to run+-- an UPDATE RETURNING statement but need to be explicit about the+-- 'QueryRunner'.+runInsertReturningExplicit :: RQ.QueryRunner returned haskells+ -> PGS.Connection+ -> T.Table columnsW columnsR+ -> columnsW+ -> (columnsR -> returned)+ -> IO [haskells]+runInsertReturningExplicit qr conn t w r = PGS.queryWith_ parser conn+ (fromString+ (arrangeInsertReturningSql u t w r))+ where IRQ.QueryRunner u _ _ = qr+ parser = IRQ.prepareRowParser qr (r v)+ TI.Table _ (TI.TableProperties _ (TI.View v)) = t+ -- This method of getting hold of the return type feels a bit+ -- suspect. I haven't checked it for validity.++-- | You probably don't need this, but can just use+-- 'runUpdateReturning' instead. You only need it if you want to run+-- an UPDATE RETURNING statement but need to be explicit about the+-- 'QueryRunner'.+runUpdateReturningExplicit :: RQ.QueryRunner returned haskells+ -> PGS.Connection+ -> T.Table columnsW columnsR+ -> (columnsR -> columnsW)+ -> (columnsR -> Column PGBool)+ -> (columnsR -> returned)+ -> IO [haskells]+runUpdateReturningExplicit qr conn t update cond r =+ PGS.queryWith_ parser conn+ (fromString (arrangeUpdateReturningSql u t update cond r))+ where IRQ.QueryRunner u _ _ = qr+ parser = IRQ.prepareRowParser qr (r v)+ TI.Table _ (TI.TableProperties _ (TI.View v)) = t++-- | For internal use only. Do not use. Will be removed in a+-- subsequent release.+arrangeInsert :: T.Table columns a -> columns -> HSql.SqlInsert+arrangeInsert t c = arrangeInsertMany t (return c)++-- | For internal use only. Do not use. Will be removed in a+-- subsequent release.+arrangeInsertSql :: T.Table columns a -> columns -> String+arrangeInsertSql = show . HPrint.ppInsert .: arrangeInsert++-- | For internal use only. Do not use. Will be removed in a+-- subsequent release.+arrangeInsertMany :: T.Table columns a -> NEL.NonEmpty columns -> HSql.SqlInsert+arrangeInsertMany table columns = insert+ where writer = TI.tablePropertiesWriter (TI.tableProperties table)+ (columnExprs, columnNames) = TI.runWriter' writer columns+ insert = SG.sqlInsert SD.defaultSqlGenerator+ (PQ.tiToSqlTable (TI.tableIdentifier table))+ columnNames columnExprs++-- | For internal use only. Do not use. Will be removed in a+-- subsequent release.+arrangeInsertManySql :: T.Table columns a -> NEL.NonEmpty columns -> String+arrangeInsertManySql = show . HPrint.ppInsert .: arrangeInsertMany++-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeUpdate :: T.Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column PGBool) -> HSql.SqlUpdate-arrangeUpdate (TI.Table tableName (TI.TableProperties writer (TI.View tableCols)))- update cond =- SG.sqlUpdate SD.defaultSqlGenerator tableName [condExpr] (update' tableCols)- where update' = map (\(x, y) -> (y, x))- . TI.runWriter writer- . update+arrangeUpdate table update cond =+ SG.sqlUpdate SD.defaultSqlGenerator+ (PQ.tiToSqlTable (TI.tableIdentifier table))+ [condExpr] (update' tableCols)+ where TI.TableProperties writer (TI.View tableCols) = TI.tableProperties table+ update' = map (\(x, y) -> (y, x)) . TI.runWriter writer . update Column condExpr = cond tableCols +-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeUpdateSql :: T.Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column PGBool) -> String arrangeUpdateSql = show . HPrint.ppUpdate .:. arrangeUpdate -runUpdate :: PGS.Connection -> T.Table columnsW columnsR- -> (columnsR -> columnsW) -> (columnsR -> Column PGBool)- -> IO Int64-runUpdate conn = PGS.execute_ conn . fromString .:. arrangeUpdateSql-+-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeDelete :: T.Table a columnsR -> (columnsR -> Column PGBool) -> HSql.SqlDelete-arrangeDelete (TI.Table tableName (TI.TableProperties _ (TI.View tableCols)))- cond =- SG.sqlDelete SD.defaultSqlGenerator tableName [condExpr]+arrangeDelete table cond =+ SG.sqlDelete SD.defaultSqlGenerator (PQ.tiToSqlTable (TI.tableIdentifier table)) [condExpr] where Column condExpr = cond tableCols+ TI.View tableCols = TI.tablePropertiesView (TI.tableProperties table) +-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeDeleteSql :: T.Table a columnsR -> (columnsR -> Column PGBool) -> String arrangeDeleteSql = show . HPrint.ppDelete .: arrangeDelete -runDelete :: PGS.Connection -> T.Table a columnsR -> (columnsR -> Column PGBool)- -> IO Int64-runDelete conn = PGS.execute_ conn . fromString .: arrangeDeleteSql-+-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeInsertReturning :: U.Unpackspec returned ignored -> T.Table columnsW columnsR -> columnsW@@ -96,10 +182,12 @@ arrangeInsertReturning unpackspec table columns returningf = Sql.Returning insert returningSEs where insert = arrangeInsert table columns- TI.Table _ (TI.TableProperties _ (TI.View columnsR)) = table+ TI.View columnsR = TI.tablePropertiesView (TI.tableProperties table) returningPEs = U.collectPEs unpackspec (returningf columnsR) returningSEs = Sql.ensureColumnsGen id (map Sql.sqlExpr returningPEs) +-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeInsertReturningSql :: U.Unpackspec returned ignored -> T.Table columnsW columnsR -> columnsW@@ -109,33 +197,8 @@ . Print.ppInsertReturning .:: arrangeInsertReturning -runInsertReturningExplicit :: RQ.QueryRunner returned haskells- -> PGS.Connection- -> T.Table columnsW columnsR- -> columnsW- -> (columnsR -> returned)- -> IO [haskells]-runInsertReturningExplicit qr conn t w r = PGS.queryWith_ parser conn- (fromString- (arrangeInsertReturningSql u t w r))- where IRQ.QueryRunner u _ _ = qr- parser = IRQ.prepareRowParser qr (r v)- TI.Table _ (TI.TableProperties _ (TI.View v)) = t- -- This method of getting hold of the return type feels a bit- -- suspect. I haven't checked it for validity.---- | @runInsertReturning@'s use of the 'D.Default' typeclass means that the--- compiler will have trouble inferring types. It is strongly--- recommended that you provide full type signatures when using--- @runInsertReturning@.-runInsertReturning :: (D.Default RQ.QueryRunner returned haskells)- => PGS.Connection- -> T.Table columnsW columnsR- -> columnsW- -> (columnsR -> returned)- -> IO [haskells]-runInsertReturning = runInsertReturningExplicit D.def-+-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeUpdateReturning :: U.Unpackspec returned ignored -> T.Table columnsW columnsR -> (columnsR -> columnsW)@@ -145,10 +208,12 @@ arrangeUpdateReturning unpackspec table updatef cond returningf = Sql.Returning update returningSEs where update = arrangeUpdate table updatef cond- TI.Table _ (TI.TableProperties _ (TI.View columnsR)) = table+ TI.View columnsR = TI.tablePropertiesView (TI.tableProperties table) returningPEs = U.collectPEs unpackspec (returningf columnsR) returningSEs = Sql.ensureColumnsGen id (map Sql.sqlExpr returningPEs) +-- | For internal use only. Do not use. Will be removed in a+-- subsequent release. arrangeUpdateReturningSql :: U.Unpackspec returned ignored -> T.Table columnsW columnsR -> (columnsR -> columnsW)@@ -158,26 +223,3 @@ arrangeUpdateReturningSql = show . Print.ppUpdateReturning .::. arrangeUpdateReturning--runUpdateReturningExplicit :: RQ.QueryRunner returned haskells- -> PGS.Connection- -> T.Table columnsW columnsR- -> (columnsR -> columnsW)- -> (columnsR -> Column PGBool)- -> (columnsR -> returned)- -> IO [haskells]-runUpdateReturningExplicit qr conn t update cond r =- PGS.queryWith_ parser conn- (fromString (arrangeUpdateReturningSql u t update cond r))- where IRQ.QueryRunner u _ _ = qr- parser = IRQ.prepareRowParser qr (r v)- TI.Table _ (TI.TableProperties _ (TI.View v)) = t--runUpdateReturning :: (D.Default RQ.QueryRunner returned haskells)- => PGS.Connection- -> T.Table columnsW columnsR- -> (columnsR -> columnsW)- -> (columnsR -> Column PGBool)- -> (columnsR -> returned)- -> IO [haskells]-runUpdateReturning = runUpdateReturningExplicit D.def
src/Opaleye/Operators.hs view
@@ -1,35 +1,70 @@-module Opaleye.Operators (module Opaleye.Operators) where+{-# LANGUAGE Arrows #-}+{-# LANGUAGE FlexibleContexts #-} +-- | Operators on 'Column's. Numeric 'Column' types are instances of+-- 'Num', so you can use '*', '/', '+', '-' on them.++module Opaleye.Operators (module Opaleye.Operators,+ (O..&&)) where++import qualified Control.Arrow as A import qualified Data.Foldable as F import Opaleye.Internal.Column (Column(Column), unsafeCase_,- unsafeIfThenElse, unsafeGt, unsafeEq)+ unsafeIfThenElse, unsafeGt) import qualified Opaleye.Internal.Column as C import Opaleye.Internal.QueryArr (QueryArr(QueryArr)) import qualified Opaleye.Internal.PrimQuery as PQ+import qualified Opaleye.Internal.Operators as O+import Opaleye.Internal.Helpers ((.:)) import qualified Opaleye.Order as Ord import qualified Opaleye.PGTypes as T import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ +import qualified Data.Profunctor.Product.Default as D+ {-| Restrict query results to a particular condition. Corresponds to- the guard method of the MonadPlus class.--}+the guard method of the MonadPlus class. You would typically use+'restrict' if you want to use 'A.Arrow' notation. -} restrict :: QueryArr (Column T.PGBool) () restrict = QueryArr f where f (Column predicate, primQ, t0) = ((), PQ.restrict predicate primQ, t0) +{-| Filter a 'QueryArr' to only those rows where the given condition+holds. This is the 'QueryArr' equivalent of 'Prelude.filter' from the+'Prelude'. You would typically use 'keepWhen' if you want to use a+"point free" style.-}+keepWhen :: (a -> Column T.PGBool) -> QueryArr a a+keepWhen p = proc a -> do+ restrict -< p a+ A.returnA -< a+ doubleOfInt :: Column T.PGInt4 -> Column T.PGFloat8 doubleOfInt (Column e) = Column (HPQ.CastExpr "float8" e) infix 4 .== (.==) :: Column a -> Column a -> Column T.PGBool-(.==) = unsafeEq+(.==) = C.binOp HPQ.OpEq infix 4 ./= (./=) :: Column a -> Column a -> Column T.PGBool (./=) = C.binOp HPQ.OpNotEq +infix 4 .===+-- | A polymorphic equality operator that works for all types that you+-- have run `makeAdaptorAndInstance` on. This may be unified with+-- `.==` in a future version.+(.===) :: D.Default O.EqPP columns columns => columns -> columns -> Column T.PGBool+(.===) = (O..==)++infix 4 ./==+-- | A polymorphic inequality operator that works for all types that+-- you have run `makeAdaptorAndInstance` on. This may be unified with+-- `.==` in a future version.+(./==) :: D.Default O.EqPP columns columns => columns -> columns -> Column T.PGBool+(./==) = Opaleye.Operators.not .: (O..==)+ infix 4 .> (.>) :: Ord.PGOrd a => Column a -> Column a -> Column T.PGBool (.>) = unsafeGt@@ -52,10 +87,6 @@ ifThenElse :: Column T.PGBool -> Column a -> Column a -> Column a ifThenElse = unsafeIfThenElse -infixr 3 .&&-(.&&) :: Column T.PGBool -> Column T.PGBool -> Column T.PGBool-(.&&) = C.binOp HPQ.OpAnd- infixr 2 .|| (.||) :: Column T.PGBool -> Column T.PGBool -> Column T.PGBool (.||) = C.binOp HPQ.OpOr@@ -75,6 +106,7 @@ like :: Column T.PGText -> Column T.PGText -> Column T.PGBool like = C.binOp HPQ.OpLike +-- | True when any element of the container is true ors :: F.Foldable f => f (Column T.PGBool) -> Column T.PGBool ors = F.foldl' (.||) (T.pgBool False)
src/Opaleye/Order.hs view
@@ -80,3 +80,4 @@ instance PGOrd T.PGTimestamptz instance PGOrd T.PGTimestamp instance PGOrd T.PGCitext+instance PGOrd T.PGUuid
src/Opaleye/PGTypes.hs view
@@ -10,6 +10,7 @@ import qualified Opaleye.Internal.HaskellDB.Sql.Default as HSD (quote) import qualified Data.CaseInsensitive as CI+import qualified Data.Aeson as Ae import qualified Data.Text as SText import qualified Data.Text.Lazy as LText import qualified Data.ByteString as SByteString@@ -127,6 +128,9 @@ pgLazyJSON :: LByteString.ByteString -> Column PGJson pgLazyJSON = pgJSON . IPT.lazyDecodeUtf8 +pgValueJSON :: Ae.ToJSON a => a -> Column PGJson+pgValueJSON = pgLazyJSON . Ae.encode+ -- The jsonb data type was introduced in PostgreSQL version 9.4 -- JSONB values must be SQL string quoted --@@ -140,3 +144,6 @@ pgLazyJSONB :: LByteString.ByteString -> Column PGJsonb pgLazyJSONB = pgJSONB . IPT.lazyDecodeUtf8++pgValueJSONB :: Ae.ToJSON a => a -> Column PGJsonb+pgValueJSONB = pgLazyJSONB . Ae.encode
src/Opaleye/Table.hs view
@@ -3,7 +3,7 @@ module Opaleye.Table (module Opaleye.Table, View, Writer,- Table(Table),+ Table(Table, TableWithSchema), TableProperties) where import Opaleye.Internal.Column (Column(Column))