gnu: soci: Support Firebird.
[jackhill/guix/guix.git] / gnu / packages / databases.scm
index bab4b4d..302eaca 100644 (file)
@@ -42,6 +42,9 @@
 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
+;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages guile)
   #:use-module (gnu packages time)
   #:use-module (gnu packages golang)
+  #:use-module (gnu packages icu4c)
   #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libedit)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages logging)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages parallel)
   #:use-module (guix download)
   #:use-module (guix bzr-download)
   #:use-module (guix git-download)
+  #:use-module (guix hg-download)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
     (source (origin
       (method git-fetch)
       (uri (git-reference
-             (url "https://github.com/4store/4store.git")
+             (url "https://github.com/4store/4store")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
@@ -230,7 +237,7 @@ standard Go idioms.")
 (define-public ephemeralpg
   (package
     (name "ephemeralpg")
-    (version "3.0")
+    (version "3.1")
     (source
      (origin
        (method url-fetch)
@@ -238,10 +245,10 @@ standard Go idioms.")
              "https://eradman.com/ephemeralpg/code/ephemeralpg-"
              version ".tar.gz"))
        (sha256
-        (base32 "1j0g7g114ma7y7sadbng5p1ss1zsm9zpicm77qspym6565733vvh"))))
+        (base32 "1ap22ki8yz6agd0qybcjgs4b9izw1rwwcgpxn3jah2ccfyax34s6"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:make-flags (list "CC=gcc"
+     `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
                           (string-append "PREFIX=" %output))
        #:phases
        (modify-phases %standard-phases
@@ -304,6 +311,183 @@ ElasticSearch server")
     (home-page "https://github.com/patientslikeme/es_dump_restore")
     (license license:expat)))
 
+(define-public firebird
+  (package
+    (name "firebird")
+    (version "3.0.7")
+    (source
+     (let ((revision "33374-0"))
+       (origin
+         (method url-fetch)
+         (uri (string-append "https://github.com/FirebirdSQL/"
+                             "firebird/releases/download/R"
+                             (string-replace-substring version "." "_") "/"
+                             "Firebird-" version "." revision ".tar.bz2"))
+         (sha256
+          (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
+         (modules '((guix build utils)))
+         (snippet
+          `(begin
+             (for-each
+              delete-file-recursively
+              (list "extern/btyacc/test" ; TODO: package and remove entirely
+                    "extern/editline"
+                    "extern/icu"
+                    "extern/libtommath"
+                    "extern/zlib"
+                    "src/include/firebird/impl/boost"
+
+                    ;; Missing licence.
+                    "builds/install/arch-specific/solaris"
+                    "extern/SfIO"
+                    "src/msgs/templates.sql"
+
+                    ;; Generated files missing sources.
+                    "doc/Firebird-3-QuickStart.pdf"
+                    (string-append "doc/Firebird-" ,version
+                                   "-ReleaseNotes.pdf")
+                    "doc/README.SecureRemotePassword.html"))
+             #t)))))
+    (build-system gnu-build-system)
+    (outputs (list "debug" "out"))
+    (arguments
+     `(#:configure-flags
+       (let ((out (assoc-ref %outputs "out")))
+         (list (string-append "--with-fbsbin=" out "/sbin")
+               (string-append "--with-fbdoc=" out "/share/doc/"
+                              ,name "-" ,version)
+               (string-append "--with-fbconf=" out "/lib/firebird")
+               (string-append "--with-fbintl=" out "/lib/firebird/intl")
+               (string-append "--with-fbmisc=" out "/lib/firebird/misc")
+               (string-append "--with-fbmsg=" out "/lib/firebird")
+               (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
+               (string-append "--with-fbudf=" out "/lib/firebird/UDF")
+               "--with-fbglock=/run/firebird"
+               "--with-fblog=/var/log/firebird"
+               "--with-fbhelp=/var/lib/firebird/system"
+               "--with-fbsecure-db=/var/lib/firebird/secure"
+               "--without-fbsample"
+               "--without-fbsample-db"
+               "--with-system-editline"))
+       #:make-flags
+       (list (string-append "CC=" ,(cc-for-target))
+             ;; The plugins/ can't find libfbclient otherwise.
+             (string-append "LDFLAGS=-Wl,-rpath="
+                            (assoc-ref %outputs "out") "/lib"))
+       #:tests? #f                      ; no test suite
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'use-system-boost
+           (lambda _
+             (substitute* "src/include/firebird/Message.h"
+               (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
+                "<boost/preprocessor/seq/for_each_i.hpp>")
+               (("FB_BOOST_") "BOOST_"))
+             #t))
+         (add-after 'unpack 'patch-installation
+           (lambda _
+             (substitute*
+                 "builds/install/arch-specific/linux/makeInstallImage.sh.in"
+               (("/bin/sh") (which "bash"))
+               ;; Remove shell script helpers from $PATH.
+               (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
+               ;; Put files where Guix users expect them.
+               (("(License\\.txt.*)@FB_CONFDIR" match)
+                (string-append match "@FB_DOCDIR@"))
+               (("@FB_CONFDIR@(.*License\\.txt.*)" match)
+                (string-append "@FB_DOCDIR@" match))
+               (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
+                (string-append head "@FB_DOCDIR@" tail "\n")))
+             (substitute*
+                 (list "builds/install/posix-common/changeServerMode.sh.in"
+                       "builds/install/posix-common/install.sh.in")
+               ;; Skip phases that (could) cause problems in Guix.
+               (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
+                ":")
+               ;; Skip phases that are merely pointless on Guix.
+               (("buildUninstallFile|installInitdScript|startFirebird") ":")
+               ;; Omit randomly generated password with bonus timestamp.
+               (("setDBAPassword") ":"))
+
+             ;; These promote proprietary workflows not relevant on Guix.
+             (for-each delete-file-recursively
+                       (find-files "doc" "README\\.(build\\.msvc|NT|Win)"))
+             #t))
+         (add-after 'configure 'delete-init-scripts
+           (lambda _
+             (delete-file-recursively "gen/install/misc")
+             #t))
+         (add-before 'build 'set-build-environment-variables
+           (lambda _
+             ;; ‘isql’ needs to run & find libfbclient.so during the build.
+             ;; This doubles as a rudimentary test in lieu of a test suite.
+             (setenv "LD_LIBRARY_PATH"
+                     (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
+             #t))
+         (add-before 'install 'keep-embedded-debug-symbols
+           (lambda _
+             ;; Let the gnu-build-system separate & deal with them later.
+             ;; XXX Upstream would use ‘--strip-unneeded’, shaving a whole
+             ;; megabyte off Guix's 7.7M libEngine12.so, for example.
+             (substitute* "gen/Makefile.install"
+               (("readelf") "false"))
+             #t))
+         (add-after 'install 'prune-undesirable-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (with-directory-excursion out
+                 ;; Remove example binaries.
+                 (for-each delete-file-recursively
+                           (find-files "." "example"))
+                 ;; Delete (now-)empty directories.
+                 (for-each rmdir
+                           (list "include/firebird/impl"
+                                 "lib/firebird/plugins/udr"))
+                 #t)))))))
+    (inputs
+     `(("boost" ,boost)
+       ("editline" ,editline)
+       ("icu4c" ,icu4c-67)
+       ("libtommath" ,libtommath)
+       ("ncurses" ,ncurses)
+       ("zlib" ,zlib)))
+    (home-page "https://www.firebirdsql.org")
+    (synopsis "Relational database with many ANSI SQL standard features")
+    (description
+     "Firebird is an SQL @acronym{RDBMS, relational database management system}
+with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}) including
+@acronym{UDFs, user-defined functions} and PSQL stored procedures, cursors, and
+triggers.  Transactions provide full ACID-compliant referential integrity.
+
+The database requires very little manual maintenance once set up, making it
+ideal for small business or embedded use.
+
+When installed as a traditional local or remote (network) database server,
+Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
+may be a better choice for such very large environments.
+
+Firebird can also be embedded into stand-alone applications that don't want or
+need a full client & server.  Used in this manner, it offers richer SQL support
+than SQLite as well as the option to seamlessly migrate to a client/server
+database later.")
+    (properties
+     `((lint-hidden-cve . ("CVE-2017-6369"))))
+    (license
+     ;; See doc/license/README.license.usage.txt for rationale & details.
+     (list license:bsd-3                ; src/common/sha2/
+           license:bsd-4                ; src/common/enc.cpp
+           license:gpl2+                ; builds/posix/make.defaults
+           (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
+                                 "InterBase Public License v1.0")
+           (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
+                                 "Initial Developer's Public License v1.0")
+           license:lgpl2.1           ; exception for OSI-compatible licences
+           license:mpl1.1            ; examples/interfaces/0{6,8}*.cpp
+           license:public-domain)))) ; including files without explicit licence
+
 (define-public leveldb
   (package
     (name "leveldb")
@@ -609,6 +793,36 @@ RDBMS systems (which are deep in functionality).")
                    ;; Some parts are licensed under the Apache License
                    license:asl2.0))))
 
+(define-public mycli
+  (package
+    (name "mycli")
+    (version "1.22.2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "mycli" version))
+        (sha256
+          (base32 "1lq2x95553vdmhw13cxcgsd2g2i32izhsb7hxd4m1iwf9b3msbpv"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))                    ; tests expect a running MySQL
+    (propagated-inputs
+      `(("python-cli-helpers" ,python-cli-helpers)
+        ("python-click" ,python-click)
+        ("python-configobj" ,python-configobj)
+        ("python-cryptography" ,python-cryptography)
+        ("python-prompt-toolkit" ,python-prompt-toolkit)
+        ("python-pygments" ,python-pygments)
+        ("python-pymysql" ,python-pymysql)
+        ("python-sqlparse" ,python-sqlparse)))
+    (home-page "http://mycli.net")
+    (synopsis
+      "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
+    (description
+      "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
+auto-completion and syntax highlighting.")
+    (license license:bsd-3)))
+
 ;; XXX When updating, check whether boost-for-mysql is still needed.
 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
 (define-public mysql
@@ -912,7 +1126,7 @@ Language.")
      `(("bison" ,bison)
        ;; XXX: On armhf, use GCC 5 to work around <https://bugs.gnu.org/37605>.
        ,@(if (string-prefix? "armhf" (%current-system))
-             `(("gcc@5"gcc-5))
+             `(("gcc@5" ,gcc-5))
              '())
        ("perl" ,perl)))
     (inputs
@@ -938,7 +1152,7 @@ as a drop-in replacement of MySQL.")
 (define-public mariadb-connector-c
   (package
     (name "mariadb-connector-c")
-    (version "3.1.8")
+    (version "3.1.10")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -947,7 +1161,7 @@ as a drop-in replacement of MySQL.")
                     version "-src.tar.gz"))
               (sha256
                (base32
-                "0yrzhsxmjiwkhchagx8dymzhvxl3k5h40wn9wpicqjvgjb9k8523"))))
+                "13v5z4w1cl890lnr2fbwbziw638lqw2aga45vdq1z0cyrc9mcgmg"))))
     (inputs
      `(("openssl" ,openssl)))
     (build-system cmake-build-system)
@@ -1006,6 +1220,8 @@ TIMESTAMP.  It also supports storage of binary large objects, including
 pictures, sounds, or video.")
     (license (license:x11-style "file://COPYRIGHT"))))
 
+(define-public postgresql-10 postgresql)
+
 (define-public postgresql-11
   (package
     (inherit postgresql)
@@ -1147,7 +1363,7 @@ including field and record folding.")))
 (define-public rocksdb
   (package
     (name "rocksdb")
-    (version "6.10.1")
+    (version "6.11.4")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1156,7 +1372,7 @@ including field and record folding.")))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0rp8q73dx5f1nkcf2qp6fljm4dpj281y6cqckqgv976kvwvqdgz1"))
+                "0n19p9cd13jg0lnibrzwkxs4xlrhyj3knypkd2ic41arbds0bdnl"))
               (modules '((guix build utils)))
               (snippet
                '(begin
@@ -1311,7 +1527,7 @@ for example from a shell script.")
 (define-public sqitch
   (package
     (name "sqitch")
-    (version "1.0.0")
+    (version "1.1.0")
     (source
      (origin
        (method url-fetch)
@@ -1319,7 +1535,7 @@ for example from a shell script.")
              "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
              version ".tar.gz"))
        (sha256
-        (base32 "0p4wraqiscvwmmsvfqfy65blgsilwpvd9zj4d2zvm2xdx70ncr7l"))))
+        (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
     (build-system perl-build-system)
     (arguments
      '(#:phases
@@ -1351,6 +1567,7 @@ for example from a shell script.")
        ("perl-test-file" ,perl-test-file)
        ("perl-test-file-contents" ,perl-test-file-contents)
        ("perl-test-mockmodule" ,perl-test-mockmodule)
+       ("perl-test-mockobject" ,perl-test-mockobject)
        ("perl-test-nowarnings" ,perl-test-nowarnings)
        ("perl-test-warn" ,perl-test-warn)))
     (inputs
@@ -1359,7 +1576,9 @@ for example from a shell script.")
        ("perl-config-gitlike" ,perl-config-gitlike)
        ("perl-datetime" ,perl-datetime)
        ("perl-datetime-timezone" ,perl-datetime-timezone)
+       ("perl-dbd-mysql" ,perl-dbd-mysql)
        ("perl-dbd-pg" ,perl-dbd-pg)
+       ("perl-dbd-sqlite" ,perl-dbd-sqlite)
        ("perl-dbi" ,perl-dbi)
        ("perl-devel-stacktrace" ,perl-devel-stacktrace)
        ("perl-encode-locale" ,perl-encode-locale)
@@ -1401,7 +1620,7 @@ which uses SQL to describe changes.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/coffeeandscripts/sqlcrush.git")
+                      (url "https://github.com/coffeeandscripts/sqlcrush")
                       (commit commit)))
                 (file-name (git-file-name name version))
                 (sha256
@@ -1481,15 +1700,14 @@ extremely small.")
 (define-public perl-dbix-class
   (package
     (name "perl-dbix-class")
-    (version "0.082841")
+    (version "0.082842")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
                            "DBIx-Class-" version ".tar.gz"))
        (sha256
-        (base32
-         "1gf3hgv8f9rnr8bl4ljgsqk4aliphmvljhsk4282kvdc4mcgh1fp"))))
+        (base32 "1rh7idjjbibc1zmiaaarask434lh0lx7f2xyfwmy37k9fa0xcpmh"))))
     (build-system perl-build-system)
     (native-inputs
      `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
@@ -1517,7 +1735,7 @@ extremely small.")
        ("perl-path-class" ,perl-path-class)
        ("perl-scalar-list-utils" ,perl-scalar-list-utils)
        ("perl-scope-guard" ,perl-scope-guard)
-       ("perl-sql-abstract" ,perl-sql-abstract)
+       ("perl-sql-abstract-classic" ,perl-sql-abstract-classic)
        ("perl-sub-name" ,perl-sub-name)
        ("perl-text-balanced" ,perl-text-balanced)
        ("perl-try-tiny" ,perl-try-tiny)))
@@ -1707,7 +1925,7 @@ columns, primary keys, unique constraints and relationships.")
 (define-public perl-dbd-sqlite
   (package
     (name "perl-dbd-sqlite")
-    (version "1.64")
+    (version "1.66")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -1715,7 +1933,7 @@ columns, primary keys, unique constraints and relationships.")
                     version ".tar.gz"))
               (sha256
                (base32
-                "00gz5aw3xrr92lf9nfk0dhmy7a8jzmxhznddd9b0a8w4a1xqzbpl"))))
+                "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
     (build-system perl-build-system)
     (inputs `(("sqlite" ,sqlite)))
     (propagated-inputs `(("perl-dbi" ,perl-dbi)))
@@ -1746,7 +1964,7 @@ module, and nothing else.")
     (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
     (description
      "@code{MySQL::Config} emulates the @code{load_defaults} function from
-libmysqlclient.  It will fill an aray with long options, ready to be parsed by
+libmysqlclient.  It will fill an array with long options, ready to be parsed by
 @code{Getopt::Long}.")
     (license license:perl-license)))
 
@@ -1782,6 +2000,42 @@ structures you provide it, so that you don't have to modify your code every
 time your data changes.")
     (license license:perl-license)))
 
+(define-public perl-sql-abstract-classic
+  (package
+    (name "perl-sql-abstract-classic")
+    (version "1.91")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
+                           "SQL-Abstract-Classic-" version ".tar.gz"))
+       (sha256
+        (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
+    (build-system perl-build-system)
+    (native-inputs
+     `(("perl-test-deep" ,perl-test-deep)
+       ("perl-test-exception" ,perl-test-exception)
+       ("perl-test-warn" ,perl-test-warn)))
+    (propagated-inputs
+     `(("perl-mro-compat" ,perl-mro-compat)
+       ("perl-sql-abstract" ,perl-sql-abstract)))
+    (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
+    (synopsis "Generate SQL from Perl data structures")
+    (description
+     "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
+to preserve the ability of users to opt into the new way of doing things in
+later versions according to their own schedules.
+
+It is an abstract SQL generation module based on the concepts used by
+@code{DBIx::Abstract}, with several important differences, especially when it
+comes to @code{WHERE} clauses.  These concepts were modified to make the SQL
+easier to generate from Perl data structures.
+
+The underlying idea is for this module to do what you mean, based on the data
+structures you provide it.  You shouldn't have to modify your code every time
+your data changes, as this module figures it out.")
+    (license license:perl-license)))
+
 (define-public perl-sql-splitstatement
   (package
     (name "perl-sql-splitstatement")
@@ -1906,14 +2160,14 @@ sets, bitmaps and hyperloglogs.")
 (define-public kyotocabinet
   (package
     (name "kyotocabinet")
-    (version "1.2.77")
+    (version "1.2.78")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
-                                  name "-" version ".tar.gz"))
+              (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
+                                  "kyotocabinet-" version ".tar.gz"))
               (sha256
                (base32
-                "1rlx4307adbzd842b4npq6cwlw8h010ingxaz3qz1ijc70lr72an"))))
+                "1bxkf9kmcavq9rqridb8mvmrk3hj4447ffi24m2admsbm61n6k29"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -1922,7 +2176,7 @@ sets, bitmaps and hyperloglogs.")
         (string-append "LDFLAGS=-Wl,-rpath="
                        (assoc-ref %outputs "out") "/lib"))))
     (inputs `(("zlib" ,zlib)))
-    (home-page "http://fallabs.com/kyotocabinet/")
+    (home-page "https://fallabs.com/kyotocabinet/")
     (synopsis
      "Kyoto Cabinet is a modern implementation of the DBM database")
     (description
@@ -2053,14 +2307,14 @@ database.")
 (define-public perl-db-file
  (package
   (name "perl-db-file")
-  (version "1.853")
+  (version "1.855")
   (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
                           version ".tar.gz"))
       (sha256
-        (base32 "1y967si45vj0skip1hnhicbv9da29fv6qcfwnsbnvj06n36mkj6h"))))
+        (base32 "0q599h7g4jkzks5dxf1zifx9k7l9vif26r2dlgkzxkg6bfif5zyr"))))
   (build-system perl-build-system)
   (inputs `(("bdb" ,bdb)))
   (native-inputs `(("perl-test-pod" ,perl-test-pod)))
@@ -2073,8 +2327,7 @@ database.")
                        (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
                      #t)))))
   (home-page "https://metacpan.org/release/DB_File")
-  (synopsis
-    "Perl5 access to Berkeley DB version 1.x")
+  (synopsis "Perl5 access to Berkeley DB version 1.x")
   (description
     "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
   (license license:perl-license)))
@@ -2082,7 +2335,7 @@ database.")
 (define-public lmdb
   (package
     (name "lmdb")
-    (version "0.9.25")
+    (version "0.9.26")
     (source
      (origin
        (method git-fetch)
@@ -2091,7 +2344,7 @@ database.")
              (commit (string-append "LMDB_" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0i60zlca8r6fib23gdgl4c80gxpx24772ggpvz94yr7zaai4k11w"))))
+        (base32 "0323xwb2rqyrr9vr6gbxc2kl89drhqw0ifmyh9pg9qgqmymyhxdx"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -2125,7 +2378,7 @@ virtual address space — not physical RAM.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/drycpp/lmdbxx.git")
+             (url "https://github.com/drycpp/lmdbxx")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -2183,17 +2436,19 @@ on another machine, accessed via TCP/IP.")
 (define-public python-peewee
   (package
     (name "python-peewee")
-    (version "3.9.6")
-      (source
-        (origin
-        (method url-fetch)
-        (uri (pypi-uri "peewee" version))
-        (sha256
-         (base32
-          "1j4sh946k0736m7pd54z0y6i2hjhgg3kdllx1pwq8xkzzcgrx1xw"))))
+    (version "3.13.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "peewee" version))
+       (sha256
+        (base32
+         "0sc376v6rxga4b7ic9kxw2pmf28rmcx016320pa2nlb5d1rsjs8j"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f)) ; Fails to import test data
+    (inputs
+     `(("sqlite" ,sqlite)))
     (native-inputs
      `(("python-cython" ,python-cython)))
     (home-page "https://github.com/coleifer/peewee/")
@@ -2354,7 +2609,7 @@ for ODBC.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/brianb/mdbtools.git")
+             (url "https://github.com/brianb/mdbtools")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -2383,13 +2638,13 @@ etc., and an SQL engine for performing simple SQL queries.")
 (define-public python-lmdb
   (package
     (name "python-lmdb")
-    (version "0.98")
+    (version "1.0.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "lmdb" version))
               (sha256
                (base32
-                "027pgbdhhdcbwj53vrzr6a60gjhmz4s75gl3180fd4q8pwlbq986"))
+                "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
               (modules '((guix build utils)))
               (snippet
                ;; Delete bundled lmdb source files.
@@ -2408,6 +2663,7 @@ etc., and an SQL engine for performing simple SQL queries.")
          (add-before 'build 'use-system-lmdb
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((lmdb (assoc-ref inputs "lmdb")))
+               (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
                (setenv "LMDB_FORCE_SYSTEM" "set")
                (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
                (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
@@ -2482,7 +2738,19 @@ implementation for Python.")
        ;; TODO: Removing the libsrc/zlib source directory breaks the build.
        ;; This indicates that the internal zlib code may still be used.
        #:configure-flags '("--without-internal-zlib"
-                           "--with-readline")))
+                           "--with-readline"
+                           "--enable-static=no")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
+         ;; the build output.  The following phase removes it.
+         (add-after 'install 'remove-static-libs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+               (for-each (lambda (file)
+                           (delete-file (string-append lib "/" file)))
+                         '("libvirtuoso-t.a"
+                           "libvirtuoso-t.la"))))))))
     (inputs
      `(("openssl" ,openssl-1.0)
        ("net-tools" ,net-tools)
@@ -2553,13 +2821,13 @@ Database API 2.0T.")
 (define-public python-sqlalchemy
   (package
     (name "python-sqlalchemy")
-    (version "1.3.15")
+    (version "1.3.20")
     (source
      (origin
       (method url-fetch)
       (uri (pypi-uri "SQLAlchemy" version))
       (sha256
-       (base32 "0iglkvymfp35zm5pxy5kzqvcv96kkas0chqdx7xpla86sspa9k64"))))
+       (base32 "18b9am7bsqc4nj3d2h5r93i002apczxfvpfpcqbd6f0385zmrwnj"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-cython" ,python-cython) ; for C extensions
@@ -2633,18 +2901,57 @@ You might also want to install the following optional dependencies:
 (define-public python2-sqlalchemy-utils
   (package-with-python2 python-sqlalchemy-utils))
 
+(define-public python-alchemy-mock
+  (package
+    (name "python-alchemy-mock")
+    (version "0.4.3")
+    (home-page "https://github.com/miki725/alchemy-mock")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "alchemy-mock" version))
+              (sha256
+               (base32
+                "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      ;; Create pytest.ini that adds doctest options to
+                      ;; prevent test failure.  Taken from tox.ini.
+                      (call-with-output-file "pytest.ini"
+                        (lambda (port)
+                          (format port "[pytest]
+doctest_optionflags=IGNORE_EXCEPTION_DETAIL
+")))
+                      (invoke "pytest" "-vv" "--doctest-modules"
+                              "alchemy_mock/"))))))
+    (native-inputs
+     `(("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-six" ,python-six)
+       ("python-sqlalchemy" ,python-sqlalchemy)))
+    (synopsis "Mock helpers for SQLAlchemy")
+    (description
+     "This package provides mock helpers for SQLAlchemy that makes it easy
+to mock an SQLAlchemy session while preserving the ability to do asserts.
+
+Normally Normally SQLAlchemy's expressions cannot be easily compared as
+comparison on binary expression produces yet another binary expression, but
+this library provides functions to facilitate such comparisons.")
+    (license license:expat)))
+
 (define-public python-alembic
   (package
     (name "python-alembic")
-    (version "1.4.1")
+    (version "1.4.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "alembic" version))
-       (patches (search-patches "python-alembic-exceptions-cause.patch"))
        (sha256
-        (base32
-         "0a4hzn76csgbf1px4f5vfm256byvjrqkgi9869nkcjrwjn35c6kr"))))
+        (base32 "0if2dgb088clk738p26bwk50735h6jpd2kacdgc5capv2hiz6d2k"))))
     (build-system python-build-system)
     (arguments
      '(#:phases (modify-phases %standard-phases
@@ -2820,13 +3127,13 @@ designed to be easy and intuitive to use.")
 (define-public python-psycopg2
   (package
     (name "python-psycopg2")
-    (version "2.8.4")
+    (version "2.8.6")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "psycopg2" version))
        (sha256
-        (base32 "1djvh98pi4hjd8rxbq8qzc63bg8v78k33yg6pl99wak61b6fb67q"))))
+        (base32 "0hzmk6b1hb5riqkljr5xics6p4zbvmis6knbczb7zhq7273zc8zv"))))
     (build-system python-build-system)
     (arguments
      ;; Tests would require a postgresql database "psycopg2_test"
@@ -2871,27 +3178,52 @@ database).")
 (define-public python2-sadisplay
   (package-with-python2 python-sadisplay))
 
+(define-public yoyo-migrations
+  (package
+    (name "yoyo-migrations")
+    (version "7.2.0")
+    (source
+     (origin
+       ;; We use the upstream repository, as the tests are not included in the
+       ;; PyPI releases.
+       (method hg-fetch)
+       (uri (hg-reference
+             (url "https://hg.sr.ht/~olly/yoyo")
+             (changeset (string-append "v" version "-release"))))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "0q2z9bgdj3wyix7yvqsayfs21grp5av8ilh411lgmjhigszkvhcq"))))
+    (build-system python-build-system)
+    (arguments
+     ;; XXX: Tests require a connection to some pgsql database and psycopg
+     ;; fails to connect to it.
+     '(#:tests? #f))
+    (propagated-inputs
+     `(("python-sqlparse" ,python-sqlparse)
+       ("python-tabulate" ,python-tabulate)))
+    (home-page "https://ollycope.com/software/yoyo/latest/")
+    (synopsis "Database migrations with SQL")
+    (description
+     "Yoyo is a database schema migration tool.  Migrations are written as SQL
+files or Python scripts that define a list of migration steps.")
+    (license license:asl2.0)))
+
 (define-public python-mysqlclient
   (package
     (name "python-mysqlclient")
-    (version "1.3.13")
+    (version "2.0.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "mysqlclient" version))
        (sha256
         (base32
-         "0kv4a1icwdav8jpl7qvnr931lw5h3v22ids6lwq6qpi1hjzf33pz"))))
+         "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
     (build-system python-build-system)
-    (native-inputs
-     `(("nose" ,python-nose)
-       ("mock" ,python-mock)
-       ("py.test" ,python-pytest)))
+    (arguments '(#:tests? #f))          ;XXX: requires a live database
     (inputs
      `(("mysql" ,mariadb "lib")
-       ("mysql-dev" ,mariadb "dev")
-       ("libz" ,zlib)
-       ("openssl" ,openssl)))
+       ("mysql-dev" ,mariadb "dev")))
     (home-page "https://github.com/PyMySQL/mysqlclient-python")
     (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
     (description "MySQLdb is an interface to the popular MySQL database server
@@ -2903,9 +3235,6 @@ for Python.  The design goals are:
 @end enumerate")
     (license license:gpl2)))
 
-(define-public python2-mysqlclient
-  (package-with-python2 python-mysqlclient))
-
 (define-public python-hiredis
   (package
     (name "python-hiredis")
@@ -2965,13 +3294,13 @@ reasonable substitute.")
 (define-public python-redis
   (package
     (name "python-redis")
-    (version "3.3.8")
+    (version "3.5.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "redis" version))
        (sha256
-        (base32 "0fyxzqax7lcwzwhvnz0i0q6v62hxyv1mv52ywx3bpff9a2vjz8lq"))))
+        (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
     (build-system python-build-system)
     ;; Tests require a running Redis server.
     (arguments '(#:tests? #f))
@@ -2990,14 +3319,35 @@ reasonable substitute.")
 (define-public python-rq
   (package
     (name "python-rq")
-    (version "0.13.0")
+    (version "1.5.2")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "rq" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rq/rq")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "0xvapd2bxnyq480i48bdkddzlqmv2axbsq85rlfy8k3al8zxxxrf"))))
+        (base32 "0ikqmpq0g1qiqwd7ar1286l4hqjb6aj2wr844gihhb8ijzwhp8va"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-before 'check 'start-redis
+                    (lambda _
+                      (invoke "redis-server" "--daemonize" "yes")))
+                  (replace 'check
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        ;; Drop test that needs the SDK for Sentry.io.
+                        (delete-file "tests/test_sentry.py")
+                        ;; Ensure 'rq' and 'rqworker' ends up on PATH.
+                        (setenv "PATH" (string-append out "/bin:"
+                                                      (getenv "PATH")))
+                        (invoke "pytest" "-vv")))))))
+    (native-inputs
+     `(("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)
+       ("redis" ,redis)))
     (propagated-inputs
      `(("python-click" ,python-click)
        ("python-redis" ,python-redis)))
@@ -3012,6 +3362,44 @@ is designed to have a low barrier to entry.")
 (define-public python2-rq
   (package-with-python2 python-rq))
 
+(define-public python-rq-scheduler
+  (package
+    (name "python-rq-scheduler")
+    (version "0.10.0")
+    (home-page "https://github.com/rq/rq-scheduler")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-before 'check 'start-redis
+                    (lambda _
+                      (invoke "redis-server" "--daemonize" "yes")))
+                  (replace 'check
+                    (lambda _
+                      (substitute* "run_tests.py"
+                        (("/usr/bin/env")
+                         (which "env")))
+                      (invoke "./run_tests.py"))))))
+    (native-inputs
+     `(("redis" ,redis)
+       ("which" ,which)))
+    (propagated-inputs
+     `(("python-croniter" ,python-croniter)
+       ("python-rq" ,python-rq)))
+    (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
+    (description
+     "This package provides job scheduling capabilities to @code{python-rq}
+(Redis Queue).")
+    (license license:expat)))
+
 (define-public python-trollius-redis
   (package
     (name "python-trollius-redis")
@@ -3039,13 +3427,13 @@ is designed to have a low barrier to entry.")
 (define-public python-sqlparse
   (package
     (name "python-sqlparse")
-    (version "0.2.4")
+    (version "0.3.1")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "sqlparse" version))
               (sha256
                (base32
-                "1v3xh0bkfhb262dbndgzhivpnhdwavdzz8jjhx9vx0xbrx2880nf"))))
+                "0j652a6z7bdf6c77aczfn8m8b2nsr1bcqq48wzghf8vi6wvj0qp1"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -3090,7 +3478,7 @@ transforms idiomatic python function calls to well-formed SQL queries.")
     (source
      (origin (method git-fetch)
              (uri (git-reference
-                   (url "https://github.com/kayak/pypika.git")
+                   (url "https://github.com/kayak/pypika")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
@@ -3500,7 +3888,7 @@ The drivers officially supported by @code{libdbi} are:
 (define-public soci
   (package
     (name "soci")
-    (version "4.0.0")
+    (version "4.0.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -3509,24 +3897,22 @@ The drivers officially supported by @code{libdbi} are:
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "06faswdxd2frqr9xnx6bxc7zwarlzsbdi3bqpz7kwdxsjvq41rnb"))))
+                "14x2gjblkgpflv75wl144cyjp1sis5rbxnr9r2gj3yw16v2av0bp"))))
     (build-system cmake-build-system)
     (inputs
-     `(("postgresql" ,postgresql)
+     `(("firebird" ,firebird)
+       ("postgresql" ,postgresql)
        ("sqlite" ,sqlite)
        ("odbc" ,unixodbc)
        ("boost" ,boost)
        ("mariadb:dev" ,mariadb "dev")
        ("mariadb:lib" ,mariadb "lib")))
     (arguments
-     `(#:tests? #f ; Tests may require running database management systems.
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-lib-path
-           (lambda _
-             (substitute* "CMakeLists.txt"
-               (("set\\(SOCI_LIBDIR \"lib64\"\\)") ""))
-             #t)))))
+     `(#:configure-flags
+       ;; C++11 (-DSOCI_CXX11) is OFF by default.  hyperledger-iroha needs it.
+       (list "-DCMAKE_CXX_STANDARD=17"
+             "-DSOCI_LIBDIR=lib")
+       #:tests? #f))         ; may require running database management systems
     (synopsis "C++ Database Access Library")
     (description
      "SOCI is an abstraction layer for several database backends, including