packages feed

beam-core 0.9.0.0 → 0.9.1.0

raw patch · 5 files changed

+19/−10 lines, 5 filesdep ~aesonnew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: aeson

API changes (from Hackage documentation)

- Database.Beam.Backend.SQL: instance forall k1 k2 (be :: k2) t (tag :: k1). Database.Beam.Backend.SQL.BeamSqlBackendIsString be t => Database.Beam.Backend.SQL.BeamSqlBackendIsString be (Data.Tagged.Tagged tag t)
- Database.Beam.Query.Internal: instance (Data.Typeable.Internal.Typeable context, Database.Beam.Query.Internal.IsWindowFrameContext context, context Data.Type.Equality.~ Database.Beam.Query.Internal.QWindowFrameContext) => Database.Beam.Query.Internal.WindowFrameContext context
- Database.Beam.Query.Internal: instance (Database.Beam.Query.Internal.IsValueContext a, Data.Typeable.Internal.Typeable a, a Data.Type.Equality.~ Database.Beam.Query.Internal.QValueContext) => Database.Beam.Query.Internal.ValueContext a
- Database.Beam.Schema.Tables: data (:*:) (f :: k -> Type) (g :: k -> Type) (p :: k) :: forall k. () => k -> Type -> k -> Type -> k -> Type
- Database.Beam.Schema.Tables: instance (GHC.Generics.Selector f', Database.Beam.Schema.Tables.ChooseSubTableStrategy tbl sub Data.Type.Equality.~ strategy, Database.Beam.Schema.Tables.SubTableStrategyImpl strategy f sub, Database.Beam.Schema.Tables.TagReducesTo f (Database.Beam.Schema.Tables.TableField tbl), Database.Beam.Schema.Tables.Beamable sub) => Database.Beam.Schema.Tables.GDefaultTableFieldSettings (GHC.Generics.S1 f' (GHC.Generics.K1 GHC.Generics.R (sub f)) p)
- Database.Beam.Schema.Tables: instance (fa Data.Type.Equality.~ Database.Beam.Schema.Tables.Columnar f a, ga Data.Type.Equality.~ Database.Beam.Schema.Tables.Columnar g a, ha Data.Type.Equality.~ Database.Beam.Schema.Tables.Columnar h a, ha Data.Type.Equality.~ Database.Beam.Schema.Tables.Columnar h a) => Database.Beam.Schema.Tables.GZipTables f g h (GHC.Generics.K1 GHC.Generics.R (Database.Beam.Backend.Types.Exposed a)) (GHC.Generics.K1 GHC.Generics.R fa) (GHC.Generics.K1 GHC.Generics.R ga) (GHC.Generics.K1 GHC.Generics.R ha)
+ Database.Beam.Backend.SQL: instance forall k1 k2 (be :: k1) t (tag :: k2). Database.Beam.Backend.SQL.BeamSqlBackendIsString be t => Database.Beam.Backend.SQL.BeamSqlBackendIsString be (Data.Tagged.Tagged tag t)
+ Database.Beam.Query.Internal: instance (Data.Typeable.Internal.Typeable context, Database.Beam.Query.Internal.IsWindowFrameContext context, context GHC.Types.~ Database.Beam.Query.Internal.QWindowFrameContext) => Database.Beam.Query.Internal.WindowFrameContext context
+ Database.Beam.Query.Internal: instance (Database.Beam.Query.Internal.IsValueContext a, Data.Typeable.Internal.Typeable a, a GHC.Types.~ Database.Beam.Query.Internal.QValueContext) => Database.Beam.Query.Internal.ValueContext a
+ Database.Beam.Schema.Tables: data ( (f :: k -> Type) :*: (g :: k -> Type) ) (p :: k)
+ Database.Beam.Schema.Tables: instance (GHC.Generics.Selector f', Database.Beam.Schema.Tables.ChooseSubTableStrategy tbl sub GHC.Types.~ strategy, Database.Beam.Schema.Tables.SubTableStrategyImpl strategy f sub, Database.Beam.Schema.Tables.TagReducesTo f (Database.Beam.Schema.Tables.TableField tbl), Database.Beam.Schema.Tables.Beamable sub) => Database.Beam.Schema.Tables.GDefaultTableFieldSettings (GHC.Generics.S1 f' (GHC.Generics.K1 GHC.Generics.R (sub f)) p)
+ Database.Beam.Schema.Tables: instance (fa GHC.Types.~ Database.Beam.Schema.Tables.Columnar f a, ga GHC.Types.~ Database.Beam.Schema.Tables.Columnar g a, ha GHC.Types.~ Database.Beam.Schema.Tables.Columnar h a, ha GHC.Types.~ Database.Beam.Schema.Tables.Columnar h a) => Database.Beam.Schema.Tables.GZipTables f g h (GHC.Generics.K1 GHC.Generics.R (Database.Beam.Backend.Types.Exposed a)) (GHC.Generics.K1 GHC.Generics.R fa) (GHC.Generics.K1 GHC.Generics.R ga) (GHC.Generics.K1 GHC.Generics.R ha)
- Database.Beam.Backend.Internal.Compat: type PreferExplicitSize implicit explicit = 'Text "The size of " :<>: 'ShowType implicit :<>: 'Text " is machine-dependent. Use an explicitly sized integer such as " :<>: 'ShowType explicit :<>: 'Text " instead."
+ Database.Beam.Backend.Internal.Compat: type PreferExplicitSize implicit explicit = 'Text "The size of " :<>: 'ShowType implicit :<>: 'Text " is machine-dependent. Use an explicitly sized integer such as " :<>: 'ShowType explicit :<>: 'Text " instead."
- Database.Beam.Query: SqlDelete :: !TableSettings table -> !BeamSqlBackendDeleteSyntax be -> SqlDelete be
+ Database.Beam.Query: SqlDelete :: !TableSettings table -> !BeamSqlBackendDeleteSyntax be -> SqlDelete be (table :: (Type -> Type) -> Type)
- Database.Beam.Query: SqlIdentityUpdate :: SqlUpdate be
+ Database.Beam.Query: SqlIdentityUpdate :: SqlUpdate be (table :: (Type -> Type) -> Type)
- Database.Beam.Query: SqlInsert :: !TableSettings table -> !BeamSqlBackendInsertSyntax be -> SqlInsert be
+ Database.Beam.Query: SqlInsert :: !TableSettings table -> !BeamSqlBackendInsertSyntax be -> SqlInsert be (table :: (Type -> Type) -> Type)
- Database.Beam.Query: SqlInsertNoRows :: SqlInsert be
+ Database.Beam.Query: SqlInsertNoRows :: SqlInsert be (table :: (Type -> Type) -> Type)
- Database.Beam.Query: SqlUpdate :: !TableSettings table -> !BeamSqlBackendUpdateSyntax be -> SqlUpdate be
+ Database.Beam.Query: SqlUpdate :: !TableSettings table -> !BeamSqlBackendUpdateSyntax be -> SqlUpdate be (table :: (Type -> Type) -> Type)
- Database.Beam.Query.CTE: With :: WriterT (Recursiveness be, [BeamSql99BackendCTESyntax be]) (State Int) a -> With be a
+ Database.Beam.Query.CTE: With :: WriterT (Recursiveness be, [BeamSql99BackendCTESyntax be]) (State Int) a -> With be (db :: (Type -> Type) -> Type) a
- Database.Beam.Query.CTE: [runWith] :: With be a -> WriterT (Recursiveness be, [BeamSql99BackendCTESyntax be]) (State Int) a
+ Database.Beam.Query.CTE: [runWith] :: With be (db :: (Type -> Type) -> Type) a -> WriterT (Recursiveness be, [BeamSql99BackendCTESyntax be]) (State Int) a
- Database.Beam.Query.Internal: Q :: QM be db s a -> Q be s a
+ Database.Beam.Query.Internal: Q :: QM be db s a -> Q be (db :: (Type -> Type) -> Type) s a
- Database.Beam.Query.Internal: [runQ] :: Q be s a -> QM be db s a
+ Database.Beam.Query.Internal: [runQ] :: Q be (db :: (Type -> Type) -> Type) s a -> QM be db s a
- Database.Beam.Schema: TableLens :: Lens' (db f) (f x) -> TableLens f db
+ Database.Beam.Schema: TableLens :: Lens' (db f) (f x) -> TableLens f db (x :: k)
- Database.Beam.Schema.Tables: (:*:) :: f p -> g p -> (:*:)
+ Database.Beam.Schema.Tables: (:*:) :: f p -> g p -> (:*:) (f :: k -> Type) (g :: k -> Type) (p :: k)
- Database.Beam.Schema.Tables: TableField :: NonEmpty Text -> Text -> TableField ty
+ Database.Beam.Schema.Tables: TableField :: NonEmpty Text -> Text -> TableField (table :: (Type -> Type) -> Type) ty
- Database.Beam.Schema.Tables: [_fieldName] :: TableField ty -> Text
+ Database.Beam.Schema.Tables: [_fieldName] :: TableField (table :: (Type -> Type) -> Type) ty -> Text
- Database.Beam.Schema.Tables: [_fieldPath] :: TableField ty -> NonEmpty Text
+ Database.Beam.Schema.Tables: [_fieldPath] :: TableField (table :: (Type -> Type) -> Type) ty -> NonEmpty Text

Files

ChangeLog.md view
@@ -1,3 +1,9 @@+# 0.9.1.0++## Added features++ * Improve error message when `asc_` or `desc_` is missing in `orderBy_`+ # 0.9.0.0  ## Removal of machine-dependent `Int`/`Word` instances@@ -164,7 +170,7 @@ ## Aggregations return `Maybe` types  In previous versions of beam, aggregations such as `avg_`, `sum_`, etc-returned the an expression of the same type as its inputs. However,+returned an expression of the same type as its inputs. However, this does not match standard SQL behavior, where these aggregates can return NULL if no rows are selected for the aggregation. This breaks older code, but is more correct. To restore the older behavior, use@@ -265,4 +271,3 @@ * Split out backends from `beam-core` * Allow non-table entities to be stored in databases * Basic migrations support-
Database/Beam/Query/Combinators.hs view
@@ -84,6 +84,8 @@ import Data.Proxy import Data.Time (LocalTime) +import GHC.TypeLits (TypeError, ErrorMessage(Text))+ -- | Introduce all entries of a table into the 'Q' monad all_ :: ( Database be db, BeamSqlBackend be )        => DatabaseEntity be db (TableEntity table)@@ -288,7 +290,7 @@ related_ relTbl relKey =   join_ relTbl (\rel -> relKey ==. primaryKey rel) --- | Introduce all entries of the given table which for which the expression (which can depend on the queried table returns true)+-- | Introduce all entries of the given table for which the expression (which can depend on the queried table returns true) relatedBy_ :: forall be db rel s             . ( Database be db, Table rel, BeamSqlBackend be )            => DatabaseEntity be db (TableEntity rel)@@ -296,7 +298,7 @@            -> Q be db s (rel (QExpr be s)) relatedBy_ = join_ --- | Introduce all entries of the given table which for which the expression (which can depend on the queried table returns true)+-- | Introduce all entries of the given table for which the expression (which can depend on the queried table returns true) relatedBy_' :: forall be db rel s              . ( Database be db, Table rel, BeamSqlBackend be )             => DatabaseEntity be db (TableEntity rel)@@ -655,6 +657,9 @@     makeSQLOrdering :: Proxy be -> a -> [ WithExprContext (BeamSqlBackendOrderingSyntax be) ] instance SqlOrderable be (QOrd be s a) where     makeSQLOrdering _ (QOrd x) = [x]+instance TypeError ('Text "Missing mandatory sorting order. Use either 'asc_' or 'desc_' to specify sorting order.") =>+    SqlOrderable be (QGenExpr ctx be s a) where+        makeSQLOrdering = error "unreachable SqlOrderable QGenExpr instance" instance SqlOrderable be a => SqlOrderable be [a] where     makeSQLOrdering be = concatMap (makeSQLOrdering be) instance ( SqlOrderable be a, SqlOrderable be b ) => SqlOrderable be (a, b) where@@ -816,7 +821,7 @@     onNull' <- onNull     coalesceE . (<> [onNull']) <$> mapM (\(QExpr q) -> q) qs --- | Converta a 'Maybe' value to a concrete value, by suppling a default+-- | Convert a 'Maybe' value to a concrete value, by suppling a default fromMaybe_ :: BeamSqlBackend be            => QGenExpr ctxt be s a -> QGenExpr ctxt be s (Maybe a) -> QGenExpr ctxt be s a fromMaybe_ onNull q = coalesce_ [q] onNull
Database/Beam/Query/CustomSQL.hs view
@@ -31,7 +31,7 @@ --   is called with arguments representing SQL expressions, that, when --   evaluated, will evaluate to the result of the expressions supplied as --   arguments to 'customExpr_'. See the section on---   <https://haskell-beam.github.io/beam/user-guide/extensibility/ extensibility>+--   <https://haskell-beam.github.io/beam/user-guide/extensibility/extensibility> --   in the user guide for example usage. module Database.Beam.Query.CustomSQL   (@@ -108,4 +108,3 @@ --   aggregates for use in 'aggregate_'. agg_ :: QAgg be s a -> QAgg be s a agg_ = id-
Database/Beam/Schema/Tables.hs view
@@ -148,7 +148,7 @@ --   contstruct these for you. newtype EntityModification f be e = EntityModification (Endo (f e))   deriving (Monoid, Semigroup)--- | A newtype wrapper around 'Columnar f a -> Columnar f ' (i.e., an+-- | A newtype wrapper around 'Columnar f a -> Columnar f a' (i.e., an --   endomorphism between 'Columnar's over 'f'). You usually want to use --   'fieldNamed' or the 'IsString' instance to rename the field, when 'f ~ --   TableField'
beam-core.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/  name:                beam-core-version:             0.9.0.0+version:             0.9.1.0 synopsis:            Type-safe, feature-complete SQL query and manipulation interface for Haskell description:         Beam is a Haskell library for type-safe querying and manipulation of SQL databases.                      Beam is modular and supports various backends. In order to use beam, you will need to use@@ -61,7 +61,7 @@                        Database.Beam.Schema.Lenses    build-depends:       base         >=4.9     && <5.0,-                       aeson        >=0.11    && <1.5,+                       aeson        >=0.11    && <1.6,                        text         >=1.2.2.0 && <1.3,                        bytestring   >=0.10    && <0.11,                        mtl          >=2.2.1   && <2.3,