diff --git a/.ghci b/.ghci new file mode 100644 index 0000000..e69de29 diff --git a/.ghcid b/.ghcid new file mode 100644 index 0000000..290f257 --- /dev/null +++ b/.ghcid @@ -0,0 +1 @@ +--command=stack ghci --allow-eval diff --git a/Database/MySQL/Protocol/Command.hs b/Database/MySQL/Protocol/Command.hs index b00e294..9de8072 100644 --- a/Database/MySQL/Protocol/Command.hs +++ b/Database/MySQL/Protocol/Command.hs @@ -17,6 +17,7 @@ module Database.MySQL.Protocol.Command where import Control.Applicative import Control.Monad +import qualified Control.Monad.Fail as Fail import Data.Binary import Data.Binary.Get import Data.Binary.Parser @@ -26,6 +27,11 @@ import qualified Data.ByteString.Lazy as L import Database.MySQL.Protocol.MySQLValue import Database.MySQL.Protocol.Packet +--TODO: orphan instance MonadFail Data.Binary +instance MonadFail PutM where + + + -------------------------------------------------------------------------------- -- Commands @@ -83,7 +89,7 @@ putCommand (COM_STMT_EXECUTE stid params nullmap) = do putCommand (COM_STMT_CLOSE stid) = putWord8 0x19 >> putWord32le stid putCommand (COM_STMT_RESET stid) = putWord8 0x1A >> putWord32le stid -putCommand _ = fail "unsupported command" +putCommand _ = error "unsupported command" -------------------------------------------------------------------------------- -- Prepared statment related diff --git a/benchmark/insert/mysql-haskell-bench.cabal b/benchmark/insert/mysql-haskell-bench.cabal index 2277de8..a2d124e 100644 --- a/benchmark/insert/mysql-haskell-bench.cabal +++ b/benchmark/insert/mysql-haskell-bench.cabal @@ -39,8 +39,8 @@ library , monad-loops == 0.4.* , network >= 2.3 && < 3.0 , io-streams >= 1.2 && < 2.0 - , tcp-streams == 0.5.* - , wire-streams >= 0.0.2 && < 0.1 + , tcp-streams >= 1.0.1.1 + , wire-streams >= 0.1.1.0 , binary == 0.8.* , binary-ieee754 == 0.1.* , binary-parsers >= 0.2.1 diff --git a/benchmark/select/mysql-haskell-bench.cabal b/benchmark/select/mysql-haskell-bench.cabal index a67f9e8..03b23f8 100644 --- a/benchmark/select/mysql-haskell-bench.cabal +++ b/benchmark/select/mysql-haskell-bench.cabal @@ -38,8 +38,8 @@ library , monad-loops == 0.4.* , network >= 2.3 && < 3.0 , io-streams >= 1.2 && < 2.0 - , tcp-streams == 0.5.* - , wire-streams >= 0.1 + , tcp-streams == 1.0.1.1 + , wire-streams == 0.1.1.0 , binary == 0.8.* , binary-ieee754 == 0.1.* , binary-parsers >= 0.2.1 diff --git a/mysql-haskell-openssl/mysql-haskell-openssl.cabal b/mysql-haskell-openssl/mysql-haskell-openssl.cabal index f9a48bb..2cb6ce7 100644 --- a/mysql-haskell-openssl/mysql-haskell-openssl.cabal +++ b/mysql-haskell-openssl/mysql-haskell-openssl.cabal @@ -22,9 +22,9 @@ library exposed-modules: Database.MySQL.OpenSSL build-depends: base >= 4.7 && < 5 , binary >= 0.8.3 - , tcp-streams >= 1.0 && < 1.1 + , tcp-streams >= 1.0.1.1 , tcp-streams-openssl >= 1.0 && < 1.1 - , wire-streams >= 0.1 + , wire-streams == 0.1.1.0 , mysql-haskell >= 0.8.3 && < 0.8.4 , HsOpenSSL >=0.10.3 && <0.12 diff --git a/mysql-haskell.cabal b/mysql-haskell.cabal index b723ff7..748cfea 100644 --- a/mysql-haskell.cabal +++ b/mysql-haskell.cabal @@ -37,21 +37,21 @@ library , monad-loops == 0.4.* , network >= 2.3 && < 4.0 , io-streams >= 1.2 && < 2.0 - , tcp-streams >= 1.0 && < 1.1 - , wire-streams >= 0.1 + , tcp-streams >= 1.0.1.1 + , wire-streams >= 0.1.1.0 , binary >= 0.8.3 , binary-ieee754 , binary-parsers >= 0.2.1 , bytestring >= 0.10.2.0 , text >= 1.1 && < 1.3 , cryptonite == 0.* - , memory >= 0.14.4 && < 0.15 + , memory >= 0.14.4 , time >= 1.5.0 , scientific == 0.3.* , bytestring-lexing == 0.5.* , blaze-textual == 0.2.* , word24 >= 1.0 && <= 3.0 - , tls >= 1.3.5 && < 1.5 + , tls >= 1.5.4 , vector >= 0.8 default-language: Haskell2010 diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..9f0cf12 --- /dev/null +++ b/stack.yaml @@ -0,0 +1,85 @@ +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# https://docs.haskellstack.org/en/stable/yaml_configuration/ + +# A warning or info to be displayed to the user on config load. +user-message: | + Warning (added by new or init): Some packages were found to have names conflicting with others and have been commented out in the packages section. + Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section. + You can omit this message by removing it from stack.yaml + +# Resolver to choose a 'specific' stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +# resolver: lts-3.5 +# resolver: nightly-2015-09-21 +# resolver: ghc-7.10.2 +# +# The location of a snapshot can be provided as a file or url. Stack assumes +# a snapshot provided as a file might change, whereas a url resource does not. +# +# resolver: ./custom-snapshot.yaml +# resolver: https://example.com/snapshots/2018-01-01.yaml +resolver: lts-15.15 + + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# subdirs: +# - auto-update +# - wai +packages: +- . +# The following packages have been ignored due to incompatibility with the +# resolver compiler, dependency conflicts with other packages +# or unsatisfied dependencies. +#- benchmark/insert +#- mysql-haskell-openssl + +# The following packages have been ignored due to package name conflict +# with other packages. +#- benchmark/select + +# Dependency packages to be pulled from upstream that are not in the resolver. +# These entries can reference officially published versions as well as +# forks / in-progress versions pinned to a git hash. For example: +# +# extra-deps: +# - acme-missiles-0.3 +# - git: https://github.com/commercialhaskell/stack.git +# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# +extra-deps: + - tcp-streams-1.0.1.1@sha256:35e9ecfa515797052f8c3c01834d2daebd5e93f3152c7fc98b32652bf6f0c052,2329 + - wire-streams-0.1.1.0@sha256:08816c7fa53b20f52e5c465252c106d9de8e6d9580ec0b6d9f000a34c7bcefc8,2130 + +# Override default flag values for local packages and extra-deps +# flags: {} + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true +# +# Require a specific version of stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=2.3" +# +# Override the architecture used by stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor diff --git a/stack.yaml.lock b/stack.yaml.lock new file mode 100644 index 0000000..40cb128 --- /dev/null +++ b/stack.yaml.lock @@ -0,0 +1,26 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: tcp-streams-1.0.1.1@sha256:35e9ecfa515797052f8c3c01834d2daebd5e93f3152c7fc98b32652bf6f0c052,2329 + pantry-tree: + size: 1004 + sha256: 572071fca40a0b6c4cc950d10277a6f12e83cf4846882b6ef83fcccaa2c18c45 + original: + hackage: tcp-streams-1.0.1.1@sha256:35e9ecfa515797052f8c3c01834d2daebd5e93f3152c7fc98b32652bf6f0c052,2329 +- completed: + hackage: wire-streams-0.1.1.0@sha256:08816c7fa53b20f52e5c465252c106d9de8e6d9580ec0b6d9f000a34c7bcefc8,2130 + pantry-tree: + size: 506 + sha256: c99a12bfcbeacc5da8f166fbed1eb105a45f08be1a3a071fe9f903b386b14e1d + original: + hackage: wire-streams-0.1.1.0@sha256:08816c7fa53b20f52e5c465252c106d9de8e6d9580ec0b6d9f000a34c7bcefc8,2130 +snapshots: +- completed: + size: 496112 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/15.yaml + sha256: 86169722ad0056ffc9eacc157ef80ee21d7024f92c0d2961c89ccf432db230a3 + original: lts-15.15