Skip to content

Commit 0de1e98

Browse files
authored
Beam 0.7 release
Bumped beam-core to v0.7.1.0 because I uploaded an old version to hackage ^_^
1 parent 3cf9f98 commit 0de1e98

File tree

9 files changed

+43
-25
lines changed

9 files changed

+43
-25
lines changed

beam-core/ChangeLog.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# 0.7.0.0
22

3+
Note '0.7.1.0' was released because the signature of `delete` was too specific
4+
in '0.7.0.0' due to an error when uploading the package.
5+
6+
## Weaker functional dependencies on `MonadBeam`
7+
8+
The functional dependency on `MonadBeam` is now just `m -> syntax be
9+
handle`. This allows us to define `MonadBeam` instances atop monad transformers
10+
(although we don't have any yet!).
11+
312
## Correct boolean handling
413

514
Previous versions of beam used the SQL `=` operator to compare potentially
@@ -62,7 +71,6 @@ Now write
6271
instance Database be MyDatabase
6372
```
6473

65-
6674
## Require backends to explicitly declare types that can be compared for equality
6775

6876
Beam previously allowed any two types to be compared for SQL

beam-core/Database/Beam/Query/CustomSQL.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
-- is called with arguments representing SQL expressions, that, when
3131
-- evaluated, will evaluate to the result of the expressions supplied as
3232
-- arguments to 'customExpr_'. See the section on
33-
-- <http://tathougies.github.io/beam/user-guide/extensibility/
34-
-- extensibility> in the user guide for example usage.
33+
-- <http://tathougies.github.io/beam/user-guide/extensibility/ extensibility>
34+
-- in the user guide for example usage.
3535
module Database.Beam.Query.CustomSQL
3636
(
3737
-- * The 'customExpr_' function

beam-core/beam-core.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- see http://haskell.org/cabal/users-guide/
33

44
name: beam-core
5-
version: 0.7.0.0
5+
version: 0.7.1.0
66
synopsis: Type-safe, feature-complete SQL query and manipulation interface for Haskell
77
description: Beam is a Haskell library for type-safe querying and manipulation of SQL databases.
88
Beam is modular and supports various backends. In order to use beam, you will need to use
@@ -18,7 +18,7 @@ author: Travis Athougies
1818
maintainer: [email protected]
1919
category: Database
2020
build-type: Simple
21-
cabal-version: >=1.18
21+
cabal-version: 1.18
2222
bug-reports: https://github.com/tathougies/beam/issues
2323
extra-doc-files: ChangeLog.md
2424

beam-migrate/beam-migrate.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ copyright: Copyright (C) 2017-2018 Travis Athougies
2828
category: Database
2929
build-type: Simple
3030
extra-source-files: ChangeLog.md
31-
cabal-version: >=1.10
31+
cabal-version: 1.18
3232

3333
library
3434
exposed-modules: Database.Beam.Migrate
@@ -76,7 +76,7 @@ library
7676
deepseq >=1.4 && <1.5,
7777
ghc-prim >=0.5 && <0.6,
7878
containers >=0.5 && <0.6,
79-
haskell-src-exts >=1.18 && <1.21,
79+
haskell-src-exts >=1.20 && <1.21,
8080
pretty >=1.1 && <1.2,
8181
dependent-map >=0.2 && <0.3,
8282
dependent-sum >=0.4 && <0.5,

beam-postgres/Database/Beam/Postgres/Migrate.hs

+12-11
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,17 @@ postgresDataTypeDeserializers
111111
postgresDataTypeDeserializers =
112112
Db.beamDeserializer $ \_ v ->
113113
case v of
114-
"bytea" -> pure pgByteaType
115-
"smallserial" -> pure pgSmallSerialType
116-
"serial" -> pure pgSerialType
117-
"bigserial" -> pure pgBigSerialType
118-
"tsquery" -> pure pgTsQueryType
119-
"tsvector" -> pure pgTsVectorType
120-
"text" -> pure pgTextType
121-
"json" -> pure pgJsonType
122-
"jsonb" -> pure pgJsonbType
123-
"uuid" -> pure pgUuidType
124-
"money" -> pure pgMoneyType
114+
"bytea" -> pure pgByteaType
115+
"smallserial" -> pure pgSmallSerialType
116+
"serial" -> pure pgSerialType
117+
"bigserial" -> pure pgBigSerialType
118+
"tsquery" -> pure pgTsQueryType
119+
"tsvector" -> pure pgTsVectorType
120+
"text" -> pure pgTextType
121+
"json" -> pure pgJsonType
122+
"jsonb" -> pure pgJsonbType
123+
"uuid" -> pure pgUuidType
124+
"money" -> pure pgMoneyType
125125
_ -> fail "Postgres data type"
126126

127127
-- | Converts postgres 'DatabasePredicate's to 'DatabasePredicate's in the
@@ -205,6 +205,7 @@ pgTypeToHs (PgDataTypeSyntax tyDescr _ _) =
205205
(HsType (tyConNamed "TsQuery")
206206
(importSome "Database.Beam.Postgres" [importTyNamed "TsQuery"]))
207207
(pgDataTypeSerialized pgTsQueryType)
208+
208209
_ -> Just (hsErrorType ("PG type " ++ show tyDescr))
209210

210211
-- | Turn a series of 'Db.MigrationSteps' into a line-by-line array of

beam-postgres/Database/Beam/Postgres/PgSpecific.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ instance HasDefaultSqlDataType PgDataTypeSyntax PgMoney where
940940
defaultSqlDataType _ _ = pgMoneyType
941941
instance HasDefaultSqlDataTypeConstraints PgColumnSchemaSyntax PgMoney
942942

943-
instance HasDefaultSqlDataType PgDataTypeSyntax a => HasDefaultSqlDataType PgDataTypeSyntax (V.Vector a) where
943+
instance HasDefaultSqlDataType PgDataTypeSyntax a => HasDefaultSqlDataType PgDataTypeSyntax (V.Vector a) where
944944
defaultSqlDataType _ embedded = pgUnboundedArrayType (defaultSqlDataType (Proxy :: Proxy a) embedded)
945945
instance HasDefaultSqlDataTypeConstraints PgColumnSchemaSyntax (V.Vector a)
946946

beam-postgres/Database/Beam/Postgres/Syntax.hs

+9
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ import Data.ByteString.Builder (Builder, byteString, char8, toLazyByte
101101
import qualified Data.ByteString.Char8 as B
102102
import Data.ByteString.Lazy.Char8 (toStrict)
103103
import qualified Data.ByteString.Lazy.Char8 as BL
104+
import Data.CaseInsensitive (CI)
105+
import qualified Data.CaseInsensitive as CI
104106
import Data.Coerce
105107
import Data.Functor.Classes
106108
import Data.Hashable
@@ -1117,6 +1119,11 @@ DEFAULT_SQL_SYNTAX(Pg.LocalTimestamp)
11171119
DEFAULT_SQL_SYNTAX(Pg.UTCTimestamp)
11181120
DEFAULT_SQL_SYNTAX(Scientific)
11191121

1122+
instance HasSqlValueSyntax PgValueSyntax (CI T.Text) where
1123+
sqlValueSyntax = sqlValueSyntax . CI.original
1124+
instance HasSqlValueSyntax PgValueSyntax (CI TL.Text) where
1125+
sqlValueSyntax = sqlValueSyntax . CI.original
1126+
11201127
instance HasSqlValueSyntax PgValueSyntax SqlNull where
11211128
sqlValueSyntax _ = defaultPgValueSyntax Pg.Null
11221129

@@ -1363,3 +1370,5 @@ PG_HAS_EQUALITY_CHECK(Scientific)
13631370
PG_HAS_EQUALITY_CHECK(ByteString)
13641371
PG_HAS_EQUALITY_CHECK(BL.ByteString)
13651372
PG_HAS_EQUALITY_CHECK(V.Vector a)
1373+
PG_HAS_EQUALITY_CHECK(CI T.Text)
1374+
PG_HAS_EQUALITY_CHECK(CI TL.Text)

beam-postgres/beam-postgres.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ author: Travis Athougies
99
maintainer: [email protected]
1010
category: Database
1111
build-type: Simple
12-
cabal-version: >=1.18
12+
cabal-version: 1.18
1313
extra-doc-files: ChangeLog.md
1414
bug-reports: https://github.com/tathougies/beam/issues
1515

beam-sqlite/beam-sqlite.cabal

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build-type: Simple
1616
extra-source-files: README.md
1717
extra-doc-files: ChangeLog.md
1818
bug-reports: https://github.com/tathougies/beam/issues
19-
cabal-version: >=1.18
19+
cabal-version: 1.18
2020

2121
library
2222
exposed-modules: Database.Beam.Sqlite
@@ -49,11 +49,11 @@ library
4949
ghc-options: -Werror
5050

5151
if os(windows)
52-
ghc-options: -DWINDOWS
53-
build-depends: Win32
52+
cpp-options: -DWINDOWS
53+
build-depends: Win32 >=2.4 && <2.8
5454
if os(freebsd) || os(netbsd) || os(darwin) || os(linux) || os(solaris)
55-
ghc-options: -DUNIX
56-
build-depends: unix
55+
cpp-options: -DUNIX
56+
build-depends: unix >=2.0 && <2.8
5757

5858
flag werror
5959
description: Enable -Werror during development

0 commit comments

Comments
 (0)