gnu: ffmpeg@4: Build against SDL2 2.0 so 'ffplay' gets built.
[jackhill/guix/guix.git] / gnu / packages / databases.scm
CommitLineData
5f96f303 1;;; GNU Guix --- Functional package management for GNU
3fce3c2c 2;;; Copyright © 2012-2016, 2018, 2022 Ludovic Courtès <ludo@gnu.org>
a8714bf6
RW
3;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
218a2106 5;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
b9ed5ef3 6;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
a8714bf6 7;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
da1f7a9e 8;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
b747a9db 9;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
a8714bf6 10;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
59625e3c 11;;; Copyright © 2016, 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
94551439 12;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
c5908b5c 13;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
3c986a7d 14;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
6d09a7b5 15;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
0e1b262e 16;;; Copyright © 2016 David Craven <david@craven.ch>
fe71eee0 17;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
62ea44fc 18;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
a8714bf6 19;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
8d5bdb93 20;;; Copyright © 2016-2022 Marius Bakke <marius@gnu.org>
c336567d 21;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
7dc0f1d5 22;;; Copyright © 2017, 2020 Thomas Danckaert <post@thomasdanckaert.be>
a8714bf6
RW
23;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
24;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
256c3e71 25;;; Copyright © 2017, 2021 Arun Isaac <arunisaac@systemreboot.net>
9d349c01 26;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <me@tobias.gr>
38abef12 27;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
19601e89 28;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
231123ee 29;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
a5b24740 30;;; Copyright © 2017, 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
feb6bb28 31;;; Copyright © 2015, 2017, 2018, 2019, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
16973071 32;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
3926a099 33;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
dae7661a 34;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
f0227a18 35;;; Copyright © 2018, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
9df78675 36;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
a3abc3fd 37;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
91477def 38;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
3ece5dbc 39;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
2072bc08 40;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
c017e0b6 41;;; Copyright © 2020, 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
1655e7be 42;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
ba0b249d 43;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
8de54c63 44;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
d343e0fe 45;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
945ec6c3 46;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
a7051a0e 47;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
0c0a2831 48;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
23af76f1 49;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
43c55856 50;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
04ab609b 51;;; Copyright © 2021 Pjotr Prins <pjotr.guix@thebird.nl>
f8a4724c 52;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com>
841edfa4 53;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
b8e7b284 54;;; Copyright © 2021 Alexandre Hannud Abdo <abdo@member.fsf.org>
94006cc2 55;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
54cc341e 56;;; Copyright © 2021 jgart <jgart@dismail.de>
8255e899 57;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
9183b814 58;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
f0227a18 59;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
cec5a522 60;;; Copyright © 2022 muradm <mail@muradm.net>
5f96f303
LC
61;;;
62;;; This file is part of GNU Guix.
63;;;
64;;; GNU Guix is free software; you can redistribute it and/or modify it
65;;; under the terms of the GNU General Public License as published by
66;;; the Free Software Foundation; either version 3 of the License, or (at
67;;; your option) any later version.
68;;;
69;;; GNU Guix is distributed in the hope that it will be useful, but
70;;; WITHOUT ANY WARRANTY; without even the implied warranty of
71;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72;;; GNU General Public License for more details.
73;;;
74;;; You should have received a copy of the GNU General Public License
75;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
76
77(define-module (gnu packages databases)
78 #:use-module (gnu packages)
58071723 79 #:use-module (gnu packages admin)
06a035db 80 #:use-module (gnu packages algebra)
4c6aa73b
RJ
81 #:use-module (gnu packages autotools)
82 #:use-module (gnu packages avahi)
77e52190 83 #:use-module (gnu packages base)
b747a9db 84 #:use-module (gnu packages bash)
06a035db 85 #:use-module (gnu packages bison)
23bbd7dd 86 #:use-module (gnu packages boost)
06a035db 87 #:use-module (gnu packages check)
dae7661a 88 #:use-module (gnu packages cmake)
06a035db 89 #:use-module (gnu packages compression)
bf0f9dd0 90 #:use-module (gnu packages cpp)
62ea44fc 91 #:use-module (gnu packages crypto)
06a035db
MB
92 #:use-module (gnu packages curl)
93 #:use-module (gnu packages cyrus-sasl)
255d1bbe 94 #:use-module (gnu packages dbm)
f0227a18 95 #:use-module (gnu packages docbook)
06a035db 96 #:use-module (gnu packages emacs)
da602679 97 #:use-module (gnu packages flex)
b8e7b284 98 #:use-module (gnu packages freedesktop)
94006cc2 99 #:use-module (gnu packages gawk)
2fa55c72 100 #:use-module (gnu packages gcc)
4c6aa73b
RJ
101 #:use-module (gnu packages gettext)
102 #:use-module (gnu packages glib)
b8e7b284 103 #:use-module (gnu packages gnome)
06a035db 104 #:use-module (gnu packages gnupg)
33c88fcb 105 #:use-module (gnu packages golang)
48efbde7 106 #:use-module (gnu packages gperf)
b8e7b284 107 #:use-module (gnu packages gtk)
100a4f84 108 #:use-module (gnu packages guile)
3f8158d6 109 #:use-module (gnu packages icu4c)
06a035db 110 #:use-module (gnu packages jemalloc)
708155df 111 #:use-module (gnu packages language)
3f8158d6 112 #:use-module (gnu packages libedit)
686144e9 113 #:use-module (gnu packages libevent)
5f96f303 114 #:use-module (gnu packages linux)
100a4f84
SH
115 #:use-module (gnu packages lisp)
116 #:use-module (gnu packages lisp-xyz)
9e220f09 117 #:use-module (gnu packages llvm)
a50628bb 118 #:use-module (gnu packages logging)
d39a84e8 119 #:use-module (gnu packages man)
a50628bb 120 #:use-module (gnu packages maths)
3f8158d6 121 #:use-module (gnu packages multiprecision)
5f96f303 122 #:use-module (gnu packages ncurses)
5ec41299 123 #:use-module (gnu packages networking)
aace6f6d 124 #:use-module (gnu packages onc-rpc)
59625e3c 125 #:use-module (gnu packages openstack)
b8e7b284 126 #:use-module (gnu packages pantheon)
d3c6ad0a 127 #:use-module (gnu packages parallel)
77631745 128 #:use-module (gnu packages pcre)
06a035db 129 #:use-module (gnu packages perl)
5ccde207 130 #:use-module (gnu packages perl-check)
cabe8f18 131 #:use-module (gnu packages perl-web)
4c6aa73b 132 #:use-module (gnu packages pkg-config)
d3c6ad0a 133 #:use-module (gnu packages popt)
a50628bb 134 #:use-module (gnu packages protobuf)
06a035db 135 #:use-module (gnu packages python)
ed210c1b 136 #:use-module (gnu packages python-build)
f8a4724c 137 #:use-module (gnu packages python-check)
9763102b 138 #:use-module (gnu packages python-crypto)
312ec128 139 #:use-module (gnu packages python-science)
100a4f84 140 #:use-module (gnu packages python-web)
44d10b1f 141 #:use-module (gnu packages python-xyz)
9183b814 142 #:use-module (gnu packages qt)
4c6aa73b 143 #:use-module (gnu packages rdf)
06a035db 144 #:use-module (gnu packages readline)
a50628bb
KCB
145 #:use-module (gnu packages regex)
146 #:use-module (gnu packages rpc)
afcbb020 147 #:use-module (gnu packages ruby)
6bbbca90 148 #:use-module (gnu packages serialization)
9d0c291e 149 #:use-module (gnu packages sphinx)
b8e7b284 150 #:use-module (gnu packages ssh)
cd0322a3 151 #:use-module (gnu packages sqlite)
cec5a522 152 #:use-module (gnu packages syncthing) ;for go-github-com-lib-pq
06a035db 153 #:use-module (gnu packages tcl)
33c88fcb 154 #:use-module (gnu packages terminals)
c41ccac4 155 #:use-module (gnu packages texinfo)
33c88fcb 156 #:use-module (gnu packages textutils)
100a4f84 157 #:use-module (gnu packages time)
06a035db 158 #:use-module (gnu packages tls)
6bbbca90 159 #:use-module (gnu packages valgrind)
dae7661a 160 #:use-module (gnu packages web)
54cc341e 161 #:use-module (gnu packages xdisorg)
77631745 162 #:use-module (gnu packages xml)
2b7cd75f 163 #:use-module (guix gexp)
0e1b262e 164 #:use-module ((guix licenses) #:prefix license:)
5f96f303
LC
165 #:use-module (guix packages)
166 #:use-module (guix download)
da602679 167 #:use-module (guix bzr-download)
16973071 168 #:use-module (guix git-download)
945ec6c3 169 #:use-module (guix hg-download)
9df78675 170 #:use-module (guix build-system emacs)
5f96f303 171 #:use-module (guix build-system gnu)
58071723 172 #:use-module (guix build-system go)
b8e7b284 173 #:use-module (guix build-system meson)
274da61d 174 #:use-module (guix build-system perl)
4d98bfaf 175 #:use-module (guix build-system python)
9183b814 176 #:use-module (guix build-system qt)
afcbb020 177 #:use-module (guix build-system ruby)
77631745 178 #:use-module (guix build-system cmake)
6e385b76 179 #:use-module (guix build-system scons)
9077cf68 180 #:use-module (guix build-system trivial)
329d13b8 181 #:use-module (guix utils)
29cfbfca 182 #:use-module (srfi srfi-1)
5f96f303
LC
183 #:use-module (srfi srfi-26)
184 #:use-module (ice-9 match))
185
6fc03fcc
CB
186(define-public ephemeralpg
187 (package
188 (name "ephemeralpg")
33df4763 189 (version "3.1")
6fc03fcc
CB
190 (source
191 (origin
192 (method url-fetch)
193 (uri (string-append
8e716256 194 "https://eradman.com/ephemeralpg/code/ephemeralpg-"
6fc03fcc
CB
195 version ".tar.gz"))
196 (sha256
33df4763 197 (base32 "1ap22ki8yz6agd0qybcjgs4b9izw1rwwcgpxn3jah2ccfyax34s6"))))
6fc03fcc
CB
198 (build-system gnu-build-system)
199 (arguments
ddb418b5 200 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
6fc03fcc
CB
201 (string-append "PREFIX=" %output))
202 #:phases
203 (modify-phases %standard-phases
6c54d06e 204 (delete 'configure) ; no configure script
6fc03fcc
CB
205 (add-after 'install 'wrap
206 (lambda* (#:key inputs outputs #:allow-other-keys)
207 (let ((out (assoc-ref outputs "out")))
208 (wrap-program (string-append out "/bin/pg_tmp")
209 `("PATH" ":" prefix
210 (,(string-append (assoc-ref inputs "util-linux")
211 "/bin")
212 ,(string-append (assoc-ref inputs "postgresql")
213 "/bin")
fa8343de 214 ;; For getsocket.
6fc03fcc 215 ,(string-append out "/bin")))))
6c54d06e
TGR
216 #t)))
217 #:test-target "test"))
6fc03fcc 218 (inputs
8394619b 219 (list postgresql util-linux))
6fc03fcc 220 (native-inputs
6c54d06e 221 ;; For tests.
8394619b 222 (list ruby which))
8e716256 223 (home-page "https://eradman.com/ephemeralpg/")
6fc03fcc
CB
224 (synopsis "Run temporary PostgreSQL databases")
225 (description
226 "@code{pg_tmp} creates temporary PostgreSQL databases, suitable for tasks
227like running software test suites. Temporary databases created with
228@code{pg_tmp} have a limited shared memory footprint and are automatically
229garbage-collected after a configurable number of seconds (the default is
23060).")
231 (license license:isc)))
232
afcbb020
CB
233(define-public es-dump-restore
234 (package
235 (name "es-dump-restore")
236 (version "2.1.0")
237 (source
238 (origin
239 (method url-fetch)
240 (uri (rubygems-uri "es_dump_restore" version))
241 (sha256
242 (base32
243 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
244 (build-system ruby-build-system)
245 (arguments
0076f5a9 246 '(#:tests? #f)) ;; No testsuite.
afcbb020 247 (propagated-inputs
8394619b
LC
248 (list ruby-httpclient ruby-multi-json ruby-progress_bar ruby-rubyzip
249 ruby-thor))
afcbb020
CB
250 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
251 (description
252 "This package provides a utility for dumping the contents of an
253ElasticSearch index to a compressed file and restoring the dumpfile back to an
254ElasticSearch server")
255 (home-page "https://github.com/patientslikeme/es_dump_restore")
256 (license license:expat)))
257
3f8158d6
TGR
258(define-public firebird
259 (package
260 (name "firebird")
261 (version "3.0.7")
262 (source
263 (let ((revision "33374-0"))
264 (origin
265 (method url-fetch)
266 (uri (string-append "https://github.com/FirebirdSQL/"
267 "firebird/releases/download/R"
268 (string-replace-substring version "." "_") "/"
269 "Firebird-" version "." revision ".tar.bz2"))
270 (sha256
271 (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
272 (modules '((guix build utils)))
273 (snippet
274 `(begin
275 (for-each
276 delete-file-recursively
277 (list "extern/btyacc/test" ; TODO: package and remove entirely
278 "extern/editline"
279 "extern/icu"
280 "extern/libtommath"
281 "extern/zlib"
282 "src/include/firebird/impl/boost"
283
284 ;; Missing licence.
285 "builds/install/arch-specific/solaris"
286 "extern/SfIO"
287 "src/msgs/templates.sql"
288
289 ;; Generated files missing sources.
290 "doc/Firebird-3-QuickStart.pdf"
291 (string-append "doc/Firebird-" ,version
292 "-ReleaseNotes.pdf")
293 "doc/README.SecureRemotePassword.html"))
294 #t)))))
295 (build-system gnu-build-system)
296 (outputs (list "debug" "out"))
297 (arguments
298 `(#:configure-flags
299 (let ((out (assoc-ref %outputs "out")))
300 (list (string-append "--with-fbsbin=" out "/sbin")
301 (string-append "--with-fbdoc=" out "/share/doc/"
302 ,name "-" ,version)
303 (string-append "--with-fbconf=" out "/lib/firebird")
304 (string-append "--with-fbintl=" out "/lib/firebird/intl")
305 (string-append "--with-fbmisc=" out "/lib/firebird/misc")
306 (string-append "--with-fbmsg=" out "/lib/firebird")
307 (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
308 (string-append "--with-fbudf=" out "/lib/firebird/UDF")
309 "--with-fbglock=/run/firebird"
310 "--with-fblog=/var/log/firebird"
311 "--with-fbhelp=/var/lib/firebird/system"
312 "--with-fbsecure-db=/var/lib/firebird/secure"
313 "--without-fbsample"
314 "--without-fbsample-db"
315 "--with-system-editline"))
316 #:make-flags
317 (list (string-append "CC=" ,(cc-for-target))
318 ;; The plugins/ can't find libfbclient otherwise.
319 (string-append "LDFLAGS=-Wl,-rpath="
320 (assoc-ref %outputs "out") "/lib"))
321 #:tests? #f ; no test suite
322 #:modules ((guix build gnu-build-system)
323 (guix build utils)
324 (srfi srfi-26))
325 #:phases
326 (modify-phases %standard-phases
327 (add-after 'unpack 'use-system-boost
328 (lambda _
329 (substitute* "src/include/firebird/Message.h"
330 (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
331 "<boost/preprocessor/seq/for_each_i.hpp>")
332 (("FB_BOOST_") "BOOST_"))
333 #t))
334 (add-after 'unpack 'patch-installation
335 (lambda _
336 (substitute*
337 "builds/install/arch-specific/linux/makeInstallImage.sh.in"
338 (("/bin/sh") (which "bash"))
339 ;; Remove shell script helpers from $PATH.
340 (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
341 ;; Put files where Guix users expect them.
342 (("(License\\.txt.*)@FB_CONFDIR" match)
343 (string-append match "@FB_DOCDIR@"))
344 (("@FB_CONFDIR@(.*License\\.txt.*)" match)
345 (string-append "@FB_DOCDIR@" match))
346 (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
347 (string-append head "@FB_DOCDIR@" tail "\n")))
348 (substitute*
349 (list "builds/install/posix-common/changeServerMode.sh.in"
350 "builds/install/posix-common/install.sh.in")
351 ;; Skip phases that (could) cause problems in Guix.
352 (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
353 ":")
354 ;; Skip phases that are merely pointless on Guix.
355 (("buildUninstallFile|installInitdScript|startFirebird") ":")
356 ;; Omit randomly generated password with bonus timestamp.
357 (("setDBAPassword") ":"))
358
359 ;; These promote proprietary workflows not relevant on Guix.
360 (for-each delete-file-recursively
361 (find-files "doc" "README\\.(build\\.msvc|NT|Win)"))
362 #t))
363 (add-after 'configure 'delete-init-scripts
364 (lambda _
365 (delete-file-recursively "gen/install/misc")
366 #t))
367 (add-before 'build 'set-build-environment-variables
368 (lambda _
369 ;; ‘isql’ needs to run & find libfbclient.so during the build.
370 ;; This doubles as a rudimentary test in lieu of a test suite.
371 (setenv "LD_LIBRARY_PATH"
372 (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
373 #t))
374 (add-before 'install 'keep-embedded-debug-symbols
375 (lambda _
376 ;; Let the gnu-build-system separate & deal with them later.
377 ;; XXX Upstream would use ‘--strip-unneeded’, shaving a whole
378 ;; megabyte off Guix's 7.7M libEngine12.so, for example.
379 (substitute* "gen/Makefile.install"
380 (("readelf") "false"))
381 #t))
382 (add-after 'install 'prune-undesirable-files
383 (lambda* (#:key outputs #:allow-other-keys)
384 (let ((out (assoc-ref outputs "out")))
385 (with-directory-excursion out
386 ;; Remove example binaries.
387 (for-each delete-file-recursively
388 (find-files "." "example"))
389 ;; Delete (now-)empty directories.
390 (for-each rmdir
391 (list "include/firebird/impl"
392 "lib/firebird/plugins/udr"))
393 #t)))))))
394 (inputs
8394619b
LC
395 (list boost
396 editline
397 icu4c-67
398 libtommath
399 ncurses
400 zlib))
3f8158d6
TGR
401 (home-page "https://www.firebirdsql.org")
402 (synopsis "Relational database with many ANSI SQL standard features")
403 (description
404 "Firebird is an SQL @acronym{RDBMS, relational database management system}
e5d5146b
TGR
405with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}) including
406@acronym{UDFs, user-defined functions} and PSQL stored procedures, cursors, and
407triggers. Transactions provide full ACID-compliant referential integrity.
3f8158d6
TGR
408
409The database requires very little manual maintenance once set up, making it
410ideal for small business or embedded use.
411
412When installed as a traditional local or remote (network) database server,
413Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
414may be a better choice for such very large environments.
415
416Firebird can also be embedded into stand-alone applications that don't want or
417need a full client & server. Used in this manner, it offers richer SQL support
418than SQLite as well as the option to seamlessly migrate to a client/server
419database later.")
420 (properties
421 `((lint-hidden-cve . ("CVE-2017-6369"))))
422 (license
423 ;; See doc/license/README.license.usage.txt for rationale & details.
424 (list license:bsd-3 ; src/common/sha2/
425 license:bsd-4 ; src/common/enc.cpp
426 license:gpl2+ ; builds/posix/make.defaults
427 (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
428 "InterBase Public License v1.0")
429 (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
430 "Initial Developer's Public License v1.0")
431 license:lgpl2.1 ; exception for OSI-compatible licences
432 license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
433 license:public-domain)))) ; including files without explicit licence
434
b9f771a7
MB
435(define-public leveldb
436 (package
437 (name "leveldb")
2b7cd75f 438 (version "1.23")
b9f771a7 439 (source (origin
ad7c77fd
MB
440 (method git-fetch)
441 (uri (git-reference
442 (url "https://github.com/google/leveldb")
5cc013f0 443 (commit version)))
ad7c77fd 444 (file-name (git-file-name name version))
b9f771a7
MB
445 (sha256
446 (base32
2b7cd75f 447 "1chxkhb6ajdmj4p8535k4472fbmqvcismll6aapkarsr45yrvgs4"))))
5cc013f0 448 (build-system cmake-build-system)
b9f771a7 449 (arguments
2b7cd75f
TGR
450 (list #:configure-flags
451 #~(list "-DBUILD_SHARED_LIBS=ON"
452 "-DLEVELDB_BUILD_TESTS=ON"
453
454 ;; Don't install(!) the third_party test frameworks below.
455 "-DINSTALL_GTEST=OFF"
456 "-DBENCHMARK_ENABLE_INSTALL=OFF")
457 #:phases
458 #~(modify-phases %standard-phases
500d734b
RW
459 ;; Ceph uses leveldb and depends on RTTI.
460 (add-after 'unpack 'allow-RTTI
461 (lambda _
462 (substitute* "CMakeLists.txt"
463 (("set\\(CMAKE_CXX_FLAGS \"\\$\\{CMAKE_CXX_FLAGS\\} -fno-rtti\"\\)")
464 ""))))
2b7cd75f
TGR
465 (add-after 'unpack 'unpack-third_party-sources
466 ;; These are only for testing, so copying source is fine.
467 (lambda _
468 (copy-recursively #$(package-source googletest)
469 "third_party/googletest")
470 (copy-recursively #$(package-source googlebenchmark)
471 "third_party/benchmark"))))))
b9f771a7 472 (inputs
8394619b 473 (list snappy))
fd423e4d 474 (home-page "https://github.com/google/leveldb")
b9f771a7
MB
475 (synopsis "Fast key-value storage library")
476 (description
477 "LevelDB is a fast key-value storage library that provides an ordered
478mapping from string keys to string values.")
ba8b9f8d 479 (license license:bsd-3)))
b9f771a7 480
686144e9
CB
481(define-public memcached
482 (package
483 (name "memcached")
e5baa4ad 484 (version "1.6.16")
686144e9
CB
485 (source
486 (origin
487 (method url-fetch)
488 (uri (string-append
489 "https://memcached.org/files/memcached-" version ".tar.gz"))
490 (sha256
e5baa4ad 491 (base32 "1nilmfhy8hc7zzlihnx3hmiqf7siyrpgz2g5s3r3l36xy4xsjl9h"))))
686144e9
CB
492 (build-system gnu-build-system)
493 (inputs
8394619b 494 (list libevent cyrus-sasl))
686144e9 495 (home-page "https://memcached.org/")
61d996b9
TGR
496 (synopsis "In-memory caching service")
497 (description "Memcached is an in-memory key-value store. It has a small
686144e9
CB
498and generic API, and was originally intended for use with dynamic web
499applications.")
500 (license license:bsd-3)))
501
da602679
MC
502(define-public libmemcached
503 (package
504 (name "libmemcached")
505 (version "1.0.18")
506 ;; We build from the sources since we want to build the extra HTML
507 ;; documentation which is not included with the release.
508 (source (origin
509 (method bzr-fetch)
510 (uri (bzr-reference
511 (url "lp:libmemcached/1.0")
512 (revision (string-append "tag:" version))))
513 (file-name (string-append name "-" version "-checkout"))
514 (sha256
515 (base32
737a3c12
TGR
516 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))
517 (patches
518 (search-patches "libmemcached-build-with-gcc7.patch"))))
da602679
MC
519 (build-system gnu-build-system)
520 (native-inputs
8394619b
LC
521 (list memcached
522 libtool
523 autoconf
524 automake
525 bison
526 flex
527 perl
528 python-sphinx)) ;to build the HTML doc.
da602679 529 (inputs
8394619b 530 (list libevent cyrus-sasl))
da602679
MC
531 (outputs '("out" "doc"))
532 (arguments
9bab0950
MC
533 '(#:tests? #f ;many tests fail and use too much time
534 #:phases
da602679
MC
535 (modify-phases %standard-phases
536 (add-before 'bootstrap 'fix-configure.ac
537 ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
538 ;; get the error ``configure: error: cannot find install-sh,
539 ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
540 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
541 ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
542 (lambda _
543 (delete-file "bootstrap.sh") ;not useful in the context of Guix
544 (substitute* "configure.ac"
545 (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
9bab0950
MC
546 (("^AC_INIT.*" anchor)
547 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))))
548 (add-before 'build 'build-and-install-html-doc
da602679
MC
549 (lambda* (#:key outputs #:allow-other-keys)
550 (let ((html (string-append (assoc-ref outputs "doc")
551 "/share/doc/libmemcached/html/")))
552 (invoke "make" "install-html")
553 ;; Cleanup useless files.
554 (for-each delete-file-recursively
555 (map (lambda (x) (string-append html x))
9bab0950
MC
556 '("_sources" ".doctrees" ".buildinfo")))))))))
557 (home-page "https://libmemcached.org/libMemcached.html")
da602679
MC
558 (synopsis "C++ library for memcached")
559 (description "libMemcached is a library to use memcached in C/C++
560applications. It comes with a complete reference guide and documentation of
561the API, and provides features such as:
562@itemize
563@item Asynchronous and synchronous transport support
564@item Consistent hashing and distribution
565@item Tunable hashing algorithm to match keys
566@item Access to large object support
567@item Local replication
568@end itemize")
569 (license license:bsd-3)))
570
063edf92
MC
571(define-public python-pylibmc
572 (package
573 (name "python-pylibmc")
79bc9176 574 (version "1.6.1")
063edf92
MC
575 (source
576 (origin
577 (method url-fetch)
578 (uri (pypi-uri "pylibmc" version))
579 (sha256
79bc9176 580 (base32 "1sg7d9j0v6g3xg3finf4l1hb72c13vcyyi6rqrc9shbx903d93ca"))))
063edf92
MC
581 (build-system python-build-system)
582 (arguments
583 '(#:phases
584 (modify-phases %standard-phases
585 (add-before 'check 'start-memcached-daemon
586 ;; The test suite requires a memcached server.
587 (lambda _
588 (invoke "memcached" "-d"))))))
589 (native-inputs
8394619b 590 (list memcached python-nose))
063edf92 591 (inputs
8394619b 592 (list libmemcached zlib cyrus-sasl))
79bc9176
TGR
593 (home-page "http://sendapatch.se/projects/pylibmc/")
594 (synopsis "Python client for memcached")
063edf92
MC
595 (description
596 "@code{pylibmc} is a client in Python for memcached. It is a wrapper
597around TangentOrg’s libmemcached library, and can be used as a drop-in
598replacement for the code@{python-memcached} library.")
599 (license license:bsd-3)))
600
c5908b5c
EF
601(define-public go-github-com-bradfitz-gomemcache
602 (package
603 (name "go-github-com-bradfitz-gomemcache")
604 (version "0.0.0-20190913173617-a41fca850d0b")
605 (source
606 (origin
607 (method git-fetch)
608 (uri (git-reference
609 (url "https://github.com/bradfitz/gomemcache")
610 (commit (go-version->git-ref version))))
611 (file-name (git-file-name name version))
612 (sha256
613 (base32 "18qpds6xr73jy80pj7l3pc1l1ndcy3va2dl8fzk17bgwg49sxwfz"))
614 (modules '((guix build utils)))
615 (snippet
616 '(begin
617 ;; Fixes the 'untyped-int -> string of one rune' issue.
618 ;; https://github.com/golang/go/issues/32479
619 (substitute* "memcache/memcache_test.go"
620 (("string\\(0x7f") "string(rune(0x7f)"))))))
621 (build-system go-build-system)
622 (arguments
623 '(#:unpack-path "github.com/bradfitz/gomemcache"
624 #:import-path "github.com/bradfitz/gomemcache/memcache"))
625 (home-page "https://github.com/bradfitz/gomemcache")
626 (synopsis "Memcache client library in Go")
627 (description
628 "This is a memcache client library for the Go programming language.")
629 (license license:asl2.0)))
630
0045abb5
EF
631(define-public go-github-com-couchbase-gomemcached
632 (package
633 (name "go-github-com-couchbase-gomemcached")
634 (version "0.1.4")
635 (source
636 (origin
637 (method git-fetch)
638 (uri (git-reference
639 (url "https://github.com/couchbase/gomemcached")
640 (commit (string-append "v" version))))
641 (file-name (git-file-name name version))
642 (sha256
643 (base32 "10w74gc05x5naspls39sv2r92krrg31mk266w3lyqqwc0s3fxysl"))))
644 (build-system go-build-system)
645 (arguments '(#:import-path "github.com/couchbase/gomemcached"))
646 (native-inputs
647 (list go-github-com-stretchr-testify))
648 (home-page "https://github.com/couchbase/gomemcached")
649 (synopsis "Memcached binary protocol toolkit for go")
650 (description
651 "This package provides memcache client and server functionality.")
652 (license license:expat)))
653
b7a515c5
FCW
654(define-public litecli
655 (package
656 (name "litecli")
8cc61c7c 657 (version "1.9.0")
b7a515c5
FCW
658 (source
659 (origin
660 (method url-fetch)
661 (uri (pypi-uri "litecli" version))
662 (sha256
8cc61c7c 663 (base32 "1897divrdqlhl1p5jvvm29rg3d99f48s58na7hgdzm1x13x2rbr1"))))
b7a515c5
FCW
664 (build-system python-build-system)
665 (propagated-inputs
8394619b
LC
666 (list python-cli-helpers
667 python-click
668 python-configobj
669 python-prompt-toolkit
670 python-pygments
671 python-sqlparse))
b7a515c5 672 (native-inputs
8394619b 673 (list python-mock python-pytest))
b7a515c5
FCW
674 (home-page "https://litecli.com")
675 (synopsis "CLI for SQLite databases")
676 (description
677 "@code{litecli} is a command-line client for SQLite databases that has
678auto-completion and syntax highlighting.")
679 (license license:bsd-3)))
680
8255e899
FCW
681(define-public python-pgspecial
682 (package
683 (name "python-pgspecial")
684 (version "1.13.0")
685 (source
686 (origin
687 (method url-fetch)
688 (uri (pypi-uri "pgspecial" version))
689 (sha256
690 (base32 "00ddkf565rjcxmfml1z4mmkns1aq8x5s5g85xmnz2scln42y4irq"))))
691 (build-system python-build-system)
692 (propagated-inputs
693 (list python-click python-sqlparse python-psycopg2))
694 (home-page "https://github.com/dbcli/pgspecial")
695 (synopsis
696 "Python implementation of PostgreSQL meta commands (backslash commands)")
697 (description
698 "This Python package provides an API to execute meta-commands (AKA
699\"special\", or \"backslash commands\") on PostgreSQL.")
700 (license license:bsd-3)))
701
a6041201
RW
702(define-public python-sqlitedict
703 (package
704 (name "python-sqlitedict")
705 (version "2.0.0")
706 (source (origin
707 (method url-fetch)
708 (uri (pypi-uri "sqlitedict" version))
709 (sha256
710 (base32
711 "05sxy016k3p5sjjhdg0ad9z15i6vm3rq4cr9m8nrc7jfdx0p18r3"))))
712 (build-system python-build-system)
713 (arguments
714 (list
715 #:phases
716 #~(modify-phases %standard-phases
717 (replace 'check
718 (lambda* (#:key tests? #:allow-other-keys)
719 (when tests?
720 (invoke "pytest" "-vv"
721 "-k"
722 ;; No idea why these fail.
723 (string-append "not test_py24_error"
724 " and not test_tablenames"))))))))
725 (native-inputs (list python-pytest))
726 (home-page "https://github.com/piskvorky/sqlitedict")
727 (synopsis "Persistent dict backed up by sqlite3 and pickle")
728 (description
729 "This package provides a lightweight wrapper around the sqlite3 database
730with a simple, Pythonic @code{dict}-like interface and support for
731multi-thread access.")
732 (license license:asl2.0)))
733
2aefa6a4
FCW
734(define-public pgcli
735 (package
736 (name "pgcli")
737 (version "3.2.0")
738 (source
739 (origin
740 (method url-fetch)
741 (uri (pypi-uri "pgcli" version))
742 (sha256
743 (base32 "1dy6yzak696107pqv83296h0xhc3ahlfaydm80593gwn37krgpkc"))))
744 (build-system python-build-system)
745 (propagated-inputs
746 (list python-cli-helpers
747 python-click
748 python-configobj
749 python-pendulum
750 python-pgspecial
751 python-prompt-toolkit
752 python-psycopg2
753 python-pygments
754 python-setproctitle
755 python-sqlparse))
756 (native-inputs
757 (list python-ipython-sql))
758 (home-page "https://www.pgcli.com")
759 (synopsis "PostgreSQL CLI with autocompletion and syntax highlighting")
760 (description
761 "@code{pgcli} is a command line interface for PostgreSQL with
762autocompletion and syntax highlighting.")
763 (license license:bsd-3)))
764
8de54c63 765(define-public mycli
766 (package
767 (name "mycli")
56fdef0e 768 (version "1.25.0")
8de54c63 769 (source
8255e899
FCW
770 (origin
771 (method url-fetch)
772 (uri (pypi-uri "mycli" version))
773 (sha256
56fdef0e 774 (base32 "0231v7f6q84mjmi1h0ni3s55m2g8p5d7x5q49bgkxlaz2bc2xwgy"))))
8de54c63 775 (build-system python-build-system)
776 (arguments
56fdef0e 777 '(#:tests? #f)) ; tests expect a running MySQL
8de54c63 778 (propagated-inputs
8255e899
FCW
779 (list python-cli-helpers
780 python-click
781 python-configobj
782 python-cryptography
783 python-prompt-toolkit
784 python-pyaes
785 python-pygments
786 python-pymysql
787 python-pyperclip
788 python-sqlparse))
256c3e71 789 (home-page "https://www.mycli.net")
8de54c63 790 (synopsis
8255e899 791 "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
8de54c63 792 (description
8255e899 793 "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
8de54c63 794auto-completion and syntax highlighting.")
795 (license license:bsd-3)))
796
7cbf06d8
TGR
797;; XXX When updating, check whether boost-for-mysql is still needed.
798;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
5f96f303
LC
799(define-public mysql
800 (package
801 (name "mysql")
fdf82830 802 (version "5.7.33")
5f96f303
LC
803 (source (origin
804 (method url-fetch)
23bbd7dd 805 (uri (list (string-append
7fe3a57a 806 "https://dev.mysql.com/get/Downloads/MySQL-"
23bbd7dd
EF
807 (version-major+minor version) "/"
808 name "-" version ".tar.gz")
809 (string-append
7fe3a57a 810 "https://downloads.mysql.com/archives/get/file/"
23bbd7dd 811 name "-" version ".tar.gz")))
5f96f303
LC
812 (sha256
813 (base32
fdf82830 814 "1bb343mf7n0qg2qz497gxjsqprygrjz1q1pbz76hgqxnsy08sfxd"))))
329d13b8
SB
815 (build-system cmake-build-system)
816 (arguments
69419655 817 `(#:configure-flags
329d13b8
SB
818 '("-DBUILD_CONFIG=mysql_release"
819 "-DWITH_SSL=system"
820 "-DWITH_ZLIB=system"
821 "-DDEFAULT_CHARSET=utf8"
822 "-DDEFAULT_COLLATION=utf8_general_ci"
823 "-DMYSQL_DATADIR=/var/lib/mysql"
824 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
825 "-DINSTALL_INFODIR=share/mysql/docs"
826 "-DINSTALL_MANDIR=share/man"
827 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
828 "-DINSTALL_SCRIPTDIR=bin"
829 "-DINSTALL_INCLUDEDIR=include/mysql"
830 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
831 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
832 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
833 "-DINSTALL_DOCDIR=share/mysql/docs"
834 "-DINSTALL_SHAREDIR=share/mysql"
835 ;; Get rid of test data.
836 "-DINSTALL_MYSQLTESTDIR="
3f289db6
LC
837 "-DINSTALL_SQLBENCHDIR=")
838 #:phases (modify-phases %standard-phases
6a52df50
LC
839 (add-after
840 'install 'remove-extra-binaries
841 (lambda* (#:key outputs #:allow-other-keys)
842 (let ((out (assoc-ref outputs "out")))
843 ;; Remove the 3 *_embedded files, which weigh in at
844 ;; 14 MiB each.
845 (for-each delete-file
846 (find-files (string-append out "/bin")
847 "_embedded$"))
94006cc2 848 #t)))
849 (add-after
850 'install 'wrap-mysql_helpers
851 (lambda* (#:key inputs outputs #:allow-other-keys)
852 (let* ((out (assoc-ref outputs "out"))
853 (bin (string-append out "/bin"))
854 (awk (assoc-ref inputs "gawk"))
855 (coreutils (assoc-ref inputs "coreutils"))
856 (grep (assoc-ref inputs "grep"))
857 (ps (assoc-ref inputs "procps"))
858 (sed (assoc-ref inputs "sed")))
859 (wrap-program (string-append bin "/mysql_config")
860 `("PATH" ":" suffix
861 (,(string-append awk "/bin")
862 ,(string-append coreutils "/bin")
863 ,(string-append sed "/bin"))))
864 (wrap-program (string-append bin "/mysqld_safe")
865 `("PATH" ":" suffix
866 (,(string-append awk "/bin")
867 ,(string-append coreutils "/bin")
868 ,(string-append grep "/bin")
869 ,(string-append ps "/bin")
870 ,(string-append sed "/bin"))))
7d099cbe 871 #t))))))
329d13b8 872 (native-inputs
8394619b 873 (list bison perl pkg-config))
5f96f303 874 (inputs
8394619b
LC
875 (list boost-for-mysql
876 coreutils
877 gawk
878 grep
879 libaio
880 libtirpc
881 ncurses
882 openssl
883 procps
884 rpcsvc-proto ; rpcgen
885 sed
886 zlib))
7fe3a57a 887 (home-page "https://www.mysql.com/")
9e771e3b 888 (synopsis "Fast, easy to use, and popular database")
5f96f303
LC
889 (description
890 "MySQL is a fast, reliable, and easy to use relational database
891management system that supports the standardized Structured Query
892Language.")
ba8b9f8d 893 (license license:gpl2)))
5f96f303 894
77631745
SB
895(define-public mariadb
896 (package
897 (name "mariadb")
8d02c2c3 898 (version "10.5.12")
77631745
SB
899 (source (origin
900 (method url-fetch)
cc3c5fc5
MB
901 (uri (string-append "https://downloads.mariadb.com/MariaDB"
902 "/mariadb-" version "/source/mariadb-"
903 version ".tar.gz"))
77631745
SB
904 (sha256
905 (base32
8d02c2c3 906 "1gg4h9ahmk78cx01zyw0fqr6hhd78fsyhs0s34p3gi9hkak1qkxb"))
2001d2da
MB
907 (modules '((guix build utils)))
908 (snippet
909 '(begin
910 ;; Delete bundled snappy and xz.
911 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
4333d48a
MB
912 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
913 ;; This file checks that the bundled sources are present and
914 ;; declares build procedures for them.
915 (("^include\\(TokuThirdParty\\)") ""))
916 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
917 ;; Don't attempt to use the procedures we just removed.
918 ((" build_lzma build_snappy") ""))
2001d2da
MB
919
920 ;; Preserve CMakeLists.txt for these.
921 (for-each (lambda (file)
922 (unless (string-suffix? "CMakeLists.txt" file)
923 (delete-file file)))
525ebb85 924 (append (find-files "extra/wolfssl")
fdae245a 925 (find-files "zlib")))))))
77631745 926 (build-system cmake-build-system)
2b8491fb 927 (outputs '("out" "lib" "dev"))
77631745 928 (arguments
5193ae64 929 `(#:configure-flags
2b8491fb
JL
930 (list
931 "-DBUILD_CONFIG=mysql_release"
6cf8e576
LF
932 ;; Linking with libarchive fails, like this:
933
934 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
935 ;; relocation R_X86_64_32 against `.bss' can not be used when
936 ;; making a shared object; recompile with -fPIC
937
938 ;; For now, disable the features that that use libarchive (xtrabackup).
939 "-DWITH_LIBARCHIVE=OFF"
940
bba7a77e
MB
941 ;; Disable the TokuDB engine, because its test suite frequently fails,
942 ;; and loading it crashes the server: <https://bugs.gnu.org/35521>.
943 "-DTOKUDB_OK=OFF"
944
2001d2da
MB
945 ;; Ensure the system libraries are used.
946 "-DWITH_JEMALLOC=yes"
947 "-DWITH_PCRE=system"
948 "-DWITH_SSL=system"
949 "-DWITH_ZLIB=system"
950
77631745
SB
951 "-DDEFAULT_CHARSET=utf8"
952 "-DDEFAULT_COLLATION=utf8_general_ci"
953 "-DMYSQL_DATADIR=/var/lib/mysql"
954 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
ce29031a 955
704b7861 956 ;; Do not install the benchmark suite.
ce29031a
MB
957 "-DINSTALL_SQLBENCHDIR=false"
958
2b8491fb
JL
959 (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib"))
960 (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib")
961 "/lib")
962 (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out")
963 "/share/mysql/docs")
964 (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out")
965 "/share/man")
966 (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin")
967 (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin")
968 "-DCMAKE_INSTALL_LIBDIR=lib"
77631745 969 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
2b8491fb
JL
970 (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev")
971 "/include/mysql")
972 (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out")
973 "/share/mysql/docs")
974 (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out")
975 "/share/mysql/docs")
976 (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out")
977 "/share/mysql/support-files")
77631745 978 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
4c27ea06 979 "-DINSTALL_SHAREDIR=share")
ffcc5395
EF
980 ;; The test suite has spurious failures (mostly timeouts) if run in
981 ;; parallel on various machines. Only enable parallel tests on
982 ;; architectures which are likely to not have this issue.
983 #:parallel-tests? ,(target-x86-64?)
77631745
SB
984 #:phases
985 (modify-phases %standard-phases
bb9b3645
EF
986 ,@(if (target-ppc32?)
987 `((add-after 'unpack 'apply-libatomics-patch
988 (lambda* (#:key inputs #:allow-other-keys)
989 (let ((patch-file
990 (assoc-ref inputs
991 "mariadb-link-libatomic.patch")))
992 (invoke "patch" "-p1" "-i" patch-file)))))
993 '())
525ebb85 994 (add-after 'unpack 'adjust-output-references
2001d2da 995 (lambda _
525ebb85
MB
996 ;; The build system invariably prepends $CMAKE_INSTALL_PREFIX
997 ;; to other variables such as $INSTALL_INCLUDEDIR, which does
998 ;; not work when the latter uses an absolute file name.
999 (substitute* "libmariadb/mariadb_config/mariadb_config.c.in"
704b7861
MB
1000 (("%s/@INSTALL_INCLUDEDIR@")
1001 (string-append "@INSTALL_INCLUDEDIR@"))
1002 ;; As of 10.5.8, the mariadb_config program tries to be
1003 ;; clever and computes the installation directory relative
1004 ;; to /proc/self/exe when running on Linux. Make it fall
1005 ;; back to the old behaviour.
1006 (("defined\\(__linux__\\)")
1007 "0"))
525ebb85
MB
1008 (substitute* "libmariadb/mariadb_config/libmariadb.pc.in"
1009 (("\\$\\{prefix\\}/@INSTALL_INCLUDEDIR@")
1010 "@INSTALL_INCLUDEDIR@"))
704b7861
MB
1011 (substitute* "support-files/mariadb.pc.in"
1012 (("^(include|bin|script|doc|man)dir=\\$\\{prefix\\}/" _ dir)
1013 (string-append dir "dir=")))
525ebb85
MB
1014 (substitute* "include/CMakeLists.txt"
1015 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_INCLUDEDIR\\}")
1016 "${INSTALL_INCLUDEDIR}"))
704b7861
MB
1017 (substitute* "cmake/mariadb_connector_c.cmake"
1018 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_BINDIR\\}")
fdae245a 1019 "${INSTALL_BINDIR}"))))
3869f39e
MB
1020 (add-after 'unpack 'adjust-tests
1021 (lambda _
1022 (let ((disabled-tests
1023 '(;; These fail because root@hostname == root@localhost in
1024 ;; the build environment, causing a user count mismatch.
1025 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
3869f39e 1026 "main.explain_non_select"
ce29031a 1027 "main.upgrade_MDEV-19650"
3418e43b 1028 "roles.acl_statistics"
69fb26d4 1029
8d02c2c3
EF
1030 ;; Probably same as above, test failure reported upstream:
1031 ;; <https://jira.mariadb.org/browse/MDEV-26320>.
1032 "main.selectivity_no_engine"
1033
ce29031a
MB
1034 ;; FIXME: This test checks various table encodings and
1035 ;; fails because Guix defaults to UTF8 instead of the
1036 ;; upstream default latin1_swedish_ci. It's not easily
1037 ;; substitutable because several encodings are tested.
8d02c2c3 1038 "main.system_mysql_db"
ce29031a 1039
166472e2
MB
1040 ;; XXX: This test occasionally fails on i686-linux:
1041 ;; <https://jira.mariadb.org/browse/MDEV-24458>
1042 ,@(if (string-prefix? "i686" (%current-system))
1043 '("main.myisampack")
8d02c2c3 1044 '())))
3869f39e
MB
1045
1046 ;; This file contains a list of known-flaky tests for this
1047 ;; release. Append our own items.
1048 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
1049 (for-each (lambda (test)
1050 (format unstable-tests "~a : ~a\n"
1051 test "Disabled in Guix"))
1052 disabled-tests)
1053 (close-port unstable-tests)
1054
525ebb85 1055 ;; XXX: These fail because they expect a latin1 charset and
ab0cb26f 1056 ;; collation. See <https://jira.mariadb.org/browse/MDEV-21264>.
525ebb85
MB
1057 (substitute* '("mysql-test/main/gis_notembedded.result"
1058 "mysql-test/main/system_mysql_db.result")
ab0cb26f
MB
1059 (("latin1_swedish_ci") "utf8_general_ci")
1060 (("\tlatin1") "\tutf8"))
1061
e313327e
MB
1062 (substitute* "mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test"
1063 (("/bin/bash")
1064 (which "bash")))
1065
3869f39e
MB
1066 (substitute* "mysql-test/mysql-test-run.pl"
1067 (("/bin/ls") (which "ls"))
fdae245a 1068 (("/bin/sh") (which "sh"))))))
5b4d2e40
MB
1069 (add-before 'configure 'disable-plugins
1070 (lambda _
1071 (let ((disable-plugin (lambda (name)
1072 (call-with-output-file
1073 (string-append "plugin/" name
1074 "/CMakeLists.txt")
1075 (lambda (port)
1076 (format port "\n")))))
03335824 1077 (disabled-plugins '(;; XXX: Causes a test failure.
3869f39e 1078 "disks")))
fdae245a 1079 (for-each disable-plugin disabled-plugins))))
3869f39e 1080 (replace 'check
b1ef2deb 1081 (lambda* (#:key (tests? #t) parallel-tests? #:allow-other-keys)
3869f39e
MB
1082 (if tests?
1083 (with-directory-excursion "mysql-test"
1084 (invoke "./mtr" "--verbose"
3418e43b 1085 "--retry=3"
fdae245a 1086 "--suite=main"
71179b35
MB
1087 "--testcase-timeout=40"
1088 "--suite-timeout=600"
b1ef2deb
EF
1089 "--parallel" (number->string (if parallel-tests?
1090 (parallel-job-count)
1091 1))
b2bb04bd
MB
1092 ;; Skip the replication tests: they are very I/O
1093 ;; intensive and frequently causes indeterministic
1094 ;; failures even on powerful hardware.
1095 "--skip-rpl"
3869f39e 1096 "--skip-test-list=unstable-tests"))
fdae245a 1097 (format #t "test suite not run~%"))))
77631745
SB
1098 (add-after
1099 'install 'post-install
939c5b2c 1100 (lambda* (#:key inputs outputs #:allow-other-keys)
77631745 1101 (let* ((out (assoc-ref outputs "out"))
2b8491fb 1102 (dev (assoc-ref outputs "dev"))
939c5b2c
MB
1103 (lib (assoc-ref outputs "lib"))
1104 (openssl (assoc-ref inputs "openssl")))
525ebb85
MB
1105 (substitute* (list (string-append out "/bin/mariadb-install-db")
1106 (string-append out "/bin/mysql_install_db"))
77631745 1107 (("basedir=\"\"")
525ebb85
MB
1108 (string-append "basedir=\"" out "\""))
1109 (("\\$basedir/share/mysql")
1110 (string-append lib "/share/mysql")))
1111
2b8491fb 1112 (with-directory-excursion lib
704b7861
MB
1113 ;; Remove tests.
1114 (delete-file-recursively "mysql-test")
ce29031a 1115 ;; Remove static libraries.
963157f1 1116 (for-each delete-file (find-files "lib" "\\.a$")))
ce29031a 1117
2b8491fb
JL
1118 (with-directory-excursion out
1119 (delete-file "share/man/man1/mysql-test-run.pl.1")
1120 ;; Delete huge and unnecessary executables.
525ebb85 1121 (for-each delete-file (find-files "bin" "test$")))
2b8491fb
JL
1122 (mkdir-p (string-append dev "/share"))
1123 (mkdir-p (string-append dev "/bin"))
525ebb85
MB
1124 (rename-file (string-append lib "/bin/mariadbd")
1125 (string-append out "/bin/mariadbd"))
2b8491fb
JL
1126 (rename-file (string-append lib "/bin/mysqld")
1127 (string-append out "/bin/mysqld"))
525ebb85
MB
1128 (mkdir-p (string-append dev "/lib"))
1129 (rename-file (string-append lib "/lib/pkgconfig")
1130 (string-append dev "/lib/pkgconfig"))
1131 (rename-file (string-append lib "/bin/mariadb_config")
1132 (string-append dev "/bin/mariadb_config"))
2b8491fb
JL
1133 (rename-file (string-append out "/bin/mysql_config")
1134 (string-append dev "/bin/mysql_config"))
939c5b2c
MB
1135
1136 ;; Embed an absolute reference to OpenSSL in mysql_config
1137 ;; and the pkg-config file to avoid propagation.
525ebb85 1138 ;; XXX: how to do this for mariadb_config.c.in?
939c5b2c 1139 (substitute* (list (string-append dev "/bin/mysql_config")
525ebb85 1140 (string-append dev "/lib/pkgconfig/mariadb.pc"))
939c5b2c 1141 (("-lssl -lcrypto" all)
fdae245a 1142 (string-append "-L" openssl "/lib " all)))))))))
77631745 1143 (native-inputs
bb9b3645
EF
1144 (if (target-ppc32?)
1145 `(("mariadb-link-libatomic.patch"
1146 ,(search-patch "mariadb-link-libatomic.patch"))
1147 ("patch" ,patch)
1148 ("bison" ,bison)
1149 ("perl" ,perl))
1150 (list bison perl)))
77631745
SB
1151 (inputs
1152 `(("jemalloc" ,jemalloc)
1153 ("libaio" ,libaio)
1154 ("libxml2" ,libxml2)
1155 ("ncurses" ,ncurses)
db2444ad 1156 ("openssl" ,openssl-1.1)
ab0cb26f 1157 ("pam" ,linux-pam)
525ebb85 1158 ("pcre2" ,pcre2)
2001d2da 1159 ("xz" ,xz)
77631745 1160 ("zlib" ,zlib)))
3869f39e
MB
1161 ;; The test suite is very resource intensive and can take more than three
1162 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
1163 (properties '((timeout . 64800))) ;18 hours
77631745
SB
1164 (home-page "https://mariadb.org/")
1165 (synopsis "SQL database server")
1166 (description
1167 "MariaDB is a multi-user and multi-threaded SQL database server, designed
1168as a drop-in replacement of MySQL.")
ba8b9f8d 1169 (license license:gpl2)))
77631745 1170
2072bc08
PN
1171(define-public mariadb-connector-c
1172 (package
1173 (name "mariadb-connector-c")
7f86f426 1174 (version "3.1.13")
3881d0dc
TGR
1175 (source
1176 (origin
1177 (method url-fetch)
1178 (uri (string-append
1179 "https://downloads.mariadb.org/f/connector-c-" version
1180 "/mariadb-connector-c-" version "-src.tar.gz"
1181 "/from/https%3A//mirrors.ukfast.co.uk/sites/mariadb/?serve"))
f6a94e7e 1182 (file-name (string-append name "-" version ".tar.gz"))
3881d0dc 1183 (sha256
7f86f426 1184 (base32 "0xb8fiissblxb319y5ifqqp86zblwis789ipb753pcb4zpnsaw82"))))
9077cf68 1185 (inputs
8394619b 1186 (list openssl))
2072bc08 1187 (build-system cmake-build-system)
9077cf68 1188 (arguments
87078871 1189 '(#:tests? #f)) ; no tests
2072bc08
PN
1190 (home-page "https://mariadb.com/kb/en/mariadb-connector-c/")
1191 (synopsis "Client library to connect to MySQL or MariaDB")
1192 (description "The MariaDB Connector/C is used to connect applications
1193developed in C/C++ to MariaDB and MySQL databases.")
1194 (license license:lgpl2.1+)))
9077cf68 1195
43c55856 1196(define-public galera
1197 (package
1198 (name "galera")
ddd265b0 1199 (version "26.4.12")
43c55856 1200 (source (origin
1201 (method git-fetch)
1202 (uri (git-reference
43c55856 1203 (url "https://github.com/codership/galera")
2607ff0b 1204 (commit (string-append "release_" version))
43c55856 1205 (recursive? #t)))
1206 (file-name (git-file-name name version))
1207 (sha256
ddd265b0 1208 (base32 "0n4272mvr8a6h5prbhvl376asdp89ipix5yx5n6i1iiw9bs3v76l"))))
43c55856 1209 (build-system cmake-build-system)
1210 (inputs
8394619b 1211 (list check boost openssl))
43c55856 1212 (home-page "https://github.com/codership/galera/")
1213 (synopsis "Extension to the MariaDB database server")
1214 (description
1215 "Galera is a wsrep-provider that is used with MariaDB for load-balancing
1216and high-availability (HA).")
1217 (license license:gpl2))) ;'COPYING' says "version 2" only
1218
97dd1b15 1219;; Don't forget to update the other postgresql packages when upgrading this one.
ad004a2f 1220(define-public postgresql-14
5f96f303
LC
1221 (package
1222 (name "postgresql")
c546a776 1223 (version "14.4")
5f96f303
LC
1224 (source (origin
1225 (method url-fetch)
dbeaf8f2 1226 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
9020890b 1227 version "/postgresql-" version ".tar.bz2"))
5f96f303
LC
1228 (sha256
1229 (base32
c546a776 1230 "0slg7ld5mldmv3pn1wxxwglm4s3xc6c91ixx24apj713qlvn4fy2"))
c336567d 1231 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
5f96f303 1232 (build-system gnu-build-system)
dd213082 1233 (arguments
f0227a18
BW
1234 (list
1235 #:configure-flags
1236 #~(list "--with-uuid=e2fs" "--with-openssl"
1237 (string-append "--mandir=" #$output "/share/man")
1238 ;; PostgreSQL installs its own Makefile (should it?).
1239 ;; Prevent it from retaining needless references to
1240 ;; the build tools in order to save size.
1241 "MKDIR_P=mkdir -p" "INSTALL_BIN=install -c"
1242 "LD=ld" "TAR=tar")
1243 #:phases
1244 #~(modify-phases %standard-phases
1245 (add-before 'configure 'patch-/bin/sh
1246 (lambda _
1247 ;; Refer to the actual shell.
1248 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
1249 "src/bin/psql/command.c")
1250 (("/bin/sh") (which "sh")))))
1251 (add-before 'configure 'set-socket-dir
1252 (lambda _
1253 (substitute* '("src/include/pg_config_manual.h")
1254 (("DEFAULT_PGSOCKET_DIR[^\n]*")
1255 "DEFAULT_PGSOCKET_DIR \"/var/run/postgresql\""))))
1256 (add-after 'build 'build-contrib
1257 (lambda _
1258 (invoke "make" "-C" "contrib")))
1259 (add-after 'install 'install-contrib
1260 (lambda _
1261 (invoke "make" "-C" "contrib" "install")))
1262 (add-after 'install 'install-manuals
1263 (lambda _
1264 (with-directory-excursion "doc/src/sgml"
1265 (invoke "make" "install-man")
1266 (invoke "make" "postgres.info")
1267 (install-file "postgres.info"
1268 (string-append #$output "/share/info"))))))))
1269 (native-inputs (list docbook-xml docbook2x libxml2 perl texinfo))
1270 (inputs (list readline `(,util-linux "lib") openssl zlib))
d887f420 1271 (home-page "https://www.postgresql.org/")
5f96f303
LC
1272 (synopsis "Powerful object-relational database system")
1273 (description
1274 "PostgreSQL is a powerful object-relational database system. It is fully
1275ACID compliant, has full support for foreign keys, joins, views, triggers, and
1276stored procedures (in multiple languages). It includes most SQL:2008 data
1277types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
1278TIMESTAMP. It also supports storage of binary large objects, including
1279pictures, sounds, or video.")
ba8b9f8d 1280 (license (license:x11-style "file://COPYRIGHT"))))
5f96f303 1281
ad004a2f
MB
1282(define-public postgresql-13
1283 (package
1284 (inherit postgresql-14)
e2264e63 1285 (version "13.6")
e03b450c 1286 (replacement postgresql-13/replacement)
ad004a2f
MB
1287 (source (origin
1288 (inherit (package-source postgresql-14))
1289 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1290 version "/postgresql-" version ".tar.bz2"))
1291 (sha256
1292 (base32
49b350fa
MC
1293 "1z37ix80hb2bqa2smh1hbj9r507ypnl3pil43gkqznnlv6ipzz5s"))
1294 (patches (search-patches "postgresql-riscv-spinlocks.patch"))))))
ad004a2f 1295
e03b450c
MB
1296;; The merge of commit ...
1297;; 781dd2de230e3 gnu: postgresql-13: Fix building on riscv64-linux.
1298;; ... in ...
1299;; 49b350fafc2c3 Merge branch 'master' into staging.
1300;; ... lost the inherited patch from postgresql-14, causing problems such as ...
1301;; 05fef7bfc6005 gnu: timescaledb: Adjust test preparation to PostgreSQL 13.6.
1302;;
1303;; While at it, remove the RISC-V spinlock patch, which has been upstreamed
1304;; in a different form (so the old patch still applies).
1305;; TODO: Remove in the next rebuild cycle.
1306(define postgresql-13/replacement
1307 (package
1308 (inherit postgresql-13)
4601dccb 1309 (version "13.7")
e03b450c
MB
1310 (source
1311 (origin
1312 (inherit (package-source postgresql-13))
4601dccb
MB
1313 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1314 version "/postgresql-" version ".tar.bz2"))
1315 (sha256
1316 (base32
1317 "16b3ljid7zd1v5l4l4pmwihx43wi8p9izidkjfii8dnqygs5p40v"))
e03b450c
MB
1318 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))))
1319
a73302ec 1320(define-public postgresql-11
ddeec8ca 1321 (package
a73302ec
MB
1322 (inherit postgresql-13)
1323 (name "postgresql")
a18f937b 1324 (version "11.16")
ddeec8ca 1325 (source (origin
a73302ec 1326 (inherit (package-source postgresql-13))
ddeec8ca
MB
1327 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1328 version "/postgresql-" version ".tar.bz2"))
1329 (sha256
1330 (base32
a18f937b 1331 "1983a7y4y6zhbgh0qcdfkf99445j1zm5q1ncrbkrx555y08y3n9d"))
e03b450c
MB
1332 (patches (search-patches
1333 "postgresql-disable-resolve_symlinks.patch"))))
3fce3c2c
LC
1334 (native-inputs
1335 (modify-inputs (package-native-inputs postgresql-13)
1336 (replace "docbook-xml" docbook-xml-4.2)))))
ddeec8ca 1337
a73302ec 1338(define-public postgresql-10
91477def 1339 (package
a73302ec 1340 (inherit postgresql-11)
3787f567 1341 (version "10.21")
91477def 1342 (source (origin
a73302ec 1343 (inherit (package-source postgresql-11))
91477def
GB
1344 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1345 version "/postgresql-" version ".tar.bz2"))
1346 (sha256
1347 (base32
3787f567 1348 "1la5dx4hhy5yaznwk9gwdsymih3sd23fyhh6spssdaajdn2rh8fk"))))
b422687c
LC
1349 (native-inputs
1350 (modify-inputs (package-native-inputs postgresql-11)
1351 (append opensp docbook-sgml-4.2)
1352 (delete "docbook-xml")))))
7658d89b 1353
13c46cc2 1354(define-public postgresql postgresql-14)
a73302ec 1355
81873cbc
MB
1356(define-public timescaledb
1357 (package
1358 (name "timescaledb")
d73b88d8 1359 (version "2.7.0")
81873cbc
MB
1360 (source (origin
1361 (method git-fetch)
1362 (uri (git-reference
1363 (url "https://github.com/timescale/timescaledb")
1364 (commit version)))
1365 (file-name (git-file-name name version))
1366 (sha256
1367 (base32
d73b88d8
MB
1368 "18wszj8ia5rs4y4zkyfb0f5z4y1g7ac3jym748nbkbszhxmq7nc7"))
1369 (patches (search-patches "timescaledb-flaky-test.patch"))
81873cbc
MB
1370 (modules '((guix build utils)))
1371 (snippet
1372 ;; Remove files carrying the proprietary TIMESCALE license.
1373 '(begin
1374 (delete-file-recursively "tsl")
1375 (for-each delete-file
d73b88d8
MB
1376 '("scripts/c_license_header-timescale.h"
1377 "scripts/license_tsl.spec"
1378 "scripts/sql_license_tsl.sql"
1379 "test/perl/AccessNode.pm"
81873cbc
MB
1380 "test/perl/DataNode.pm"
1381 "test/perl/TimescaleNode.pm"))))))
1382 (build-system cmake-build-system)
1383 (arguments
1384 (list #:imported-modules `((guix build union)
1385 ,@%cmake-build-system-modules)
1386 #:modules `(,@%cmake-build-system-modules
1387 (guix build union)
1388 (ice-9 match))
1389 #:configure-flags #~(list "-DAPACHE_ONLY=ON"
1390 "-DSEND_TELEMETRY_DEFAULT=OFF")
1391 #:test-target "regresschecklocal"
1392 #:phases
1393 #~(modify-phases (@ (guix build cmake-build-system) %standard-phases)
1394 (add-after 'unpack 'patch-install-location
1395 (lambda _
1396 ;; Install extension to the output instead of the
1397 ;; PostgreSQL store directory.
1398 (substitute* '("CMakeLists.txt"
1399 "cmake/GenerateScripts.cmake"
1400 "sql/CMakeLists.txt")
1401 (("\\$\\{PG_SHAREDIR\\}/extension")
1402 (string-append #$output "/share/extension")))
1403 ;; Likewise for the library.
1404 (substitute* '("src/CMakeLists.txt"
1405 "src/loader/CMakeLists.txt")
1406 (("\\$\\{PG_PKGLIBDIR\\}")
1407 (string-append #$output "/lib")))))
ae1d8d6a
VC
1408 (add-after 'unpack 'remove-kernel-version
1409 ;; Do not embed the running kernel version for reproducible
1410 ;; builds
1411 (lambda _
1412 (substitute* "src/config.h.in"
1413 (("BUILD_OS_VERSION ..CMAKE_SYSTEM_VERSION.")
1414 "BUILD_OS_VERSION \""))))
81873cbc
MB
1415 ;; Run the tests after install to make it easier to create the
1416 ;; required PostgreSQL+TimescaleDB filesystem union.
1417 (delete 'check)
1418 (add-after 'install 'prepare-tests
1419 (lambda* (#:key inputs #:allow-other-keys)
1420 (let ((pg-data (string-append (getcwd) "/../pg-data"))
1421 (pg-union (string-append (getcwd) "/../pg-union")))
1422 (match inputs
1423 (((names . directories) ...)
05fef7bf
LC
1424 ;; PG will only load extensions from its own $libdir,
1425 ;; which it calculates based on argv[0]. As of
1426 ;; PostgreSQL 13.6, it calls 'canonicalize_path' on
1427 ;; argv[0] so a merge symlink is not enough to trick
1428 ;; it; thus, the code below makes a full copy of PG
1429 ;; and friends such that 'pg_config --libdir', for
1430 ;; instance, points to PG-UNION, allowing it to load
1431 ;; the timescaledb extension.
e03b450c
MB
1432 ;; TODO: The above comment and the #:symlink trick can
1433 ;; be removed in the next rebuild cycle.
05fef7bf
LC
1434 (union-build pg-union (cons #$output directories)
1435 #:symlink
1436 (lambda (old new)
1437 (if (file-is-directory? old)
1438 (copy-recursively old new)
1439 (copy-file old new))))))
81873cbc
MB
1440 (setenv "PATH" (string-append pg-union "/bin:"
1441 (getenv "PATH")))
1442 (invoke "initdb" "-D" pg-data)
1443 (copy-file "test/postgresql.conf"
1444 (string-append pg-data "/postgresql.conf"))
05fef7bf 1445
81873cbc
MB
1446 (invoke "pg_ctl" "-D" pg-data
1447 "-o" (string-append "-k " pg-data)
1448 "-l" (string-append pg-data "/db.log")
1449 "start"))))
1450 (add-after 'prepare-tests 'check
1451 (assoc-ref %standard-phases 'check)))))
1452 (inputs (list openssl postgresql))
1453 (home-page "https://www.timescale.com/")
1454 (synopsis "Time-series extension for PostgreSQL")
1455 (description
0e0296af 1456 "TimescaleDB is a database designed to make SQL scalable for
81873cbc
MB
1457time-series data. It is engineered up from PostgreSQL and packaged as a
1458PostgreSQL extension, providing automatic partitioning across time and space
1459(partitioning key), as well as full SQL support.")
1460 (license license:asl2.0)))
1461
100a4f84
SH
1462(define-public pgloader
1463 (package
1464 (name "pgloader")
52acf6b2 1465 (version "3.6.4")
100a4f84
SH
1466 (source
1467 (origin
1468 (method git-fetch)
1469 (uri (git-reference
1470 (url "https://github.com/dimitri/pgloader")
1471 (commit (string-append "v" version))))
1472 (sha256
52acf6b2 1473 (base32 "05lpa0r5l7pvx97ljfb0cryxz11krczbb86gi1i1ixp0h9bvqw2a"))
100a4f84
SH
1474 (file-name (git-file-name name version))))
1475 (build-system gnu-build-system)
1476 (arguments
1477 ;; NOTE: (Sharlatan-20210119T211511+0000) Tests are disabled due to being
1478 ;; dependent on Quicklisp, main build target is `pgloader-standalone' which
1479 ;; does not require Quicklisp workarounds. There is no `install' target
1480 ;; configured in Makefile.
9bffe30b
TGR
1481 (list #:tests? #f
1482 #:strip-binaries? #f
1483 #:make-flags
1484 #~(list "pgloader-standalone" "BUILDAPP_SBCL=buildapp")
1485 #:phases
1486 #~(modify-phases %standard-phases
1487 (delete 'configure)
1488 (add-after 'unpack 'set-home
1489 (lambda _
1490 (setenv "HOME" "/tmp")))
1491 (add-after 'unpack 'patch-Makefile
1492 (lambda _
1493 (substitute* "Makefile"
1494 (("--sbcl.*") "--sbcl $(CL) --asdf-path . \\\n"))))
1495 (replace 'install
1496 (lambda* (#:key outputs #:allow-other-keys)
1497 (let ((bin (string-append #$output "/bin")))
1498 (mkdir-p bin)
1499 (install-file "build/bin/pgloader" bin)))))))
100a4f84 1500 (native-inputs
8394619b 1501 (list buildapp sbcl))
100a4f84 1502 (inputs
9bffe30b
TGR
1503 (list sbcl-alexandria
1504 sbcl-cl-abnf
1505 sbcl-cl-base64
1506 sbcl-cl-csv
1507 sbcl-cl-fad
1508 sbcl-cl-log
1509 sbcl-cl-markdown
1510 sbcl-cl-mustache
1511 sbcl-cl-ppcre
1512 sbcl-cl-sqlite
1513 sbcl-closer-mop
1514 sbcl-command-line-arguments
1515 sbcl-db3
1516 sbcl-drakma
1517 sbcl-esrap
1518 sbcl-flexi-streams
1519 sbcl-ixf
1520 sbcl-local-time
1521 sbcl-lparallel
1522 sbcl-metabang-bind
1523 sbcl-mssql
1524 sbcl-postmodern
1525 sbcl-py-configparser
1526 sbcl-qmynd
1527 sbcl-quri
1528 sbcl-split-sequence
1529 sbcl-trivial-backtrace
1530 sbcl-usocket
1531 sbcl-uuid
1532 sbcl-yason
1533 sbcl-zs3))
100a4f84
SH
1534 (home-page "https://pgloader.io/")
1535 (synopsis "Tool to migrate data to PostgreSQL")
1536 (description
1537 "@code{pgloader} is a program that can load data or migrate databases from
1538CSV, DB3, iXF, SQLite, MS-SQL or MySQL to PostgreSQL.")
1539 (license (license:x11-style "file://LICENSE"))))
1540
9763102b
TGR
1541(define-public python-pymysql
1542 (package
1543 (name "python-pymysql")
4cb2f29e 1544 (version "0.9.3")
9763102b
TGR
1545 (source
1546 (origin
1547 (method url-fetch)
1548 (uri (pypi-uri "PyMySQL" version))
1549 (sha256
4cb2f29e 1550 (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
9763102b 1551 (build-system python-build-system)
9763102b 1552 (inputs
8394619b 1553 (list python-cryptography))
9763102b
TGR
1554 (arguments
1555 `(#:tests? #f)) ; tests expect a running MySQL
1556 (home-page "https://github.com/PyMySQL/PyMySQL/")
1557 (synopsis "Pure-Python MySQL driver")
1558 (description
1559 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
1560Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
1561 (license license:expat)))
1562
259a94e9
TD
1563(define-public qdbm
1564 (package
1565 (name "qdbm")
1566 (version "1.8.78")
1567 (source
1568 (origin
1569 (method url-fetch)
1570 (uri (string-append "http://fallabs.com/" name "/"
1571 name "-" version ".tar.gz"))
1572 (sha256
1573 (base32
1574 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
1575 (build-system gnu-build-system)
1576 (arguments
7dc0f1d5
TD
1577 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1578 (assoc-ref %outputs "out")
1579 "/lib"))
1580 #:make-flags (list "CFLAGS=-fPIC")))
d74647b0 1581 (home-page "https://fallabs.com/qdbm/")
259a94e9
TD
1582 (synopsis "Key-value database")
1583 (description "QDBM is a library of routines for managing a
1584database. The database is a simple data file containing key-value
1585pairs. Every key and value is serial bytes with variable length.
1586Binary data as well as character strings can be used as a key or a
1587value. There is no concept of data tables or data types. Records are
1588organized in a hash table or B+ tree.")
1589 (license license:lgpl2.1+)))
1590
5f96f303
LC
1591(define-public recutils
1592 (package
1593 (name "recutils")
38028fdf 1594 (version "1.9")
5f96f303
LC
1595 (source (origin
1596 (method url-fetch)
1597 (uri (string-append "mirror://gnu/recutils/recutils-"
1598 version ".tar.gz"))
1599 (sha256
1600 (base32
38028fdf 1601 "03kf91f20brn2ffljfjzirxh5xj99m1mvvspcx2lph9000mmj0b3"))))
5f96f303 1602 (build-system gnu-build-system)
b4c9a3d2
TGR
1603 (arguments
1604 (list #:configure-flags
1605 '(list "--disable-static"
1606 (string-append "--with-bash-headers="
20fbd870
TGR
1607 (dirname (search-input-directory
1608 %build-inputs
1609 "include/bash"))))))
b4c9a3d2
TGR
1610 (native-inputs
1611 ;; XXX Without labels, the default 'configure phase picks the wrong "bash".
1612 `(("bc" ,bc)
1613 ("bash:include" ,bash "include")
e116e43d 1614 ("check" ,check)
b4c9a3d2
TGR
1615 ("pkg-config" ,pkg-config)))
1616 (inputs
1617 ;; TODO: Add more optional inputs.
1618 (list curl
1619 libgcrypt
1620 `(,util-linux "lib")))
5f96f303
LC
1621 (synopsis "Manipulate plain text files as databases")
1622 (description
1623 "GNU Recutils is a set of tools and libraries for creating and
1624manipulating text-based, human-editable databases. Despite being text-based,
1625databases created with Recutils carry all of the expected features such as
c5779c93
LC
1626unique fields, primary keys, time stamps and more. Many different field
1627types are supported, as is encryption.")
ba8b9f8d 1628 (license license:gpl3+)
6fd52309 1629 (home-page "https://www.gnu.org/software/recutils/")))
5f96f303 1630
50b8a8e8 1631(define-public emacs-rec-mode
9df78675 1632 (package
50b8a8e8 1633 (name "emacs-rec-mode")
3efc96f1 1634 (version "1.9.0")
c41ccac4
MS
1635 (source (origin
1636 (method url-fetch)
1637 (uri (string-append "https://elpa.gnu.org/packages/"
1638 "rec-mode-" version ".tar"))
1639 (sha256
1640 (base32
3efc96f1 1641 "1w1q6kh567fd8xismq9i6wr1y893lypd30l452yvydi1qjiq1n6x"))
c41ccac4 1642 (snippet '(begin (delete-file "rec-mode.info")))))
9df78675
JH
1643 (build-system emacs-build-system)
1644 (arguments
1645 '(#:phases
1646 (modify-phases %standard-phases
c41ccac4 1647 (add-before 'install 'make-info
9df78675 1648 (lambda _
c41ccac4
MS
1649 (invoke "makeinfo" "--no-split"
1650 "-o" "rec-mode.info" "rec-mode.texi"))))))
1651 (native-inputs
928085d8 1652 (list texinfo))
c41ccac4 1653 (home-page "https://www.gnu.org/software/recutils/")
9df78675
JH
1654 (synopsis "Emacs mode for working with recutils database files")
1655 (description "This package provides an Emacs major mode @code{rec-mode}
1656for working with GNU Recutils text-based, human-editable databases. It
1657supports editing, navigation, and querying of recutils database files
c41ccac4
MS
1658including field and record folding.")
1659 (license license:gpl3+)))
9df78675 1660
50b8a8e8
LMP
1661(define-public emacs-recutils
1662 (deprecated-package "emacs-recutils" emacs-rec-mode))
1663
d3c6ad0a
MB
1664(define-public rocksdb
1665 (package
1666 (name "rocksdb")
f7139ce7 1667 (version "6.26.1")
d3c6ad0a 1668 (source (origin
8dd36658
MB
1669 (method git-fetch)
1670 (uri (git-reference
1671 (url "https://github.com/facebook/rocksdb")
1672 (commit (string-append "v" version))))
1673 (file-name (git-file-name name version))
d3c6ad0a
MB
1674 (sha256
1675 (base32
f7139ce7 1676 "0mylma106w93kxhj89g9y1ccdq7m9m94wrmv5nyr17yc1zsk87sg"))
d3c6ad0a
MB
1677 (modules '((guix build utils)))
1678 (snippet
1679 '(begin
1680 ;; TODO: unbundle gtest.
1681 (delete-file "build_tools/gnu_parallel")
7fa9cca8 1682 (substitute* "Makefile"
71ad48f7 1683 (("build_tools/gnu_parallel") "parallel"))))))
f7139ce7 1684 (build-system cmake-build-system)
d3c6ad0a 1685 (arguments
f7139ce7
RW
1686 `(#:configure-flags
1687 (list "-DROCKSDB_BUILD_SHARED=1"
1688 ;; Ceph requires that RTTI is enabled.
1689 "-DUSE_RTTI=1"
1690 ;; Prevent the build from passing '-march=native' to the compiler.
1691 "-DPORTABLE=1")
7fa9cca8 1692
f7139ce7
RW
1693 ;; Many tests fail on 32-bit platforms. There are multiple
1694 ;; reports about this upstream, but it's not going to be
1695 ;; supported any time soon. What's worse: Release builds don't
1696 ;; include tests, and overriding the build system to build
1697 ;; tests anyway fails with missing TEST_ symbols.
1698 #:tests? #false
d3c6ad0a
MB
1699 #:phases
1700 (modify-phases %standard-phases
f7139ce7 1701 (add-after 'unpack 'patch-CMakeLists.txt
d3c6ad0a 1702 (lambda _
f7139ce7
RW
1703 (substitute* "CMakeLists.txt"
1704 ;; build reproducibly
1705 (("set\\(BUILD_DATE \"\\$\\{TS\\}\"")
1706 "set(BUILD_DATE \"1970-01-01\""))))
1707 (add-after 'unpack 'build-generically
71ad48f7 1708 (lambda _
f7139ce7
RW
1709 (substitute* "CMakeLists.txt"
1710 (("if\\(HAVE_SSE42\\)") "if(FALSE)")))))))
d3c6ad0a 1711 (native-inputs
8394619b 1712 (list parallel perl procps python which))
d3c6ad0a 1713 (inputs
8394619b
LC
1714 (list bzip2
1715 gflags
1716 jemalloc
1717 lz4
1718 snappy
1719 zlib))
0087a250 1720 (home-page "https://rocksdb.org/")
d3c6ad0a
MB
1721 (synopsis "Persistent key-value store for fast storage")
1722 (description
1723 "RocksDB is a library that forms the core building block for a fast
1724key-value server, especially suited for storing data on flash drives. It
1725has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1726between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1727(RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
1728compactions, making it specially suitable for storing multiple terabytes of
1729data in a single database. RocksDB is partially based on @code{LevelDB}.")
7fa9cca8
MB
1730 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
1731 ;; files carry the 3-clause BSD license.
1732 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
d3c6ad0a 1733
b92d02d9
RJ
1734(define-public sparql-query
1735 (package
1736 (name "sparql-query")
1737 (version "1.1")
1738 (source (origin
ce64b9d1
EF
1739 (method git-fetch)
1740 (uri (git-reference
1741 (url "https://github.com/tialaramex/sparql-query")
1742 (commit version)))
b92d02d9 1743 (sha256
ce64b9d1
EF
1744 (base32 "0a84a89idpjhj9w2y3fmvzv7ldps1cva1kxvfmh897k02kaniwxk"))
1745 (file-name (git-file-name name version))))
b92d02d9
RJ
1746 (build-system gnu-build-system)
1747 (inputs
8394619b 1748 (list curl glib libxml2 ncurses readline))
b92d02d9 1749 (native-inputs
8394619b 1750 (list pkg-config))
b92d02d9
RJ
1751 (arguments
1752 `(#:make-flags '("CC=gcc")
1753 #:phases
1754 (modify-phases %standard-phases
1755 (delete 'configure)
1756 ;; The Makefile uses git to obtain versioning information. This phase
1757 ;; substitutes the git invocation with the package version.
1758 (add-after 'unpack 'remove-git-dependency
1759 (lambda _
1760 (substitute* "Makefile"
1761 (("^gitrev :=.*$")
96272e28
MW
1762 (string-append "gitrev = \"v" ,version "\"")))
1763 #t))
b92d02d9
RJ
1764 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1765 ;; This replacement does the same thing, except for using $PREFIX/bin
1766 ;; instead.
1767 (replace 'install
1768 (lambda* (#:key outputs #:allow-other-keys)
1769 (let* ((out (assoc-ref outputs "out"))
1770 (bin (string-append out "/bin")))
1771 (install-file "sparql-query" bin)
96272e28
MW
1772 (symlink (string-append bin "/sparql-query")
1773 (string-append bin "/sparql-update")))
1774 #t))
b92d02d9
RJ
1775 (replace 'check
1776 (lambda* (#:key make-flags #:allow-other-keys)
96272e28
MW
1777 (apply invoke "make" `(,@make-flags "scan-test"))
1778 (invoke "./scan-test"))))))
b92d02d9
RJ
1779 (home-page "https://github.com/tialaramex/sparql-query/")
1780 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1781 (description "Sparql-query is a command-line tool for accessing SPARQL
36a4366d 1782endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
b92d02d9
RJ
1783tools for interrogating SQL databases. For example, you can enter a query over
1784several lines, using a semi-colon at the end of a line to indicate the end of
1785your query. It also supports readline so that you can more easily recall and
1786edit previous queries, even across sessions. It can be used non-interactively,
1787for example from a shell script.")
1788 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1789 ;; others (like sparql-query.c) contain a GPLv2+ license header.
ba8b9f8d 1790 (license (list license:gpl3+))))
b92d02d9 1791
cabe8f18
CB
1792(define-public sqitch
1793 (package
1794 (name "sqitch")
adcad547 1795 (version "1.1.0")
cabe8f18
CB
1796 (source
1797 (origin
1798 (method url-fetch)
1799 (uri (string-append
f64cd5d1
TGR
1800 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
1801 version ".tar.gz"))
cabe8f18 1802 (sha256
adcad547 1803 (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
cabe8f18
CB
1804 (build-system perl-build-system)
1805 (arguments
1806 '(#:phases
1807 (modify-phases %standard-phases
1808 (add-before 'check 'set-check-environment
1809 (lambda _
1810 (setenv "TZ" "UTC")
1811 (setenv "HOME" "/tmp")
1812 #t))
1813 (add-after 'install 'wrap-program
1814 (lambda* (#:key outputs #:allow-other-keys)
1815 (let* ((out (assoc-ref outputs "out"))
1816 (path (getenv "PERL5LIB")))
1817 (wrap-program (string-append out "/bin/sqitch")
1818 `("PERL5LIB" ":" prefix
1819 (,(string-append out "/lib/perl5/site_perl"
1820 ":"
1821 path)))))
1822 #t)))))
1823 (native-inputs
8394619b
LC
1824 (list perl-capture-tiny
1825 perl-io-pager
1826 perl-module-build
1827 perl-module-runtime
1828 perl-path-class
1829 perl-test-deep
1830 perl-test-dir
1831 perl-test-exception
1832 perl-test-file
1833 perl-test-file-contents
1834 perl-test-mockmodule
1835 perl-test-mockobject
1836 perl-test-nowarnings
1837 perl-test-warn))
cabe8f18
CB
1838 (inputs
1839 `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1840 ("perl-clone" ,perl-clone)
1841 ("perl-config-gitlike" ,perl-config-gitlike)
1842 ("perl-datetime" ,perl-datetime)
1843 ("perl-datetime-timezone" ,perl-datetime-timezone)
6a1c3a90 1844 ("perl-dbd-mysql" ,perl-dbd-mysql)
cabe8f18 1845 ("perl-dbd-pg" ,perl-dbd-pg)
6a1c3a90 1846 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
cabe8f18
CB
1847 ("perl-dbi" ,perl-dbi)
1848 ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1849 ("perl-encode-locale" ,perl-encode-locale)
cabe8f18
CB
1850 ("perl-hash-merge" ,perl-hash-merge)
1851 ("perl-ipc-run3" ,perl-ipc-run3)
1852 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1853 ("perl-libintl-perl" ,perl-libintl-perl)
1854 ("perl-list-moreutils" ,perl-list-moreutils)
1855 ("perl-moo" ,perl-moo)
1856 ("perl-mysql-config" ,perl-mysql-config)
1857 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1858 ("perl-path-class" ,perl-path-class)
1859 ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1860 ("perl-string-formatter" ,perl-string-formatter)
1861 ("perl-string-shellquote" ,perl-string-shellquote)
1862 ("perl-sub-exporter" ,perl-sub-exporter)
1863 ("perl-template-tiny" ,perl-template-tiny)
1864 ("perl-template-toolkit" ,perl-template-toolkit)
1865 ("perl-throwable" ,perl-throwable)
1866 ("perl-try-tiny" ,perl-try-tiny)
1867 ("perl-type-tiny" ,perl-type-tiny)
1868 ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1869 ("perl-uri" ,perl-uri)
1870 ("perl-uri-db" ,perl-uri-db)))
1871 (home-page "https://sqitch.org/")
1872 (synopsis "Database change management tool")
1873 (description
1874 "Sqitch is a standalone change management system for database schemas,
1875which uses SQL to describe changes.")
1876 (license license:x11)))
1877
311f06c9
TGR
1878(define-public sqlcrush
1879 ;; Unfortunately, there is no proper upstream release and may never be.
1880 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1881 (revision "1"))
1882 (package
1883 (name "sqlcrush")
1884 (version (git-version "0.1.5" revision commit))
1885 (source (origin
1886 (method git-fetch)
1887 (uri (git-reference
b0e7b699 1888 (url "https://github.com/coffeeandscripts/sqlcrush")
311f06c9
TGR
1889 (commit commit)))
1890 (file-name (git-file-name name version))
1891 (sha256
1892 (base32
1893 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1894 (build-system python-build-system)
1895 (inputs
8394619b
LC
1896 (list python-cryptography python-psycopg2 python-pymysql
1897 python-sqlalchemy))
311f06c9
TGR
1898 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1899 (synopsis "Text console-based database viewer and editor")
1900 (description
1901 "SQLcrush lets you view and edit a database directly from the text
1902console through an ncurses interface. You can explore each table's structure,
1903browse and edit the contents, add and delete entries, all while tracking your
1904changes.")
1905 (license license:gpl3+)))) ; no headers, see README.md
1906
db60b1d9
LC
1907(define-public tdb
1908 (package
1909 (name "tdb")
ff477f65 1910 (version "1.4.5")
db60b1d9
LC
1911 (source (origin
1912 (method url-fetch)
ca473fc2 1913 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
db60b1d9
LC
1914 version ".tar.gz"))
1915 (sha256
1916 (base32
ff477f65 1917 "0h8fkblws3d4vf37yhbrbw2nfxg5vk2v3i5mk04hhcbh9y4fvz5w"))))
db60b1d9
LC
1918 (build-system gnu-build-system)
1919 (arguments
6ccb7814
EF
1920 '(#:phases
1921 (modify-phases %standard-phases
1922 (replace 'configure
1923 (lambda* (#:key outputs #:allow-other-keys)
1924 (let ((out (assoc-ref outputs "out")))
1925 ;; The 'configure' script is a wrapper for Waf and
1926 ;; doesn't recognize things like '--enable-fast-install'.
96272e28
MW
1927 (invoke "./configure"
1928 (string-append "--prefix=" out))))))))
db60b1d9 1929 (native-inputs
8394619b
LC
1930 (list ;; TODO: Build the documentation.
1931 ;; ("docbook-xsl" ,docbook-xsl)
1932 ;; ("libxml2" ,libxml2)
1933 ;; ("libxslt" ,libxslt)
1934 python ;for the Waf build system
1935 which))
1abd0904 1936 (home-page "https://tdb.samba.org/")
35b9e423 1937 (synopsis "Trivial database")
db60b1d9
LC
1938 (description
1939 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1940and BSD's DB except that it allows multiple simultaneous writers and uses
1941locking internally to keep writers from trampling on each other. TDB is also
1942extremely small.")
ba8b9f8d 1943 (license license:lgpl3+)))
274da61d
LC
1944
1945(define-public perl-dbi
1946 (package
1947 (name "perl-dbi")
d0ed680b 1948 (version "1.643")
274da61d
LC
1949 (source (origin
1950 (method url-fetch)
1951 (uri (string-append
1952 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1953 version ".tar.gz"))
1954 (sha256
1955 (base32
d0ed680b 1956 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa"))))
274da61d
LC
1957 (build-system perl-build-system)
1958 (synopsis "Database independent interface for Perl")
0e0296af 1959 (description "This package provides a database interface for Perl.")
9aba9b12 1960 (home-page "https://metacpan.org/release/DBI")
2f3108ad 1961 (license license:perl-license)))
274da61d 1962
feae3395
EB
1963(define-public perl-dbix-class
1964 (package
1965 (name "perl-dbix-class")
23ec2a0e 1966 (version "0.082842")
feae3395
EB
1967 (source
1968 (origin
1969 (method url-fetch)
1970 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1971 "DBIx-Class-" version ".tar.gz"))
1972 (sha256
23ec2a0e 1973 (base32 "1rh7idjjbibc1zmiaaarask434lh0lx7f2xyfwmy37k9fa0xcpmh"))))
feae3395
EB
1974 (build-system perl-build-system)
1975 (native-inputs
8394619b
LC
1976 (list perl-dbd-sqlite
1977 perl-file-temp
1978 perl-module-install
1979 perl-package-stash
1980 perl-test-deep
1981 perl-test-exception
1982 perl-test-warn))
feae3395 1983 (propagated-inputs
8394619b
LC
1984 (list perl-class-accessor-grouped
1985 perl-class-c3-componentised
1986 perl-class-inspector
1987 perl-config-any
1988 perl-context-preserve
1989 perl-data-dumper-concise
1990 perl-data-page
1991 perl-dbi
1992 perl-devel-globaldestruction
1993 perl-hash-merge
1994 perl-module-find
1995 perl-moo
1996 perl-mro-compat
1997 perl-namespace-clean
1998 perl-path-class
1999 perl-scalar-list-utils
2000 perl-scope-guard
2001 perl-sql-abstract-classic
2002 perl-sub-name
2003 perl-text-balanced
2004 perl-try-tiny))
9aba9b12 2005 (home-page "https://metacpan.org/release/DBIx-Class")
feae3395
EB
2006 (synopsis "Extensible and flexible object <-> relational mapper")
2007 (description "An SQL to OO mapper with an object API inspired by
2008Class::DBI (with a compatibility layer as a springboard for porting) and a
2009resultset API that allows abstract encapsulation of database operations. It
2010aims to make representing queries in your code as perl-ish as possible while
2011still providing access to as many of the capabilities of the database as
2012possible, including retrieving related records from multiple tables in a
2013single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
2014\"ORDER BY\" and \"HAVING\" support.")
2f3108ad 2015 (license license:perl-license)))
e61fd0f0 2016
4e4039e5
EB
2017(define-public perl-dbix-class-cursor-cached
2018 (package
2019 (name "perl-dbix-class-cursor-cached")
180cb81b 2020 (version "1.001004")
4e4039e5
EB
2021 (source
2022 (origin
2023 (method url-fetch)
2024 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
2025 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
2026 (sha256
2027 (base32
180cb81b 2028 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
4e4039e5
EB
2029 (build-system perl-build-system)
2030 (native-inputs
8394619b 2031 (list perl-cache-cache perl-dbd-sqlite perl-module-install))
4e4039e5 2032 (propagated-inputs
8394619b 2033 (list perl-carp-clan perl-dbix-class))
9aba9b12 2034 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
4e4039e5
EB
2035 (synopsis "Cursor with built-in caching support")
2036 (description "DBIx::Class::Cursor::Cached provides a cursor class with
2037built-in caching support.")
2f3108ad 2038 (license license:perl-license)))
4e4039e5 2039
e61fd0f0
EB
2040(define-public perl-dbix-class-introspectablem2m
2041 (package
2042 (name "perl-dbix-class-introspectablem2m")
7a462b80 2043 (version "0.001002")
e61fd0f0
EB
2044 (source
2045 (origin
2046 (method url-fetch)
68a9d6df 2047 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
e61fd0f0
EB
2048 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
2049 (sha256
2050 (base32
7a462b80 2051 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
e61fd0f0 2052 (build-system perl-build-system)
2f837cf7 2053 (native-inputs
8394619b 2054 (list perl-module-install))
e61fd0f0 2055 (propagated-inputs
8394619b 2056 (list perl-dbix-class))
9aba9b12 2057 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
e61fd0f0
EB
2058 (synopsis "Introspect many-to-many relationships")
2059 (description "Because the many-to-many relationships are not real
2060relationships, they can not be introspected with DBIx::Class. Many-to-many
2061relationships are actually just a collection of convenience methods installed
2062to bridge two relationships. This DBIx::Class component can be used to store
2063all relevant information about these non-relationships so they can later be
2064introspected and examined.")
2f3108ad 2065 (license license:perl-license)))
708155df
EB
2066
2067(define-public perl-dbix-class-schema-loader
2068 (package
2069 (name "perl-dbix-class-schema-loader")
1672e7e7 2070 (version "0.07049")
708155df
EB
2071 (source
2072 (origin
2073 (method url-fetch)
2074 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
2075 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
2076 (sha256
2077 (base32
1672e7e7 2078 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
708155df
EB
2079 (build-system perl-build-system)
2080 (native-inputs
8394619b
LC
2081 (list perl-config-any
2082 perl-config-general
2083 perl-dbd-sqlite
2084 perl-dbix-class-introspectablem2m
2085 perl-module-install
2086 perl-moose
2087 perl-moosex-markasmethods
2088 perl-moosex-nonmoose
2089 perl-namespace-autoclean
2090 perl-test-deep
2091 perl-test-differences
2092 perl-test-exception
2093 perl-test-pod
2094 perl-test-warn))
708155df 2095 (propagated-inputs
8394619b
LC
2096 (list perl-class-unload
2097 perl-class-inspector
2098 perl-class-accessor-grouped
2099 perl-class-c3-componentised
2100 perl-carp-clan
2101 perl-data-dump
2102 perl-dbix-class
2103 perl-hash-merge
2104 perl-list-moreutils
2105 perl-lingua-en-inflect-phrase
2106 perl-lingua-en-inflect-number
2107 perl-lingua-en-tagger
2108 perl-namespace-clean
2109 perl-mro-compat
2110 perl-scope-guard
2111 perl-string-camelcase
2112 perl-string-toidentifier-en
2113 perl-sub-name
2114 perl-try-tiny))
708155df 2115 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
9aba9b12 2116 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
708155df
EB
2117 (synopsis "Create a DBIx::Class::Schema based on a database")
2118 (description "DBIx::Class::Schema::Loader automates the definition of a
2119DBIx::Class::Schema by scanning database table definitions and setting up the
2120columns, primary keys, unique constraints and relationships.")
2f3108ad 2121 (license license:perl-license)))
274da61d 2122
186eb132
EB
2123(define-public perl-dbd-pg
2124 (package
2125 (name "perl-dbd-pg")
ec451538 2126 (version "3.15.1")
186eb132
EB
2127 (source
2128 (origin
2129 (method url-fetch)
2130 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
2131 "DBD-Pg-" version ".tar.gz"))
2132 (sha256
2133 (base32
ec451538 2134 "0zn17xb6bmixkmv53p576igzw1jd43cwql35r19m56jwahxm9iqk"))))
186eb132
EB
2135 (build-system perl-build-system)
2136 (native-inputs
8394619b 2137 (list perl-dbi))
186eb132 2138 (propagated-inputs
8394619b 2139 (list perl-dbi postgresql))
9aba9b12 2140 (home-page "https://metacpan.org/release/DBD-Pg")
186eb132 2141 (synopsis "DBI PostgreSQL interface")
f33e71fc
LC
2142 (description "This package provides a PostgreSQL driver for the Perl5
2143@dfn{Database Interface} (DBI).")
2f3108ad 2144 (license license:perl-license)))
186eb132 2145
4b7857a4
RW
2146(define-public perl-dbd-mysql
2147 (package
2148 (name "perl-dbd-mysql")
49596a54 2149 (version "4.050")
4b7857a4
RW
2150 (source
2151 (origin
2152 (method url-fetch)
49596a54 2153 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
4b7857a4
RW
2154 "DBD-mysql-" version ".tar.gz"))
2155 (sha256
49596a54 2156 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
4b7857a4 2157 (build-system perl-build-system)
702a87f2
TGR
2158 (arguments
2159 `(#:phases
2160 (modify-phases %standard-phases
2161 (add-before 'configure 'skip-library-detection
2162 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
2163 ;; are really only needed for the test suite; their absence does not
2164 ;; affect the build or the end result.
2165 (lambda _
2166 (substitute* "Makefile.PL"
2167 (("use Devel::CheckLib;" match)
2168 (string-append "# " match))
2169 (("assert_lib")
2170 "print"))
2171 #t)))
2172 ;; Tests require running MySQL server.
2173 #:tests? #f))
4b7857a4
RW
2174 (propagated-inputs
2175 `(("perl-dbi" ,perl-dbi)
2b8491fb
JL
2176 ("mysql" ,mariadb "lib")
2177 ("mysql-dev" ,mariadb "dev")))
9aba9b12 2178 (home-page "https://metacpan.org/release/DBD-mysql")
4b7857a4
RW
2179 (synopsis "DBI MySQL interface")
2180 (description "This package provides a MySQL driver for the Perl5
2181@dfn{Database Interface} (DBI).")
2f3108ad 2182 (license license:perl-license)))
4b7857a4 2183
274da61d
LC
2184(define-public perl-dbd-sqlite
2185 (package
2186 (name "perl-dbd-sqlite")
25fb1e30 2187 (version "1.66")
274da61d
LC
2188 (source (origin
2189 (method url-fetch)
2190 (uri (string-append
2191 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
2192 version ".tar.gz"))
2193 (sha256
2194 (base32
25fb1e30 2195 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
274da61d 2196 (build-system perl-build-system)
8394619b
LC
2197 (inputs (list sqlite))
2198 (propagated-inputs (list perl-dbi))
274da61d
LC
2199 (synopsis "SQlite interface for Perl")
2200 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
2201the entire thing in the distribution. So in order to get a fast transaction
2202capable RDBMS working for your Perl project you simply have to install this
2203module, and nothing else.")
2f3108ad 2204 (license license:perl-license)
9aba9b12 2205 (home-page "https://metacpan.org/release/DBD-SQLite")))
14e84b2d 2206
55916fa2
CB
2207(define-public perl-mysql-config
2208 (package
2209 (name "perl-mysql-config")
2210 (version "1.04")
2211 (source
2212 (origin
2213 (method url-fetch)
2214 (uri (string-append
2215 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
2216 version
2217 ".tar.gz"))
2218 (sha256
2219 (base32
2220 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
2221 (build-system perl-build-system)
2222 (home-page "https://metacpan.org/release/MySQL-Config")
2223 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
2224 (description
2225 "@code{MySQL::Config} emulates the @code{load_defaults} function from
7230f6d5 2226libmysqlclient. It will fill an array with long options, ready to be parsed by
55916fa2
CB
2227@code{Getopt::Long}.")
2228 (license license:perl-license)))
2229
dd90952e
EB
2230(define-public perl-sql-abstract
2231 (package
2232 (name "perl-sql-abstract")
7a358c78 2233 (version "1.87")
dd90952e
EB
2234 (source
2235 (origin
2236 (method url-fetch)
439980b7 2237 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
dd90952e
EB
2238 "SQL-Abstract-" version ".tar.gz"))
2239 (sha256
7a358c78 2240 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9"))))
dd90952e
EB
2241 (build-system perl-build-system)
2242 (native-inputs
8394619b
LC
2243 (list perl-module-install perl-test-deep perl-test-exception
2244 perl-test-warn))
dd90952e 2245 (propagated-inputs
8394619b 2246 (list perl-hash-merge perl-moo perl-mro-compat perl-text-balanced))
9aba9b12 2247 (home-page "https://metacpan.org/release/SQL-Abstract")
dd90952e
EB
2248 (synopsis "Generate SQL from Perl data structures")
2249 (description "This module was inspired by the excellent DBIx::Abstract.
2250While based on the concepts used by DBIx::Abstract, the concepts used have
2251been modified to make the SQL easier to generate from Perl data structures.
2252The underlying idea is for this module to do what you mean, based on the data
2253structures you provide it, so that you don't have to modify your code every
e881752c 2254time your data changes.")
2f3108ad 2255 (license license:perl-license)))
14e84b2d 2256
5d01aeba
TGR
2257(define-public perl-sql-abstract-classic
2258 (package
2259 (name "perl-sql-abstract-classic")
2260 (version "1.91")
2261 (source
2262 (origin
2263 (method url-fetch)
2264 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
2265 "SQL-Abstract-Classic-" version ".tar.gz"))
2266 (sha256
2267 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
2268 (build-system perl-build-system)
2269 (native-inputs
8394619b 2270 (list perl-test-deep perl-test-exception perl-test-warn))
5d01aeba 2271 (propagated-inputs
8394619b 2272 (list perl-mro-compat perl-sql-abstract))
5d01aeba
TGR
2273 (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
2274 (synopsis "Generate SQL from Perl data structures")
2275 (description
2276 "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
2277to preserve the ability of users to opt into the new way of doing things in
2278later versions according to their own schedules.
2279
2280It is an abstract SQL generation module based on the concepts used by
2281@code{DBIx::Abstract}, with several important differences, especially when it
2282comes to @code{WHERE} clauses. These concepts were modified to make the SQL
2283easier to generate from Perl data structures.
2284
2285The underlying idea is for this module to do what you mean, based on the data
2286structures you provide it. You shouldn't have to modify your code every time
2287your data changes, as this module figures it out.")
2288 (license license:perl-license)))
2289
b4dcb026
EB
2290(define-public perl-sql-splitstatement
2291 (package
2292 (name "perl-sql-splitstatement")
f3696950 2293 (version "1.00023")
b4dcb026
EB
2294 (source
2295 (origin
2296 (method url-fetch)
f3696950 2297 (uri (string-append "mirror://cpan/authors/id/V/VE/VEESH/"
b4dcb026
EB
2298 "SQL-SplitStatement-" version ".tar.gz"))
2299 (sha256
f3696950 2300 (base32 "0ppkx46nydzlnsxf9a8pkyb74wggfrdiiwafab143lrarlh88x0s"))))
b4dcb026
EB
2301 (build-system perl-build-system)
2302 (native-inputs
8394619b 2303 (list perl-test-differences perl-test-exception perl-test-script))
b4dcb026 2304 (propagated-inputs
8394619b
LC
2305 (list perl-class-accessor perl-list-moreutils perl-regexp-common
2306 perl-sql-tokenizer))
9aba9b12 2307 (home-page "https://metacpan.org/release/SQL-SplitStatement")
b4dcb026
EB
2308 (synopsis "Split SQL code into atomic statements")
2309 (description "This module tries to split any SQL code, even including
2310non-standard extensions, into the atomic statements it is composed of.")
2f3108ad 2311 (license license:perl-license)))
b4dcb026 2312
718c89c1
EB
2313(define-public perl-sql-tokenizer
2314 (package
2315 (name "perl-sql-tokenizer")
2316 (version "0.24")
2317 (source
2318 (origin
2319 (method url-fetch)
2320 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
2321 "SQL-Tokenizer-" version ".tar.gz"))
2322 (sha256
2323 (base32
2324 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
2325 (build-system perl-build-system)
9aba9b12 2326 (home-page "https://metacpan.org/release/SQL-Tokenizer")
718c89c1
EB
2327 (synopsis "SQL tokenizer")
2328 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
2329claim to be a parser or query verifier. It just creates sane tokens from a
2330valid SQL query.")
2f3108ad 2331 (license license:perl-license)))
718c89c1 2332
14e84b2d
JD
2333(define-public unixodbc
2334 (package
2335 (name "unixodbc")
4712fdd8 2336 (version "2.3.9")
14e84b2d
JD
2337 (source (origin
2338 (method url-fetch)
e881752c 2339 (uri
14e84b2d 2340 (string-append
3fef0a2f
EF
2341 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
2342 version ".tar.gz"))
14e84b2d 2343 (sha256
4712fdd8 2344 (base32 "01xj65d02i3yjy7p9z08y9jakcs5szmz4rask868n7387nn3x0sj"))))
14e84b2d
JD
2345 (build-system gnu-build-system)
2346 (synopsis "Data source abstraction library")
2347 (description "Unixodbc is a library providing an API with which to access
2348data sources. Data sources include SQL Servers and any software with an ODBC
2349Driver.")
ba8b9f8d 2350 (license license:lgpl2.1+)
14e84b2d
JD
2351 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
2352 (home-page "http://www.unixodbc.org")))
b4a9c924 2353
2be32ecc
RW
2354(define-public nanodbc
2355 (package
2356 (name "nanodbc")
bad54d57 2357 (version "2.14.0")
2be32ecc
RW
2358 (source (origin
2359 (method git-fetch)
2360 (uri
2361 (git-reference
2362 (url "https://github.com/nanodbc/nanodbc")
2363 (commit (string-append "v" version))))
2364 (file-name (git-file-name name version))
2365 (sha256
2366 (base32
bad54d57 2367 "1253bnrmchga3ra99jqkd2p29bc5h2ip79xd8afblz6b1v00wmbm"))))
2be32ecc
RW
2368 (build-system cmake-build-system)
2369 (arguments
2370 `(#:configure-flags
2371 ;; The tests require ODBC backends to be installed.
34928cc4
RW
2372 (list "-DNANODBC_DISABLE_TESTS=ON"
2373 "-DBUILD_SHARED_LIBS=ON")
2be32ecc
RW
2374 #:tests? #false))
2375 (inputs
8394619b 2376 (list unixodbc))
2be32ecc
RW
2377 (home-page "https://nanodbc.io/")
2378 (synopsis "C++ wrapper for the native C ODBC API")
2379 (description "The goal for nanodbc is to make developers happy by providing
2380a simpler and less verbose API for working with ODBC. Common tasks should be
2381easy, requiring concise and simple code.")
2382 (license license:expat)))
2383
9e220f09
RW
2384(define-public nanodbc-for-irods
2385 (package
2386 (inherit nanodbc)
2387 (arguments
2388 `(#:tests? #false
2389 #:configure-flags
2390 '("-DBUILD_SHARED_LIBS=ON"
2391 ;; The tests require ODBC backends to be installed.
2392 "-DNANODBC_DISABLE_TESTS=ON"
2393 "-DCMAKE_CXX_COMPILER=clang++"
2394 "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
2395 "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
2396 #:phases
2397 (modify-phases %standard-phases
2398 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
2399 (lambda* (#:key inputs #:allow-other-keys)
2400 (let ((gcc (assoc-ref inputs "gcc")))
2401 (setenv "CPLUS_INCLUDE_PATH"
2402 (string-join
2403 (cons (string-append (assoc-ref inputs "libcxx")
2404 "/include/c++/v1")
2405 ;; Hide GCC's C++ headers so that they do not interfere with
2406 ;; the Clang headers.
2407 (delete (string-append gcc "/include/c++")
2408 (string-split (getenv "CPLUS_INCLUDE_PATH")
2409 #\:)))
2410 ":"))
2411 (format #true
2412 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
2413 (getenv "CPLUS_INCLUDE_PATH"))))))))
2414 (properties `((hidden? . #true)))
2415 (inputs
2416 `(("unixodbc" ,unixodbc)
2417 ("libcxx" ,libcxx+libcxxabi-6)
2418 ("libcxxabi" ,libcxxabi-6)
2419 ("clang" ,clang-6)))))
2420
b4a9c924
EB
2421(define-public unqlite
2422 (package
2423 (name "unqlite")
2424 (version "1.1.6")
2425 (source (origin
2426 (method url-fetch)
2427 ;; Contains bug fixes against the official release, and has an
2428 ;; autotooled build system.
2429 (uri (string-append "https://github.com/aidin36/tocc/releases/"
2430 "download/v1.0.0/"
2431 "unqlite-unofficial-" version ".tar.gz"))
2432 (sha256
2433 (base32
2434 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
2435 (build-system gnu-build-system)
2436 (arguments `(#:tests? #f)) ;No check target
f50ef349 2437 (home-page "https://www.unqlite.org")
b4a9c924
EB
2438 (synopsis "In-memory key/value and document store")
2439 (description
2440 "UnQLite is an in-process software library which implements a
2441self-contained, serverless, zero-configuration, transactional NoSQL
2442database engine. UnQLite is a document store database similar to
64753a7b 2443Redis, CouchDB, etc., as well as a standard key/value store
69b4ffcf 2444similar to BerkeleyDB, LevelDB, etc.")
ba8b9f8d 2445 (license license:bsd-2)))
463f6766
DT
2446
2447(define-public redis
2448 (package
2449 (name "redis")
477f8c8e 2450 (version "6.2.6")
463f6766
DT
2451 (source (origin
2452 (method url-fetch)
2453 (uri (string-append "http://download.redis.io/releases/redis-"
2454 version".tar.gz"))
2455 (sha256
2456 (base32
477f8c8e 2457 "1ariw5x33hmmm3d5al0j3307l5kf3vhmn78wpyaz67hia1x8nasv"))
3a1cb921
VL
2458 (modules '((guix build utils)))
2459 (snippet
2460 ;; Delete bundled jemalloc, as the package will use the libc one
477f8c8e 2461 '(begin (delete-file-recursively "deps/jemalloc")))))
463f6766 2462 (build-system gnu-build-system)
3a1cb921 2463 (native-inputs
8394619b
LC
2464 (list procps ; for tests
2465 tcl)) ; for tests
463f6766 2466 (arguments
3a1cb921
VL
2467 '(#:phases
2468 (modify-phases %standard-phases
2469 (delete 'configure)
2470 (add-after 'unpack 'use-correct-tclsh
2471 (lambda* (#:key inputs #:allow-other-keys)
2472 (substitute* "runtest"
2473 (("^TCLSH=.*")
2474 (string-append "TCLSH="
2475 (assoc-ref inputs "tcl")
477f8c8e 2476 "/bin/tclsh")))))
3a1cb921
VL
2477 (add-after 'unpack 'adjust-tests
2478 (lambda _
2479 ;; Disable failing tests
2480 (substitute* "tests/test_helper.tcl"
841edfa4
SS
2481 (("integration/failover") "")
2482 (("integration/replication-4") "")
2483 (("integration/replication-psync") "")
477f8c8e 2484 (("integration/replication[^-]") "")))))
463f6766
DT
2485 #:make-flags `("CC=gcc"
2486 "MALLOC=libc"
b25f060f 2487 "LDFLAGS=-ldl"
463f6766
DT
2488 ,(string-append "PREFIX="
2489 (assoc-ref %outputs "out")))))
2490 (synopsis "Key-value cache and store")
2491 (description "Redis is an advanced key-value cache and store. Redis
2492supports many data structures including strings, hashes, lists, sets, sorted
2493sets, bitmaps and hyperloglogs.")
5a3cbfce 2494 (home-page "https://redis.io/")
ba8b9f8d 2495 (license license:bsd-3)))
a65e2a02 2496
04ab609b
PP
2497(define-public ruby-redis
2498 (package
2499 (name "ruby-redis")
2500 (version "4.2.5")
2501 (source
2502 (origin
2503 (method url-fetch)
2504 (uri (rubygems-uri "redis" version))
2505 (sha256
2506 (base32
2507 "15x2sr6h094rjbvg8pkq6m3lcd5abpyx93aifvfdz3wv6x55xa48"))))
2508 (build-system ruby-build-system)
2509 (arguments
2510 `(#:tests? #f)) ; Tests require a running redis server.
2511 (synopsis "Ruby client for Redis' API")
2512 (description
2513 "This package provides a Ruby client that tries to match Redis' API
2514one-to-one, while still providing an idiomatic interface.")
2515 (home-page "https://github.com/redis/redis-rb")
2516 (license license:expat)))
2517
87c4a15d
EF
2518(define-public go-github-com-cupcake-rdb
2519 (package
2520 (name "go-github-com-cupcake-rdb")
2521 (version "0.0.0-20161107195141-43ba34106c76")
2522 (source
2523 (origin
2524 (method git-fetch)
2525 (uri (git-reference
2526 (url "https://github.com/tent/rdb")
2527 (commit (go-version->git-ref version))))
2528 (file-name (git-file-name name version))
2529 (sha256
2530 (base32 "1l4bsn5yj8r875crz1rsk6dlvhv0bd8mgazsch5vl4c19v0fs2ib"))))
2531 (build-system go-build-system)
2532 (arguments '(#:import-path "github.com/cupcake/rdb"))
2533 (native-inputs
2534 (list go-gopkg-in-check-v1))
2535 (home-page "https://github.com/tent/rdb")
2536 (synopsis "Redis RDB parser for Go")
2537 (description
2538 "Package rdb implements parsing and encoding of the Redis RDB file format.")
2539 (license license:expat)))
2540
9cca2982
EF
2541(define-public go-github-com-gomodule-redigo
2542 (package
2543 (name "go-github-com-gomodule-redigo")
2544 (version "1.8.8")
2545 (source
2546 (origin
2547 (method git-fetch)
2548 (uri (git-reference
2549 (url "https://github.com/gomodule/redigo")
2550 (commit (string-append "v" version))))
2551 (file-name (git-file-name name version))
2552 (sha256
2553 (base32 "0wplaaxg7f6c6c08gdp33l48hygn8gq1rhlnjzr1c9qcggsm07k1"))))
2554 (build-system go-build-system)
2555 (arguments
2556 '(#:unpack-path "github.com/gomodule/redigo"
2557 #:import-path "github.com/gomodule/redigo/redis"))
2558 (native-inputs
2559 (list go-github-com-stretchr-testify
2560 redis))
2561 (home-page "https://github.com/gomodule/redigo")
2562 (synopsis "Go client for Redis")
2563 (description
2564 "Redigo is a Go client for the Redis database.")
2565 (license license:asl2.0)))
2566
a65e2a02 2567(define-public kyotocabinet
2568 (package
2569 (name "kyotocabinet")
2a0a6f8f 2570 (version "1.2.79")
a65e2a02 2571 (source (origin
2572 (method url-fetch)
7fc2ba2a
TGR
2573 (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
2574 "kyotocabinet-" version ".tar.gz"))
a65e2a02 2575 (sha256
2576 (base32
2a0a6f8f 2577 "079ymsahlrijswgwfr2la9yw5h57l752cprhp5dz31iamsj1vyv7"))))
a65e2a02 2578 (build-system gnu-build-system)
2579 (arguments
2580 `(#:configure-flags
2581 (list
9d59023e 2582 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
a65e2a02 2583 (string-append "LDFLAGS=-Wl,-rpath="
2584 (assoc-ref %outputs "out") "/lib"))))
8394619b 2585 (inputs (list zlib))
7fc2ba2a 2586 (home-page "https://fallabs.com/kyotocabinet/")
a65e2a02 2587 (synopsis
2588 "Kyoto Cabinet is a modern implementation of the DBM database")
2589 (description
2590 "Kyoto Cabinet is a standalone file-based database that supports Hash
2591and B+ Tree data storage models. It is a fast key-value lightweight
2592database and supports many programming languages. It is a NoSQL database.")
ba8b9f8d 2593 (license license:gpl3+)))
6242b314 2594
bdc11dc4 2595(define-public tokyocabinet
2596 (package
2597 (name "tokyocabinet")
2598 (version "1.4.48")
2599 (source
2600 (origin
2601 (method url-fetch)
2602 (uri (string-append "http://fallabs.com/tokyocabinet/"
2603 name "-" version ".tar.gz"))
2604 (sha256
2605 (base32
2606 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
2607 (build-system gnu-build-system)
2608 (arguments
2609 `(#:configure-flags
2610 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
2611 (string-append "LDFLAGS=-Wl,-rpath="
2612 (assoc-ref %outputs "out") "/lib"))))
2613 (inputs
8394619b 2614 (list zlib))
bdc11dc4 2615 (home-page "http://fallabs.com/tokyocabinet/")
2616 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
2617 (description
2618 "Tokyo Cabinet is a library of routines for managing a database.
2619The database is a simple data file containing records, each is a pair of a
2620key and a value. Every key and value is serial bytes with variable length.
2621Both binary data and character string can be used as a key and a value.
2622There is neither concept of data tables nor data types. Records are
2623organized in hash table, B+ tree, or fixed-length array.")
2624 (license license:lgpl2.1+)))
2625
6242b314
SB
2626(define-public wiredtiger
2627 (package
2628 (name "wiredtiger")
81e95821 2629 (version "2.9.1")
6242b314
SB
2630 (source (origin
2631 (method url-fetch)
2632 (uri (string-append
2633 "http://source.wiredtiger.com/releases/wiredtiger-"
2634 version ".tar.bz2"))
2635 (sha256
2636 (base32
81e95821 2637 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
6242b314
SB
2638 (build-system gnu-build-system)
2639 (arguments
a469c695 2640 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
6242b314
SB
2641 #:phases
2642 (modify-phases %standard-phases
2643 (add-before 'check 'disable-test/fops
2644 (lambda _
2645 ;; XXX: timed out after 3600 seconds of silence
2646 (substitute* "Makefile"
2647 (("test/fops") ""))
2648 #t)))))
2649 (inputs
8394619b 2650 (list lz4 zlib snappy))
6242b314
SB
2651 (home-page "http://source.wiredtiger.com/")
2652 (synopsis "NoSQL data engine")
2653 (description
2654 "WiredTiger is an extensible platform for data management. It supports
2655row-oriented storage (where all columns of a row are stored together),
2656column-oriented storage (where columns are stored in groups, allowing for
2657more efficient access and storage of column subsets) and log-structured merge
2658trees (LSM), for sustained throughput under random insert workloads.")
ba8b9f8d 2659 (license license:gpl3) ; or GPL-2
6242b314 2660 ;; configure.ac: WiredTiger requires a 64-bit build.
092b7b3e 2661 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
90c2ee88 2662
4680fef7
AB
2663(define-public wiredtiger-3
2664 (package
2665 (inherit wiredtiger)
2666 (name "wiredtiger")
2667 (version "3.1.0")
2668 (source (origin
2669 (method url-fetch)
2670 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
2671 version ".tar.bz2"))
2672 (sha256
2673 (base32
2674 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
2675
16973071
KB
2676(define-public guile-wiredtiger
2677 (package
2678 (name "guile-wiredtiger")
b1e6b938 2679 (version "0.7.0")
16973071
KB
2680 (source (origin
2681 (method git-fetch)
2682 (uri (git-reference
2683 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
b1e6b938 2684 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
16973071
KB
2685 (file-name (string-append name "-" version "-checkout"))
2686 (sha256
2687 (base32
b1e6b938 2688 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
16973071
KB
2689 (build-system gnu-build-system)
2690 (arguments
3926a099 2691 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
16973071
KB
2692 #:configure-flags
2693 (list (string-append "--with-libwiredtiger-prefix="
2694 (assoc-ref %build-inputs "wiredtiger")))
189be331 2695 #:make-flags '("GUILE_AUTO_COMPILE=0")))
16973071 2696 (native-inputs
8394619b 2697 (list autoconf automake pkg-config))
16973071 2698 (inputs
8394619b 2699 (list wiredtiger-3 guile-2.2))
16973071 2700 (propagated-inputs
a53ea46b 2701 (list guile2.2-bytestructures))
3926a099 2702 (synopsis "WiredTiger bindings for GNU Guile")
16973071
KB
2703 (description
2704 "This package provides Guile bindings to the WiredTiger ``NoSQL''
b1e6b938 2705database.")
16973071
KB
2706 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
2707 (license license:gpl3+)))
2708
90c2ee88
DM
2709(define-public perl-db-file
2710 (package
2711 (name "perl-db-file")
0eb0fef3 2712 (version "1.856")
90c2ee88
DM
2713 (source
2714 (origin
2715 (method url-fetch)
76899e92
TGR
2716 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
2717 version ".tar.gz"))
90c2ee88 2718 (sha256
0eb0fef3 2719 (base32 "1ab6rm2b8lz0g3gc8k9y79gkgajyby0zpybkdg9mk4g35y9bmyfd"))))
90c2ee88 2720 (build-system perl-build-system)
8394619b
LC
2721 (inputs (list bdb))
2722 (native-inputs (list perl-test-pod))
90c2ee88
DM
2723 (arguments
2724 `(#:phases (modify-phases %standard-phases
2725 (add-before
2726 'configure 'modify-config.in
2727 (lambda* (#:key inputs #:allow-other-keys)
2728 (substitute* "config.in"
2729 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
2730 #t)))))
9aba9b12 2731 (home-page "https://metacpan.org/release/DB_File")
ce054e84 2732 (synopsis "Perl5 access to Berkeley DB version 1.x")
90c2ee88
DM
2733 (description
2734 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
2f3108ad 2735 (license license:perl-license)))
0e1b262e
DC
2736
2737(define-public lmdb
2738 (package
2739 (name "lmdb")
36d2e48c 2740 (version "0.9.29")
f167b432
TGR
2741 (source
2742 (origin
2743 (method git-fetch)
2744 (uri (git-reference
8fc6059b 2745 (url "https://git.openldap.org/openldap/openldap.git")
f167b432
TGR
2746 (commit (string-append "LMDB_" version))))
2747 (file-name (git-file-name name version))
2748 (sha256
36d2e48c 2749 (base32 "0airps4cd0d91nbgy7hgvifa801snxwxzwxyr6pdv61plsi7h8l3"))))
0e1b262e
DC
2750 (build-system gnu-build-system)
2751 (arguments
2752 `(#:test-target "test"
2753 #:phases
2754 (modify-phases %standard-phases
2755 (replace 'configure
2756 (lambda* (#:key outputs #:allow-other-keys)
f167b432 2757 (chdir "libraries/liblmdb")
0e1b262e
DC
2758 (substitute* "Makefile"
2759 (("/usr/local") (assoc-ref outputs "out")))
46c2cf69
EF
2760 #t))
2761 (add-after 'install 'create-pkg-config-file
2762 (lambda* (#:key outputs #:allow-other-keys)
2763 (let ((out (assoc-ref outputs "out")))
2764 (mkdir-p (string-append out "/lib/pkgconfig"))
2765 (with-output-to-file (string-append out "/lib/pkgconfig/liblmdb.pc")
2766 (lambda _
2767 (format #t "prefix=~a~@
2768 exec_prefix=~a~@
2769 libdir=~a/lib~@
2770 includedir=~a/include~@
2771 ~@
2772 Name: liblmdb~@
2773 Version: ~a~@
2774 Description: Lightning Memory-Mapped Database library~@
2775 Libs: -L${libdir} -llmdb~@
2776 Cflags: -I${includedir}~%"
2777 out out out out ,version)))
2778 #t))))))
669fde53 2779 (home-page "https://symas.com/lmdb/")
fda852ff
TGR
2780 (synopsis "Lightning Memory-Mapped Database library")
2781 (description
2782 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
2783transactional database. Unlike more complex relational databases, LMDB handles
2784only key-value pairs (stored as arbitrary byte arrays) and relies on the
2785underlying operating system for caching and locking, keeping the code small and
2786simple.
2787The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
2788disk-based databases with high read performance that scales linearly over
2789multiple cores. The size of each database is limited only by the size of the
2790virtual address space — not physical RAM.")
0e1b262e 2791 (license license:openldap2.8)))
fe71eee0 2792
659bc436 2793(define-public lmdbxx
2794 (package
2795 (name "lmdbxx")
c017e0b6 2796 (version "1.0.0")
659bc436 2797 (source
2798 (origin
2799 (method git-fetch)
2800 (uri (git-reference
c017e0b6 2801 (url "https://github.com/hoytech/lmdbxx")
659bc436 2802 (commit version)))
2803 (file-name (git-file-name name version))
2804 (sha256
c017e0b6 2805 (base32 "12k5rz74d1l0skcks9apry1svkl96g9lf5dcgylgjmh7v1jm0b7c"))))
659bc436 2806 (arguments
2807 `(#:make-flags
2808 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
2809 #:phases
2810 (modify-phases %standard-phases
2811 (delete 'configure))))
2812 (build-system gnu-build-system)
8394619b 2813 (inputs (list lmdb))
c017e0b6 2814 (home-page "https://github.com/hoytech/lmdbxx")
659bc436 2815 (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library")
2816 (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the
2817@code{LMDB} embedded database library, offering both an error-checked
2818procedural interface and an object-oriented resource interface with RAII
2819semantics.")
2820 (license license:unlicense)))
2821
fe71eee0
JN
2822(define-public libpqxx
2823 (package
2824 (name "libpqxx")
e7ccfbed 2825 (version "7.7.3")
fe71eee0 2826 (source (origin
e7ccfbed
MC
2827 (method git-fetch)
2828 (uri (git-reference
2829 (url "https://github.com/jtv/libpqxx")
2830 (commit version)))
2831 (file-name (git-file-name name version))
fe71eee0
JN
2832 (sha256
2833 (base32
e7ccfbed 2834 "1mrhsih5bhiin0l3c4vp22l9p7c5035m0vvqpx18c0407fkzc7hp"))))
fe71eee0 2835 (build-system gnu-build-system)
e7ccfbed 2836 (native-inputs (list gcc-11 python-wrapper))
8394619b 2837 (inputs (list postgresql))
e7ccfbed 2838 (arguments '(#:tests? #f)) ;tests require a running PostgreSQL server
fe71eee0
JN
2839 (synopsis "C++ connector for PostgreSQL")
2840 (description
2841 "Libpqxx is a C++ library to enable user programs to communicate with the
2842PostgreSQL database back-end. The database back-end can be local or it may be
2843on another machine, accessed via TCP/IP.")
2844 (home-page "http://pqxx.org/")
2845 (license license:bsd-3)))
4d98bfaf 2846
76656a23
EF
2847(define-public go-go-etcd-io-bbolt
2848 (package
2849 (name "go-go-etcd-io-bbolt")
2850 (version "1.3.6")
2851 (source
2852 (origin
2853 (method git-fetch)
2854 (uri (git-reference
2855 (url "https://github.com/etcd-io/bbolt")
2856 (commit (string-append "v" version))))
2857 (file-name (git-file-name name version))
2858 (sha256
2859 (base32 "0pj5245d417za41j6p09fmkbv05797vykr1bi9a6rnwddh1dbs8d"))))
2860 (build-system go-build-system)
2861 (arguments
2862 `(#:import-path "go.etcd.io/bbolt"
2863 ;; Extending the test timeout to 30 minutes still times out on aarch64.
2864 #:tests? ,(not target-arm?)))
2865 (propagated-inputs
2866 (list go-golang-org-x-sys))
2867 (home-page "https://go.etcd.io/bbolt")
2868 (synopsis "Embedded key/value database for Go")
2869 (description "Bolt is a pure Go key/value store inspired by Howard Chu's
2870LMDB project. The goal of the project is to provide a simple, fast, and
2871reliable database for projects that don't require a full database server such as
2872Postgres or MySQL.")
2873 (license license:expat)))
2874
4d98bfaf
EF
2875(define-public python-peewee
2876 (package
2877 (name "python-peewee")
afc073a2 2878 (version "3.14.4")
831f1ff9
MR
2879 (source
2880 (origin
2881 (method url-fetch)
2882 (uri (pypi-uri "peewee" version))
2883 (sha256
afc073a2 2884 (base32 "18jidir2wid0cp8a61m9vf9mf0pdvm6nzspc8bfwdbifghr6ndcy"))))
4d98bfaf
EF
2885 (build-system python-build-system)
2886 (arguments
0fecc6ce 2887 `(#:tests? #f)) ; fails to import test data
831f1ff9 2888 (inputs
8394619b 2889 (list sqlite))
4d98bfaf 2890 (native-inputs
8394619b 2891 (list python-cython))
4d98bfaf
EF
2892 (home-page "https://github.com/coleifer/peewee/")
2893 (synopsis "Small object-relational mapping utility")
2894 (description
2895 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
2896handles converting between pythonic values and those used by databases, so you
2897can use Python types in your code without having to worry. It has built-in
2898support for sqlite, mysql and postgresql. If you already have a database, you
2899can autogenerate peewee models using @code{pwiz}, a model generator.")
2900 (license license:expat)))
2901
f72c4f3d
MC
2902(define-public python-pypika-tortoise
2903 (package
2904 (name "python-pypika-tortoise")
3f033b6d 2905 (version "0.1.5")
f72c4f3d
MC
2906 (source
2907 (origin
2908 (method url-fetch)
2909 (uri (pypi-uri "pypika-tortoise" version))
2910 (sha256
3f033b6d 2911 (base32 "0j20574s2yrq8d7fav3816vj1nfpihkm2mj8jzh2ank4zixp8brf"))))
f72c4f3d
MC
2912 (build-system python-build-system)
2913 (home-page "https://github.com/tortoise/pypika-tortoise")
2914 (synopsis "Pypika fork for tortoise-orm")
2915 (description "Pypika-tortoise is a fork of pypika which has been
2916streamlined for its use in the context of tortoise-orm. It removes support
2917for many database kinds that tortoise-orm doesn't need, for example.")
2918 (license license:asl2.0)))
2919
33cdba94
MC
2920(define-public python-sphinxcontrib-asyncio
2921 (package
2922 (name "python-sphinxcontrib-asyncio")
2923 (version "0.3.0")
2924 (source
2925 (origin
2926 (method url-fetch)
2927 (uri (pypi-uri "sphinxcontrib-asyncio" version))
2928 (sha256
2929 (base32 "0bkj010ygsr7m769llf2aq4bbjfhdwqrrabi98j8gpvyzvh2dzcr"))))
2930 (build-system python-build-system)
2931 (arguments '(#:tests? #f)) ;no test suite
2932 (propagated-inputs (list python-sphinx))
2933 (home-page "https://github.com/aio-libs/sphinxcontrib-asyncio")
2934 (synopsis "Sphinx extension to support coroutines in markup")
2935 (description "This package is a Sphinx extension providing additional
2936coroutine-specific markup.")
2937 (license license:asl2.0)))
2938
82b10c93
MC
2939(define-public python-asyncpg
2940 (package
2941 (name "python-asyncpg")
bd16e7c3 2942 (version "0.25.0")
82b10c93
MC
2943 (source
2944 (origin
2945 (method url-fetch)
2946 (uri (pypi-uri "asyncpg" version))
2947 (sha256
bd16e7c3 2948 (base32 "0h1573lp4607nppflnnjrhn7yrfy6i54cm98gi4qbcikjykfdy33"))))
82b10c93
MC
2949 (build-system python-build-system)
2950 (propagated-inputs (list python-typing-extensions))
2951 (native-inputs
2952 (list postgresql
2953 python-cython
82b10c93 2954 python-pytest
82b10c93
MC
2955 python-uvloop))
2956 (home-page "https://github.com/MagicStack/asyncpg")
2957 (synopsis "Fast PostgreSQL database client library for Python")
2958 (description "@code{asyncpg} is a database interface library designed
2959specifically for PostgreSQL and Python/asyncio. @code{asyncpg} is an
2960efficient, clean implementation of PostgreSQL server binary protocol for use
2961with Python's asyncio framework.")
2962 (license license:asl2.0)))
2963
0f67d465
MC
2964(define-public python-asyncmy
2965 (package
2966 (name "python-asyncmy")
2967 (version "0.2.3")
2968 (source
2969 (origin
2970 (method url-fetch)
2971 (uri (pypi-uri "asyncmy" version))
2972 (sha256
2973 (base32 "19p81jd4w7m7v2x1jdrwibp67wzqx1a7rdw5n4qqmch3iffp97vn"))))
2974 (build-system python-build-system)
2975 (native-inputs (list python-cython))
2976 (home-page "https://github.com/long2ice/asyncmy")
2977 (synopsis "Fast MySQL driver for Python")
2978 (description "@code{asyncmy} is a fast @code{asyncio} MySQL driver, which
2979reuses most of @code{pymysql} and @code{aiomysql} but rewrites the core
2980protocol with Cython for performance.")
2981 (license license:asl2.0)))
2982
374c6fd0
MC
2983(define-public python-aiomysql
2984 (package
2985 (name "python-aiomysql")
2986 (version "0.0.21")
2987 (source
2988 (origin
2989 (method url-fetch)
2990 (uri (pypi-uri "aiomysql" version))
2991 (sha256
2992 (base32 "0b442d0jb82z3lk19ylmm64ix88ppz7gay08bxld538ivg06j5c1"))))
2993 (build-system python-build-system)
2994 (arguments '(#:tests? #f)) ;test suite requires docker
2995 (propagated-inputs (list python-pymysql))
2996 (home-page "https://github.com/aio-libs/aiomysql")
2997 (synopsis "MySQL driver for Python")
2998 (description "@code{aiomysql} is a driver for accessing a MySQL database
2999from the @code{asyncio} Python framework. It depends on and reuses most parts
3000of PyMySQL. @code{aiomysql} tries to preserve the same API as the
3001@code{aiopg} library.")
3002 (license license:expat)))
3003
1110a421
LDB
3004(define-public python-tortoise-orm
3005 (package
3006 (name "python-tortoise-orm")
d51a0974 3007 (version "0.19.1")
1110a421
LDB
3008 (source
3009 (origin
3010 (method url-fetch)
3011 (uri (pypi-uri "tortoise-orm" version))
3012 (sha256
d51a0974 3013 (base32 "17yk71dlx5ai98i6ivqgsplkwivdxackz9jfn6z42bpcdgbpiwhg"))))
1110a421 3014 (build-system python-build-system)
b045f587
MC
3015 ;; The test suite relies on asynctest, which is abandoned and doesn't
3016 ;; support Python >= 3.8.
3017 (arguments '(#:tests? #f))
1110a421 3018 (propagated-inputs
b045f587
MC
3019 (list python-aiomysql
3020 python-aiosqlite
3021 python-asyncmy
3022 python-asyncpg
3023 python-ciso8601
3024 python-iso8601
3025 python-pypika-tortoise
3026 python-pytz
3027 python-rapidjson
3028 python-uvloop))
3029 (home-page "https://github.com/tortoise/tortoise-orm")
3030 (synopsis "Asynchronous Object Relational Mapper (ORM) for Python")
3031 (description "Tortoise ORM is an easy-to-use asyncio ORM (Object
3032Relational Mapper) inspired by Django. Tortoise ORM was built with relations
3033in mind and admiration for the excellent and popular Django ORM. It's
3034engraved in its design that you are working not with just tables, you work
3035with relational data.")
1110a421
LDB
3036 (license license:asl2.0)))
3037
62ea44fc
AP
3038(define-public sqlcipher
3039 (package
3040 (name "sqlcipher")
682c2918 3041 (version "3.4.2")
62ea44fc
AP
3042 (source
3043 (origin
3044 (method url-fetch)
3045 (uri (string-append "https://github.com/sqlcipher/" name
3046 "/archive/v" version ".tar.gz"))
3047 (sha256
682c2918 3048 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
62ea44fc
AP
3049 (file-name (string-append name "-" version ".tar.gz"))))
3050 (build-system gnu-build-system)
3051 (inputs
3052 `(("libcrypto" ,openssl)
3053 ("libtcl8.6" ,tcl))) ; required for running the tests
3054 (native-inputs
8394619b 3055 (list tcl))
62ea44fc
AP
3056 (arguments
3057 '(#:configure-flags
3058 '("--enable-tempstore=yes"
3059 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
3060 "LDFLAGS=-lcrypto -ltcl8.6"
3061 "--disable-tcl")
3062 ;; tests cannot be run from the Makefile
3063 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
3064 #:test-target "testfixture"
3065 #:phases
3066 (modify-phases %standard-phases
3067 (add-before 'check 'build-test-runner
3068 (assoc-ref %standard-phases 'check))
3069 (replace 'check
3070 (lambda _
96272e28 3071 (invoke "./testfixture" "test/crypto.test"))))))
62ea44fc
AP
3072 (home-page "https://www.zetetic.net/sqlcipher/")
3073 (synopsis
3074 "Library providing transparent encryption of SQLite database files")
3075 (description "SQLCipher is an implementation of SQLite, extended to
3076provide transparent 256-bit AES encryption of database files. Pages are
3077encrypted before being written to disk and are decrypted when read back. It’s
3078well suited for protecting embedded application databases and for mobile
3079development.")
3080 ;; The source files
3081 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
3082 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
3083 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
3084 ;; source files are in the public domain.
3085 (license (list license:public-domain license:bsd-3))))
98d403bb
DM
3086
3087(define-public python-pyodbc-c
3088 (package
3089 (name "python-pyodbc-c")
89c7a2c8 3090 (version "3.1.5")
98d403bb
DM
3091 (source
3092 (origin
289b5215
TGR
3093 (method git-fetch)
3094 (uri (git-reference
3095 (url "https://gitlab.com/daym/pyodbc-c/")
3096 (commit (string-append "v" version))))
3097 (file-name (git-file-name name version))
98d403bb 3098 (sha256
89c7a2c8 3099 (base32 "08y60c5sx0k953zfx0s2a155l8py968sb17ap9a9fg8bjnj783k8"))))
98d403bb
DM
3100 (build-system python-build-system)
3101 (inputs
8394619b 3102 (list unixodbc))
98d403bb 3103 (arguments
b8686f1b 3104 `(;; The tests require a running SQL server that they don't help set up.
98d403bb 3105 #:tests? #f))
c794df84
TGR
3106 (home-page "https://gitlab.com/daym/pyodbc-c")
3107 (synopsis "Python ODBC Library written in C")
98d403bb 3108 (description "@code{python-pyodbc-c} provides a Python DB-API driver
c794df84
TGR
3109for ODBC, similar to python-pyodbc but written in C.
3110
3111It's designed to stand alone and not have other dependencies on other packages
3112or languages. It uses only Python's built-in data types.")
98d403bb
DM
3113 (license (license:x11-style "file://LICENSE.TXT"))))
3114
41916bea
DM
3115(define-public python-pyodbc
3116 (package
3117 (name "python-pyodbc")
64b12a1a 3118 (version "4.0.32")
41916bea
DM
3119 (source
3120 (origin
3121 (method url-fetch)
3122 (uri (pypi-uri "pyodbc" version))
3123 (sha256
64b12a1a 3124 (base32 "0sqs0x2l5mk3yv0wwz3ya8yh5f4babihyhc8hjbf2m86b71z1rcv"))
f0fa2b25
TGR
3125 (modules '((guix build utils)))
3126 (snippet
3127 ;; Delete precompiled binaries. The corresponding source is included.
3128 #~(for-each delete-file (find-files "." "\\.pyc$")))))
41916bea
DM
3129 (build-system python-build-system)
3130 (inputs
8394619b 3131 (list unixodbc))
41916bea 3132 (arguments
07edc13f
TGR
3133 ;; XXX Tests fail with ‘Can't open lib 'SQL Server Native Client 10.0' :
3134 ;; file not found (0) (SQLDriverConnect)")’.
3135 (list #:tests? #f
3136 #:phases
3137 #~(modify-phases %standard-phases
3138 (replace 'check
3139 (lambda* (#:key tests? #:allow-other-keys)
3140 (when tests?
3141 (invoke "python3" "tests3/test.py")))))))
41916bea
DM
3142 (home-page "https://github.com/mkleehammer/pyodbc")
3143 (synopsis "Python ODBC Library")
3144 (description "@code{python-pyodbc} provides a Python DB-API driver
3145for ODBC.")
3146 (license (license:x11-style "file:///LICENSE.TXT"))))
3147
d39a84e8
AI
3148(define-public mdbtools
3149 (package
3150 (name "mdbtools")
3151 (version "0.7.1")
3152 (source
3153 (origin
f1f1cebd
RW
3154 (method git-fetch)
3155 (uri (git-reference
b0e7b699 3156 (url "https://github.com/brianb/mdbtools")
f1f1cebd
RW
3157 (commit version)))
3158 (file-name (git-file-name name version))
d39a84e8
AI
3159 (sha256
3160 (base32
f1f1cebd 3161 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
d39a84e8
AI
3162 (build-system gnu-build-system)
3163 (inputs
8394619b 3164 (list glib))
d39a84e8 3165 (native-inputs
8394619b
LC
3166 (list autoconf
3167 automake
3168 libtool
3169 pkg-config
3170 txt2man
3171 which))
d39a84e8
AI
3172 (home-page "http://mdbtools.sourceforge.net/")
3173 (synopsis "Read Microsoft Access databases")
3174 (description "MDB Tools is a set of tools and applications to read the
3175proprietary MDB file format used in Microsoft's Access database package. This
3176includes programs to export schema and data from Microsoft's Access database
3177file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
3178etc., and an SQL engine for performing simple SQL queries.")
3179 (license (list license:lgpl2.0
3180 license:gpl2+))))
07041d95 3181
5bac1466
EF
3182(define-public go-gopkg-in-mgo-v2
3183 (package
3184 (name "go-gopkg-in-mgo-v2")
3185 (version "2.0.0-20190816093944-a6b53ec6cb22")
3186 (source
3187 (origin
3188 (method git-fetch)
3189 (uri (git-reference
3190 (url "https://gopkg.in/mgo.v2")
3191 (commit (go-version->git-ref version))))
3192 (file-name (git-file-name name version))
3193 (sha256
3194 (base32 "1lgvwxsbmdrf4938qkxl56wbwgbphk2qqnmpf73qdmlv4qsg14na"))))
3195 (build-system go-build-system)
3196 (arguments
3197 '(#:tests? #f ; Tests try to use a running mongodb server.
3198 #:import-path "gopkg.in/mgo.v2"))
3199 (native-inputs
3200 (list go-gopkg-in-check-v1))
3201 (home-page "https://gopkg.in/mgo.v2")
3202 (synopsis "MongoDB driver for Go")
3203 (description "This package provides a MongoDB driver for Go.")
3204 (license license:bsd-2)))
3205
07041d95
TGR
3206(define-public python-lmdb
3207 (package
3208 (name "python-lmdb")
771c266b 3209 (version "1.0.0")
07041d95
TGR
3210 (source (origin
3211 (method url-fetch)
3212 (uri (pypi-uri "lmdb" version))
3213 (sha256
3214 (base32
771c266b 3215 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
07041d95
TGR
3216 (modules '((guix build utils)))
3217 (snippet
3218 ;; Delete bundled lmdb source files.
6cbee49d
MW
3219 '(begin
3220 (for-each delete-file (list "lib/lmdb.h"
3221 "lib/mdb.c"
3222 "lib/midl.c"
3223 "lib/midl.h"))
3224 #t))))
07041d95
TGR
3225 (build-system python-build-system)
3226 (inputs
8394619b 3227 (list lmdb))
07041d95
TGR
3228 (arguments
3229 `(#:phases
3230 (modify-phases %standard-phases
3231 (add-before 'build 'use-system-lmdb
3232 (lambda* (#:key inputs #:allow-other-keys)
3233 (let ((lmdb (assoc-ref inputs "lmdb")))
771c266b 3234 (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
07041d95
TGR
3235 (setenv "LMDB_FORCE_SYSTEM" "set")
3236 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
3237 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
3238 #t))))
3239 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
3240 #:tests? #f))
3241 (home-page "https://github.com/dw/py-lmdb")
3242 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
3243 (description
3244 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
3245Memory-Mapped Database} (LMDB), a high-performance key-value store.")
3246 (license
3247 (list license:openldap2.8
3248 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
3249 ;; but not actually needed on platforms currently supported by Guix.
3250 license:bsd-3))))
3251
61ce0998
RJ
3252(define-public virtuoso-ose
3253 (package
3254 (name "virtuoso-ose")
48efbde7 3255 (version "7.2.7")
61ce0998
RJ
3256 (source
3257 (origin
3258 (method url-fetch)
3e29bf16
TGR
3259 (uri (string-append "mirror://sourceforge/virtuoso/virtuoso/" version "/"
3260 "virtuoso-opensource-" version ".tar.gz"))
61ce0998 3261 (sha256
48efbde7
RJ
3262 (base32 "1853ln0smiilf3pni70gq6nmi9ps039cy44g6b5i9d2z1n9hnj02"))
3263 (patches (search-patches "virtuoso-ose-remove-pre-built-jar-files.patch"))
3264 (modules '((guix build utils)))
3265 ;; This snippet removes pre-built Java archives.
3266 (snippet
3267 '(for-each delete-file-recursively
3268 (list "binsrc/hibernate"
3269 "binsrc/jena"
3270 "binsrc/jena2"
3271 "binsrc/jena3"
3272 "binsrc/jena4"
3273 "binsrc/rdf4j"
3274 "binsrc/sesame"
3275 "binsrc/sesame2"
3276 "binsrc/sesame3"
3277 "binsrc/sesame4"
3278 "libsrc/JDBCDriverType4")))))
61ce0998
RJ
3279 (build-system gnu-build-system)
3280 (arguments
6d09a7b5
RJ
3281 `(#:tests? #f ; Tests require a network connection.
3282 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
3283 ;; This indicates that the internal zlib code may still be used.
3284 #:configure-flags '("--without-internal-zlib"
d26bf529
RJ
3285 "--with-readline"
3286 "--enable-static=no")
3287 #:phases
3288 (modify-phases %standard-phases
48efbde7
RJ
3289 (replace 'bootstrap
3290 (lambda _
3291 (invoke "sh" "autogen.sh")))
5850f1e9
VC
3292 (add-after 'unpack 'avoid-embedding-kernel-and-timestamps
3293 ;; For a reproducible build, avoid embedding the kernel version and
3294 ;; timestamps.
3295 (lambda _
3296 (substitute*
3297 (list "bin/makever"
3298 "appsrc/ODS-Polls/make_vad.sh"
3299 "appsrc/ODS-Blog/make_vad.sh"
3300 "appsrc/ODS-Community/make_vad.sh"
3301 "appsrc/ODS-Framework/make_vad.sh"
3302 "appsrc/ODS-Framework/oauth/make_vad.sh"
3303 "appsrc/ODS-WebMail/make_vad.sh"
3304 "appsrc/ODS-Calendar/make_vad.sh"
3305 "appsrc/ODS-Gallery/make_vad.sh"
3306 "appsrc/ODS-Briefcase/make_vad.sh"
3307 "appsrc/ODS-FeedManager/make_vad.sh"
3308 "appsrc/ODS-Bookmark/make_vad.sh"
3309 "appsrc/ODS-Addressbook/make_vad.sh"
3310 "binsrc/dbpedia/make_vad.sh"
3311 "binsrc/samples/demo/make_vad.sh"
3312 "binsrc/samples/demo/mkdoc.sh"
3313 "binsrc/samples/sparql_demo/make_vad.sh"
3314 "binsrc/bpel/make_vad.sh"
3315 "binsrc/fct/make_vad.sh"
3316 "binsrc/rdf_mappers/make_vad.sh"
3317 "binsrc/isparql/make_vad.sh"
3318 "binsrc/conductor/mkvad.sh")
3319 (("^UNAME_SYSTEM=.*") "UNAME_SYSTEM=unknown\n")
3320 (("^UNAME_RELEASE=.*") "UNAME_RELEASE=unknown\n")
3321 (("^PACKDATE=.*") "PACKDATE=2012-04-18\n")
3322 (("^DATE=.*") "DATE=2012-04-18\n"))))
d26bf529
RJ
3323 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
3324 ;; the build output. The following phase removes it.
3325 (add-after 'install 'remove-static-libs
3326 (lambda* (#:key outputs #:allow-other-keys)
3327 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3328 (for-each (lambda (file)
3329 (delete-file (string-append lib "/" file)))
3330 '("libvirtuoso-t.a"
3331 "libvirtuoso-t.la"))))))))
48efbde7
RJ
3332 (native-inputs
3333 (list autoconf automake bison flex gperf libtool))
61ce0998 3334 (inputs
8394619b 3335 (list openssl net-tools readline zlib))
61ce0998
RJ
3336 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
3337 (synopsis "Multi-model database system")
3338 (description "Virtuoso is a scalable cross-platform server that combines
3339relational, graph, and document data management with web application server
3340and web services platform functionality.")
48b68c61
EF
3341 ;; configure: error: ... can only be build on 64bit platforms
3342 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
61ce0998 3343 (license license:gpl2)))
74248d22 3344
a8714bf6
RW
3345(define-public python-ccm
3346 (package
3347 (name "python-ccm")
3348 (version "2.1.6")
3349 (source
3350 (origin
3351 (method url-fetch)
3352 (uri (pypi-uri "ccm" version))
3353 (sha256
3354 (base32
3355 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
3356 (build-system python-build-system)
3357 (propagated-inputs
8394619b
LC
3358 (list python-pyyaml
3359 ;; Not listed in setup.py, but used in ccmlib/node.py for full
3360 ;; functionality
3361 python-psutil python-six))
a8714bf6
RW
3362 (home-page "https://github.com/pcmanus/ccm")
3363 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
3364localhost")
3365 (description "Cassandra Cluster Manager is a development tool for testing
3366local Cassandra clusters. It creates, launches and removes Cassandra clusters
3367on localhost.")
3368 (license license:asl2.0)))
3369
a8714bf6
RW
3370(define-public python-sqlalchemy
3371 (package
3372 (name "python-sqlalchemy")
df95872d 3373 (version "1.4.35")
a8714bf6
RW
3374 (source
3375 (origin
3376 (method url-fetch)
aeec4a8f 3377 (uri (pypi-uri "SQLAlchemy" version))
a8714bf6 3378 (sha256
df95872d 3379 (base32 "1ddab00d5mpzg25r1qxccma2zb551hhmymsy1ycp6r6w04xq3z1g"))))
a8714bf6
RW
3380 (build-system python-build-system)
3381 (native-inputs
8394619b 3382 (list python-cython ; for C extensions
72d292ea 3383 python-pytest python-mock python-pytest-xdist)) ; for tests
0711ad04 3384 (propagated-inputs
8394619b 3385 (list python-greenlet))
a8714bf6 3386 (arguments
72d292ea
MC
3387 (list
3388 #:phases
3389 #~(modify-phases %standard-phases
3390 (replace 'check
3391 (lambda* (#:key tests? #:allow-other-keys)
3392 (when tests?
3393 (invoke "pytest" "-vv"
3394 "-n" (number->string (parallel-job-count))
3395 ;; The memory usage tests are very expensive and run in
3396 ;; sequence; skip them.
3397 "-k" "not test_memusage.py")))))))
5cfe650b 3398 (home-page "https://www.sqlalchemy.org")
a8714bf6
RW
3399 (synopsis "Database abstraction library")
3400 (description
3401 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
3402gives application developers the full power and flexibility of SQL. It
3403provides a full suite of well known enterprise-level persistence patterns,
3404designed for efficient and high-performing database access, adapted into a
3405simple and Pythonic domain language.")
3406 (license license:x11)))
3407
f8a4724c
B
3408(define-public python-sqlalchemy-stubs
3409 (package
3410 (name "python-sqlalchemy-stubs")
3411 (version "0.4")
3412 (source
3413 (origin
3414 (method url-fetch)
3415 (uri (pypi-uri "sqlalchemy-stubs" version))
3416 (sha256
3417 (base32
3418 "1bppjmv7v7m0q8gwg791pgxbx4ay7mna0zq204pn9vw28kfxcrf6"))))
3419 (build-system python-build-system)
3420 (propagated-inputs
8394619b 3421 (list python-mypy python-typing-extensions))
f8a4724c
B
3422 (home-page "https://github.com/dropbox/sqlalchemy-stubs")
3423 (synopsis "SQLAlchemy stubs and mypy plugin")
3424 (description "This package contains type stubs and a mypy plugin to
3425provide more precise static types and type inference for SQLAlchemy
3426framework.")
3427 (license license:asl2.0)))
3428
a8714bf6
RW
3429(define-public python-sqlalchemy-utils
3430 (package
3431 (name "python-sqlalchemy-utils")
d08eb54a 3432 (version "0.38.2")
a8714bf6
RW
3433 (source
3434 (origin
3435 (method url-fetch)
3436 (uri (pypi-uri "SQLAlchemy-Utils" version))
3437 (sha256
3438 (base32
d08eb54a 3439 "1d6fq81489kqzxmk3l6f39sinw206lzs392frmpr5lsjzg9xc0cy"))))
a8714bf6
RW
3440 (build-system python-build-system)
3441 (arguments
3442 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
3443 ;; #:phases
3444 ;; (modify-phases %standard-phases
3445 ;; (replace 'check
3446 ;; (lambda _
3447 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
3448 (propagated-inputs
8394619b 3449 (list python-six python-sqlalchemy))
a8714bf6 3450 (native-inputs
8394619b
LC
3451 (list python-dateutil python-flexmock python-psycopg2 python-pytest
3452 python-pytz))
a8714bf6
RW
3453 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
3454 (synopsis "Various utility functions for SQLAlchemy")
3455 (description
3456 "SQLAlchemy-utils provides various utility functions and custom data types
3457for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
3458
3459You might also want to install the following optional dependencies:
3460@enumerate
3461@item @code{python-passlib}
3462@item @code{python-babel}
3463@item @code{python-cryptography}
3464@item @code{python-pytz}
3465@item @code{python-psycopg2}
3466@item @code{python-furl}
3467@item @code{python-flask-babel}
3468@end enumerate
3469")
3470 (license license:bsd-3)))
3471
de84d3b1
MB
3472(define-public python-alchemy-mock
3473 (package
3474 (name "python-alchemy-mock")
3475 (version "0.4.3")
3476 (home-page "https://github.com/miki725/alchemy-mock")
3477 (source (origin
3478 (method url-fetch)
3479 (uri (pypi-uri "alchemy-mock" version))
3480 (sha256
3481 (base32
3482 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
3483 (build-system python-build-system)
3484 (arguments
3485 '(#:phases (modify-phases %standard-phases
3486 (replace 'check
3487 (lambda _
3488 ;; Create pytest.ini that adds doctest options to
3489 ;; prevent test failure. Taken from tox.ini.
3490 (call-with-output-file "pytest.ini"
3491 (lambda (port)
3492 (format port "[pytest]
3493doctest_optionflags=IGNORE_EXCEPTION_DETAIL
3494")))
3495 (invoke "pytest" "-vv" "--doctest-modules"
3496 "alchemy_mock/"))))))
3497 (native-inputs
8394619b 3498 (list python-mock python-pytest))
de84d3b1 3499 (propagated-inputs
8394619b 3500 (list python-six python-sqlalchemy))
de84d3b1
MB
3501 (synopsis "Mock helpers for SQLAlchemy")
3502 (description
3503 "This package provides mock helpers for SQLAlchemy that makes it easy
3504to mock an SQLAlchemy session while preserving the ability to do asserts.
3505
3506Normally Normally SQLAlchemy's expressions cannot be easily compared as
3507comparison on binary expression produces yet another binary expression, but
3508this library provides functions to facilitate such comparisons.")
3509 (license license:expat)))
3510
a8714bf6
RW
3511(define-public python-alembic
3512 (package
3513 (name "python-alembic")
eb8619a5 3514 (version "1.7.5")
a8714bf6
RW
3515 (source
3516 (origin
3517 (method url-fetch)
3518 (uri (pypi-uri "alembic" version))
3519 (sha256
eb8619a5 3520 (base32 "0lxi2g2025lz5k7k5dd5fc1lfijqi2yw6qqyjzp073z6laa8cckw"))))
a8714bf6 3521 (build-system python-build-system)
45ebd90c
MB
3522 (arguments
3523 '(#:phases (modify-phases %standard-phases
3524 (replace 'check
3525 (lambda _
3526 (invoke "pytest" "-vv"))))))
a8714bf6 3527 (native-inputs
8394619b 3528 (list python-mock python-pytest-cov))
a8714bf6 3529 (propagated-inputs
8394619b 3530 (list python-dateutil python-sqlalchemy python-mako python-editor))
a7f27da7 3531 (home-page "https://bitbucket.org/zzzeek/alembic")
6743080c 3532 (synopsis "Database migration tool for SQLAlchemy")
a8714bf6
RW
3533 (description
3534 "Alembic is a lightweight database migration tool for usage with the
3535SQLAlchemy Database Toolkit for Python.")
3536 (license license:expat)))
3537
a8714bf6
RW
3538(define-public python-pickleshare
3539 (package
3540 (name "python-pickleshare")
f825faa5 3541 (version "0.7.5")
a8714bf6
RW
3542 (source
3543 (origin
3544 (method url-fetch)
ed519b3c 3545 (uri (pypi-uri "pickleshare" version))
a8714bf6 3546 (sha256
f825faa5 3547 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
a8714bf6 3548 (build-system python-build-system)
ff856cfd
MB
3549 (arguments
3550 `(#:phases (modify-phases %standard-phases
3551 (replace 'check
3552 (lambda _
3553 (invoke "pytest"))))))
3554 (native-inputs
8394619b 3555 (list python-pytest))
a8714bf6
RW
3556 (home-page "https://github.com/vivainio/pickleshare")
3557 (synopsis "Tiny key value database with concurrency support")
3558 (description
3559 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
3560Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
3561shelve, many processes can access the database simultaneously. Changing a
3562value in database is immediately visible to other processes accessing the same
3563database. Concurrency is possible because the values are stored in separate
3564files. Hence the “database” is a directory where all files are governed by
3565PickleShare.")
3566 (license license:expat)))
3567
a8714bf6
RW
3568(define-public python-apsw
3569 (package
3570 (name "python-apsw")
53c127c1
HC
3571 (version "3.39.2.1")
3572 ;; The compressed release has fetching functionality disabled.
a8714bf6 3573 (source
17ffcde1 3574 (origin
53c127c1
HC
3575 (method url-fetch)
3576 (uri (string-append
3577 "https://github.com/rogerbinns/apsw/releases/download/"
3578 version "/apsw-" version ".zip"))
17ffcde1
HC
3579 (sha256
3580 (base32
53c127c1
HC
3581 "06x3qgg71xz8l3kz8gz04wkfp5f6zfrg476a4mm1c5hikqyw6ykj"))
3582 ;; Cherry-picked from upstream, remove when bumping to 3.39.3.
3583 (patches
3584 (search-patches "python-apsw-3.39.2.1-test-fix.patch"))))
a8714bf6 3585 (build-system python-build-system)
53c127c1 3586 (native-inputs (list unzip))
17ffcde1 3587 (inputs (list sqlite-next)) ;SQLite 3.39 required.
a8714bf6 3588 (arguments
17ffcde1
HC
3589 (list #:phases
3590 #~(modify-phases %standard-phases
3591 (replace 'build
3592 (lambda _
3593 (invoke "python" "setup.py" "build" "--enable-all-extensions"
a45c30b6 3594 "--enable=load_extension")))
17ffcde1
HC
3595 (add-after 'build 'build-test-helper
3596 (lambda _
3597 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
a45c30b6 3598 "-I." "-Isqlite3" "src/testextension.c"))))))
a8714bf6
RW
3599 (home-page "https://github.com/rogerbinns/apsw/")
3600 (synopsis "Another Python SQLite Wrapper")
17ffcde1
HC
3601 (description
3602 "APSW is a Python wrapper for the SQLite embedded relational database
3603engine. In contrast to other wrappers such as pysqlite it focuses on being a
3604minimal layer over SQLite attempting just to translate the complete SQLite API
3605into Python.")
a8714bf6
RW
3606 (license license:zlib)))
3607
ba0b249d
LDB
3608(define-public python-aiosqlite
3609 (package
3610 (name "python-aiosqlite")
281fd9ad 3611 (version "0.17.0")
ba0b249d
LDB
3612 (source
3613 (origin
3614 (method url-fetch)
3615 (uri (pypi-uri "aiosqlite" version))
3616 (sha256
3617 (base32
281fd9ad 3618 "0lgfpbkcd730hbgj3zlrbx2y8fzvdns2zj3s4r4l31n49g1arrph"))))
ba0b249d 3619 (build-system python-build-system)
281fd9ad
LDB
3620 (arguments
3621 '(#:phases (modify-phases %standard-phases
3622 (replace 'check
3623 (lambda* (#:key tests? #:allow-other-keys)
3624 (if tests?
3625 (invoke "python" "-m" "unittest" "aiosqlite.tests")
3626 (format #t "test suite not run~%"))
3627 #t)))))
3628 (propagated-inputs
8394619b 3629 (list python-typing-extensions))
ba0b249d 3630 (native-inputs
8394619b 3631 (list python-aiounittest))
ba0b249d
LDB
3632 (home-page "https://github.com/jreese/aiosqlite")
3633 (synopsis
3634 "Asyncio bridge for sqlite3")
3635 (description
3636 "The package aiosqlite replicates the standard sqlite3 module, but with
3637async versions of all the standard connection and cursor methods, and context
3638managers for automatically closing connections.")
3639 (license license:expat)))
3640
b4da7c21
RW
3641(define-public python-databases
3642 (package
3643 (name "python-databases")
3644 (version "0.5.5")
3645 (source
3646 (origin
3647 (method url-fetch)
3648 (uri (pypi-uri "databases" version))
3649 (sha256
3650 (base32 "0dzb998kg35xmd50ih168320vih2w3ich798r8fc4lf9q4bb1ih2"))))
3651 (build-system python-build-system)
3652 (propagated-inputs
3653 (list python-aiosqlite
3654 python-aiopg
3655 python-aiomysql
3656 python-asyncpg
3657 python-asyncmy
3658 python-sqlalchemy))
3659 (home-page "https://github.com/encode/databases")
3660 (synopsis "Async database support for Python.")
3661 (description "This package implements async database support for Python.")
3662 (license license:bsd-3)))
3663
a8714bf6
RW
3664(define-public python-psycopg2
3665 (package
3666 (name "python-psycopg2")
ee6e69a5 3667 (version "2.9.3")
a8714bf6
RW
3668 (source
3669 (origin
3670 (method url-fetch)
3671 (uri (pypi-uri "psycopg2" version))
3672 (sha256
ee6e69a5 3673 (base32 "1099as8ind9kpz30rmqzc3nir668fmpkxwayrj2sjka3ycdiv14f"))))
a8714bf6
RW
3674 (build-system python-build-system)
3675 (arguments
3676 ;; Tests would require a postgresql database "psycopg2_test"
3677 ;; and a running postgresql database management service.
ee6e69a5 3678 '(#:tests? #f)) ; TODO re-enable after providing a test-db.
a8714bf6 3679 (inputs
8394619b 3680 (list postgresql)) ; libpq
ee6e69a5 3681 (home-page "https://www.psycopg.org/")
a8714bf6
RW
3682 (synopsis "Python PostgreSQL adapter")
3683 (description
19601e89
BW
3684 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
36852.0.")
a8714bf6
RW
3686 (license license:lgpl3+)))
3687
84bcda58
MB
3688(define-public python-psycopg-pool
3689 (package
3690 (name "python-psycopg-pool")
3691 ;; The connection pooling code is on a different release cadence
3692 ;; from the driver code, so fetch the latest PyPI release.
3693 (version "3.0.3")
3694 (source (origin
3695 (method url-fetch)
3696 (uri (pypi-uri "psycopg-pool" version))
3697 (sha256
3698 (base32
3699 "1nx139pwzsgrz253zjxw2sf8h713s79h4cp1falmpc39j08djb46"))))
3700 (build-system python-build-system)
3701 (arguments
3702 (list #:tests? #f ;run for psycopg below
3703 #:phases
3704 #~(modify-phases %standard-phases
3705 ;; This module requires 'psycopg', however psycopg needs this
3706 ;; for its tests. Disable sanity check to break the cycle.
3707 (delete 'sanity-check))))
3708 (home-page "https://www.psycopg.org/")
3709 (synopsis "Connection pooler for psycopg")
3710 (description
3711 "This module provides connection pool implementations that can be used
3712with the @code{psycopg} PostgreSQL driver.")
3713 (license license:lgpl3+)))
3714
5ec41299
MB
3715(define-public python-psycopg
3716 (package
3717 (name "python-psycopg")
3718 (version "3.0.8")
3719 (source (origin
3720 ;; Fetch from git because PyPI contains only cythonized sources.
3721 (method git-fetch)
3722 (uri (git-reference
3723 (url "https://github.com/psycopg/psycopg")
3724 (commit version)))
3725 (file-name (git-file-name name version))
3726 (sha256
3727 (base32
3728 "16i19jqd9lg9r7bc63ssh527cccrpf49g1nlayikk5qlswpzp75y"))))
3729 (build-system python-build-system)
3730 (arguments
3731 (list #:phases
3732 #~(modify-phases %standard-phases
3733 (add-before 'build 'change-directory
3734 (lambda _
3735 (chdir "psycopg")))
3736 (add-after 'build 'build-c-extensions
3737 (lambda _
3738 (with-directory-excursion "../psycopg_c"
3739 ((assoc-ref %standard-phases 'build)))))
3740 (add-after 'install 'install-c-extensions
3741 (lambda* (#:key inputs outputs #:allow-other-keys)
3742 ;; For some reason setup.py refuses to install if the
3743 ;; installation directory is not on PYTHONPATH.
3744 (setenv "PYTHONPATH" (site-packages inputs outputs))
3745 (with-directory-excursion "../psycopg_c"
3746 ((assoc-ref %standard-phases 'install)
3747 #:inputs inputs
3748 #:outputs outputs))))
3749 (add-before 'check 'start-postgresql
3750 (lambda _
3751 (let ((dbdir (string-append (getcwd) "/../pgdir")))
3752 (invoke "initdb" "-D" dbdir)
3753 (invoke "pg_ctl" "-D" dbdir
3754 "-o" (string-append "-k " dbdir)
3755 "-l" (string-append dbdir "/db.log")
3756 "start")
3757
3758 (invoke "psql" "-h" dbdir "-d" "postgres"
3759 "-c" "CREATE DATABASE nixbld;"))))
3760 (replace 'check
3761 (lambda* (#:key inputs tests? #:allow-other-keys)
3762 (when tests?
3763 (setenv "TZDIR" (search-input-directory inputs
3764 "share/zoneinfo"))
3765 (with-directory-excursion ".."
3766 (invoke "pytest" "-vv"
3767 "-o" "asyncio_mode=auto"
3768 ;; FIXME: Many of the typing tests are failing,
3769 ;; conveniently tagged as slow...
3770 "-k" "not slow"))))))))
3771 (native-inputs
3772 (list python-cython-3
3773 python-mypy
3774 python-psycopg-pool
3775 python-pytest
3776 python-pytest-asyncio
3777 python-tenacity
3778 pproxy
3779 tzdata-for-tests))
3780 (inputs
3781 (list postgresql))
3782 (home-page "https://www.psycopg.org/")
3783 (synopsis "PostgreSQL driver for Python")
3784 (description
3785 "Psycopg 3 is a new implementation of the popular @code{psycopg2}
3786database adapter for Python.")
3787 (license license:lgpl3+)))
3788
a8714bf6
RW
3789(define-public python-sadisplay
3790 (package
3791 (name "python-sadisplay")
d570b32a 3792 (version "0.4.9")
a8714bf6
RW
3793 (source
3794 (origin
3795 (method url-fetch)
3796 (uri (pypi-uri "sadisplay" version))
3797 (sha256
3798 (base32
d570b32a 3799 "15jxwgla3q4xsp6rw8inqaiy1kdzc8l2cixj8amqcf0ji47icrxg"))))
a8714bf6 3800 (build-system python-build-system)
d570b32a
MB
3801 (arguments
3802 '(#:phases (modify-phases %standard-phases
3803 (replace 'check
3804 (lambda* (#:key tests? #:allow-other-keys)
3805 (if tests?
3806 (begin
3807 (setenv "PYTHONPATH"
3808 (string-append ".:" (or (getenv "PYTHONPATH")
3809 "")))
3810 (invoke "pytest" "-vv"))
3811 (format #t "test suite not run~%")))))))
a8714bf6 3812 (propagated-inputs
8394619b 3813 (list python-sqlalchemy))
a8714bf6 3814 (native-inputs
bcdc5cae 3815 ;; For tests.
8394619b 3816 (list python-pytest))
a8714bf6
RW
3817 (home-page "https://bitbucket.org/estin/sadisplay")
3818 (synopsis "SQLAlchemy schema displayer")
3819 (description "This package provides a program to build Entity
3820Relationship diagrams from a SQLAlchemy model (or directly from the
3821database).")
3822 (license license:bsd-3)))
3823
945ec6c3
VM
3824(define-public yoyo-migrations
3825 (package
3826 (name "yoyo-migrations")
3827 (version "7.2.0")
3828 (source
3829 (origin
3830 ;; We use the upstream repository, as the tests are not included in the
3831 ;; PyPI releases.
3832 (method hg-fetch)
3833 (uri (hg-reference
3834 (url "https://hg.sr.ht/~olly/yoyo")
3835 (changeset (string-append "v" version "-release"))))
3836 (file-name (string-append name "-" version "-checkout"))
3837 (sha256
3838 (base32 "0q2z9bgdj3wyix7yvqsayfs21grp5av8ilh411lgmjhigszkvhcq"))))
3839 (build-system python-build-system)
3840 (arguments
3841 ;; XXX: Tests require a connection to some pgsql database and psycopg
3842 ;; fails to connect to it.
3843 '(#:tests? #f))
3844 (propagated-inputs
8394619b 3845 (list python-sqlparse python-tabulate))
945ec6c3
VM
3846 (home-page "https://ollycope.com/software/yoyo/latest/")
3847 (synopsis "Database migrations with SQL")
3848 (description
3849 "Yoyo is a database schema migration tool. Migrations are written as SQL
3850files or Python scripts that define a list of migration steps.")
3851 (license license:asl2.0)))
3852
a8714bf6
RW
3853(define-public python-mysqlclient
3854 (package
3855 (name "python-mysqlclient")
5ec1feca 3856 (version "2.0.1")
a8714bf6
RW
3857 (source
3858 (origin
3859 (method url-fetch)
3860 (uri (pypi-uri "mysqlclient" version))
3861 (sha256
3862 (base32
5ec1feca 3863 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
a8714bf6 3864 (build-system python-build-system)
eec6a694 3865 (arguments '(#:tests? #f)) ;XXX: requires a live database
a8714bf6 3866 (inputs
997abda9 3867 `(("mysql-dev" ,mariadb "dev")))
a8714bf6
RW
3868 (home-page "https://github.com/PyMySQL/mysqlclient-python")
3869 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
3870 (description "MySQLdb is an interface to the popular MySQL database server
3871for Python. The design goals are:
3872@enumerate
3873@item Compliance with Python database API version 2.0 [PEP-0249],
3874@item Thread-safety,
3875@item Thread-friendliness (threads will not block each other).
3876@end enumerate")
3877 (license license:gpl2)))
3878
a8714bf6
RW
3879(define-public python-hiredis
3880 (package
3881 (name "python-hiredis")
3882 (version "0.2.0")
3883 (source
3884 (origin
3885 (method url-fetch)
3886 (uri (pypi-uri "hiredis" version))
3887 (sha256
3888 (base32
3889 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
3890 (build-system python-build-system)
3891 (arguments
3892 ;; no tests
3893 `(#:tests? #f))
3894 (home-page "https://github.com/redis/hiredis-py")
3895 (synopsis "Python extension that wraps protocol parsing code in hiredis")
3896 (description "Python-hiredis is a python extension that wraps protocol
3897parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
3898 (license license:bsd-3)))
3899
eba07849
MC
3900(define-public python-aioredis
3901 (package
3902 (name "python-aioredis")
3903 (version "2.0.1")
3904 (source
3905 (origin
3906 (method url-fetch)
3907 (uri (pypi-uri "aioredis" version))
3908 (sha256
3909 (base32 "13nrkk45az6qdiwfpbw80ls6bfip0i27qlkh9gsp2b9zk6pim9ga"))))
3910 (build-system python-build-system)
3911 (arguments
3912 (list #:phases #~(modify-phases %standard-phases
3913 (add-before 'check 'start-redis
3914 (lambda _
3915 (invoke "redis-server" "--daemonize" "yes")))
3916 (replace 'check
3917 (lambda* (#:key tests? #:allow-other-keys)
3918 (when tests?
3919 (invoke "pytest" "-vv")))))))
3920 (native-inputs
3921 (list python-pytest
3922 python-pytest-asyncio
3923 python-uvloop
3924 redis))
3925 (propagated-inputs
3926 (list python-async-timeout
3927 python-hiredis
3928 python-typing-extensions))
3929 (home-page "https://github.com/aio-libs/aioredis-py")
3930 (synopsis "Redis support for Python's @code{asyncio} module")
3931 (description "This package provides Redis support for the Python
3932@code{asyncio} (PEP 3156) module.")
3933 (license license:expat)))
3934
a8714bf6
RW
3935(define-public python-fakeredis
3936 (package
3937 (name "python-fakeredis")
a64ea1f2 3938 (version "1.7.1")
a8714bf6
RW
3939 (source
3940 (origin
3941 (method url-fetch)
3942 (uri (pypi-uri "fakeredis" version))
3943 (sha256
3944 (base32
a64ea1f2 3945 "1v68my2v7fg44zwky3k5d52nn1bi0szpgdslghrpa2ifnjhlnb3w"))))
a8714bf6
RW
3946 (build-system python-build-system)
3947 (arguments
3948 ;; no tests
3949 `(#:tests? #f))
1655e7be 3950 (propagated-inputs
a64ea1f2 3951 (list python-aioredis python-packaging python-redis python-sortedcontainers))
a8714bf6
RW
3952 (home-page "https://github.com/jamesls/fakeredis")
3953 (synopsis "Fake implementation of redis API for testing purposes")
a4764ff0
TGR
3954 (description
3955 "Fakeredis is a pure-Python implementation of the redis-py Python client
3956that simulates talking to a redis server. It was created for a single purpose:
3957to write unit tests.
3958
3959Setting up redis is not hard, but one often wants to write unit tests that don't
3960talk to an external server such as redis. This module can be used as a
3961reasonable substitute.")
a8714bf6
RW
3962 (license license:bsd-3)))
3963
a8714bf6
RW
3964(define-public python-redis
3965 (package
3966 (name "python-redis")
d87252e6 3967 (version "3.5.3")
a8714bf6
RW
3968 (source
3969 (origin
3970 (method url-fetch)
3971 (uri (pypi-uri "redis" version))
3972 (sha256
d87252e6 3973 (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
a8714bf6 3974 (build-system python-build-system)
a263a976 3975 ;; Tests require a running Redis server.
a8714bf6
RW
3976 (arguments '(#:tests? #f))
3977 ;; As long as we are not running test, we do not need this input :-)
3978 ;;(native-inputs
3979 ;; `(("python-pytest" ,python-pytest)))
3980 (home-page "https://github.com/andymccurdy/redis-py")
3981 (synopsis "Redis Python client")
3982 (description
3983 "This package provides a Python interface to the Redis key-value store.")
3984 (license license:expat)))
3985
a8714bf6
RW
3986(define-public python-rq
3987 (package
3988 (name "python-rq")
6b627f0e 3989 (version "1.11")
a8714bf6
RW
3990 (source
3991 (origin
b462caaf
MB
3992 (method git-fetch)
3993 (uri (git-reference
3994 (url "https://github.com/rq/rq")
3995 (commit (string-append "v" version))))
3996 (file-name (git-file-name name version))
a8714bf6 3997 (sha256
6b627f0e 3998 (base32 "1dj3m8dh9vf1qiq1drjhfw5xbr975v1kpzn4fwja83cfd7jrpzvy"))))
a8714bf6 3999 (build-system python-build-system)
b462caaf
MB
4000 (arguments
4001 '(#:phases (modify-phases %standard-phases
4002 (add-before 'check 'start-redis
4003 (lambda _
4004 (invoke "redis-server" "--daemonize" "yes")))
4005 (replace 'check
4006 (lambda* (#:key outputs #:allow-other-keys)
4007 (let ((out (assoc-ref outputs "out")))
4008 ;; Drop test that needs the SDK for Sentry.io.
4009 (delete-file "tests/test_sentry.py")
4010 ;; Ensure 'rq' and 'rqworker' ends up on PATH.
4011 (setenv "PATH" (string-append out "/bin:"
4012 (getenv "PATH")))
4013 (invoke "pytest" "-vv")))))))
4014 (native-inputs
6b627f0e 4015 (list python-mock python-psutil python-pytest redis))
a8714bf6 4016 (propagated-inputs
8394619b 4017 (list python-click python-redis))
4e5ad79e 4018 (home-page "https://python-rq.org/")
a8714bf6
RW
4019 (synopsis "Simple job queues for Python")
4020 (description
4021 "RQ (Redis Queue) is a simple Python library for queueing jobs and
4022processing them in the background with workers. It is backed by Redis and it
4023is designed to have a low barrier to entry.")
4024 (license license:bsd-2)))
4025
8a88efce
MB
4026(define-public python-rq-scheduler
4027 (package
4028 (name "python-rq-scheduler")
4029 (version "0.10.0")
4030 (home-page "https://github.com/rq/rq-scheduler")
4031 (source (origin
4032 (method git-fetch)
4033 (uri (git-reference
4034 (url home-page)
4035 (commit (string-append "v" version))))
4036 (file-name (git-file-name name version))
4037 (sha256
4038 (base32
4039 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
4040 (build-system python-build-system)
4041 (arguments
4042 '(#:phases (modify-phases %standard-phases
4043 (add-before 'check 'start-redis
4044 (lambda _
4045 (invoke "redis-server" "--daemonize" "yes")))
4046 (replace 'check
4047 (lambda _
4048 (substitute* "run_tests.py"
4049 (("/usr/bin/env")
4050 (which "env")))
4051 (invoke "./run_tests.py"))))))
4052 (native-inputs
8394619b 4053 (list redis which))
8a88efce 4054 (propagated-inputs
8394619b 4055 (list python-croniter python-rq))
8a88efce
MB
4056 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
4057 (description
4058 "This package provides job scheduling capabilities to @code{python-rq}
4059(Redis Queue).")
4060 (license license:expat)))
4061
a8714bf6
RW
4062(define-public python-trollius-redis
4063 (package
4064 (name "python-trollius-redis")
4065 (version "0.1.4")
4066 (source
4067 (origin
4068 (method url-fetch)
4069 (uri (pypi-uri "trollius_redis" version))
4070 (sha256
4071 (base32
4072 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
4073 (build-system python-build-system)
4074 ;; TODO: Tests require packaging 'hiredis'.
4075 (arguments '(#:tests? #f))
4076 (home-page "https://github.com/benjolitz/trollius-redis")
4077 (synopsis "Port of asyncio-redis to trollius")
4078 (description "@code{trollius-redis} is a Redis client for Python
d087a3a6 4079 trollius. It is an asynchronous IO (PEP 3156) implementation of the
a8714bf6
RW
4080 Redis protocol.")
4081 (license license:bsd-2)))
4082
a8714bf6
RW
4083(define-public python-sqlparse
4084 (package
4085 (name "python-sqlparse")
8d5bdb93 4086 (version "0.4.2")
a8714bf6
RW
4087 (source (origin
4088 (method url-fetch)
4089 (uri (pypi-uri "sqlparse" version))
4090 (sha256
4091 (base32
8d5bdb93 4092 "1bkx52c2jh28c528b69qfk2ijfzw1laxx6lim7jr8fi6fh67600c"))))
a8714bf6
RW
4093 (build-system python-build-system)
4094 (arguments
4095 `(#:phases
4096 (modify-phases %standard-phases
4097 (replace 'check
151f1720
MB
4098 (lambda _
4099 (invoke "py.test")))
4100 ;; XXX: The regular wrap phase ends up storing pytest as a runtime
4101 ;; dependency. See <https://bugs.gnu.org/25235>.
4102 (replace 'wrap
4103 (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
4104 (let* ((out (assoc-ref outputs "out"))
4105 (python (assoc-ref (or native-inputs inputs) "python"))
4106 (sitedir (string-append "/lib/python"
4107 (python-version python)
4108 "/site-packages")))
4109 (wrap-program (string-append out "/bin/sqlformat")
4110 `("PYTHONPATH" ":" prefix
4111 ,(map (lambda (output)
4112 (string-append output sitedir))
4113 (list python out))))))))))
a8714bf6 4114 (native-inputs
8394619b 4115 (list python-pytest))
a8714bf6
RW
4116 (home-page "https://github.com/andialbrecht/sqlparse")
4117 (synopsis "Non-validating SQL parser")
4118 (description "Sqlparse is a non-validating SQL parser for Python. It
4119provides support for parsing, splitting and formatting SQL statements.")
5b8af1a5
MB
4120 (license license:bsd-3)
4121 (properties '((cpe-name . "sqlparse")))))
a8714bf6 4122
a8714bf6
RW
4123(define-public python-sql
4124 (package
4125 (name "python-sql")
b7ef1e4e 4126 (version "1.3.0")
a8714bf6
RW
4127 (source
4128 (origin
4129 (method url-fetch)
4130 (uri (pypi-uri "python-sql" version))
4131 (sha256
b7ef1e4e 4132 (base32 "0xnimfzlxj1ddrb5xj3s4gaii278a0gpxrvwmdmrdxgjfdi3lq4x"))))
a8714bf6
RW
4133 (build-system python-build-system)
4134 (home-page "https://python-sql.tryton.org/")
4135 (synopsis "Library to write SQL queries in a pythonic way")
4136 (description "@code{python-sql} is a library to write SQL queries, that
4137transforms idiomatic python function calls to well-formed SQL queries.")
4138 (license license:bsd-3)))
4139
c8fdf86d
LDB
4140(define-public python-pypika
4141 (package
4142 (name "python-pypika")
f73ee73d 4143 (version "0.47.6")
c8fdf86d 4144 (source
510472f8
LDB
4145 (origin (method git-fetch)
4146 (uri (git-reference
b0e7b699 4147 (url "https://github.com/kayak/pypika")
510472f8
LDB
4148 (commit (string-append "v" version))))
4149 (file-name (git-file-name name version))
4150 (sha256
4151 (base32
f73ee73d 4152 "001pg36sw9a36zdd1kccbymcxndphjcjbbrsy6ri7ng8h4dgz549"))))
c8fdf86d
LDB
4153 (build-system python-build-system)
4154 (native-inputs
8394619b 4155 (list python-parameterized))
c8fdf86d
LDB
4156 (home-page "https://github.com/kayak/pypika")
4157 (synopsis "SQL query builder API for Python")
4158 (description
4159 "PyPika is a python SQL query builder that exposes the full richness of
4160the SQL language using a syntax that reflects the resulting query.")
4161 (license license:asl2.0)))
4162
a50628bb
KCB
4163;; There are many wrappers for this in other languages. When touching, please
4164;; be sure to ensure all dependencies continue to build.
dae7661a
LF
4165(define-public apache-arrow
4166 (package
4167 (name "apache-arrow")
e5e5b2a1 4168 (version "9.0.0")
dae7661a 4169 (source
a50628bb
KCB
4170 (origin
4171 (method git-fetch)
4172 (uri (git-reference
4173 (url "https://github.com/apache/arrow")
4174 (commit (string-append "apache-arrow-" version))))
4175 (file-name (git-file-name name version))
4176 (sha256
4177 (base32
e5e5b2a1 4178 "1l76q7944jyx22vjkk12hxb3nadgiivc3x8ml4mg619v9xxagc2v"))))
dae7661a
LF
4179 (build-system cmake-build-system)
4180 (arguments
4181 `(#:tests? #f
4182 #:phases
4183 (modify-phases %standard-phases
4184 (add-before 'configure 'enter-source-directory
bf0f9dd0 4185 (lambda _ (chdir "cpp")))
dae7661a
LF
4186 (add-after 'unpack 'set-env
4187 (lambda _
bf0f9dd0
RW
4188 (substitute* "cpp/cmake_modules/ThirdpartyToolchain.cmake"
4189 (("set\\(xsimd_SOURCE.*") ""))
dae7661a
LF
4190 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
4191 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
4192 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
bf0f9dd0 4193 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson")))))
3def739d 4194 #:build-type "Release"
dae7661a 4195 #:configure-flags
3def739d 4196 (list "-DARROW_PYTHON=ON"
a50628bb
KCB
4197 "-DARROW_GLOG=ON"
4198 ;; Parquet options
4199 "-DARROW_PARQUET=ON"
4200 "-DPARQUET_BUILD_EXECUTABLES=ON"
4201 ;; The maintainers disallow using system versions of
4202 ;; jemalloc:
4203 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
4204 ;; is unfortunate because jemalloc increases performance:
4205 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
4206 "-DARROW_JEMALLOC=OFF"
4207
4208 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
4209 ;; option that instructs the build system how to resolve
4210 ;; each dependency. SYSTEM = Finding the dependency in
4211 ;; system paths using CMake's built-in find_package
4212 ;; function, or using pkg-config for packages that do not
4213 ;; have this feature
4214 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
bf0f9dd0 4215 "-Dxsimd_SOURCE=SYSTEM"
a50628bb 4216
b60089e8
RW
4217 "-DARROW_RUNTIME_SIMD_LEVEL=NONE"
4218 "-DARROW_SIMD_LEVEL=NONE"
4219 "-DARROW_PACKAGE_KIND=Guix"
4220
a50628bb
KCB
4221 ;; Split output into its component packages.
4222 (string-append "-DCMAKE_INSTALL_PREFIX="
4223 (assoc-ref %outputs "lib"))
4224 (string-append "-DCMAKE_INSTALL_RPATH="
4225 (assoc-ref %outputs "lib")
dae7661a 4226 "/lib")
a50628bb
KCB
4227 (string-append "-DCMAKE_INSTALL_BINDIR="
4228 (assoc-ref %outputs "out")
4229 "/bin")
4230 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
4231 (assoc-ref %outputs "include")
4232 "/share/include")
4233
4234
4235 "-DARROW_WITH_SNAPPY=ON"
4236 "-DARROW_WITH_ZLIB=ON"
4237 "-DARROW_WITH_ZSTD=ON"
4238 "-DARROW_WITH_LZ4=ON"
4239 "-DARROW_COMPUTE=ON"
4240 "-DARROW_CSV=ON"
4241 "-DARROW_DATASET=ON"
4242 "-DARROW_FILESYSTEM=ON"
4243 "-DARROW_HDFS=ON"
4244 "-DARROW_JSON=ON"
4245 ;; Arrow Python C++ integration library (required for
4246 ;; building pyarrow). This library must be built against
4247 ;; the same Python version for which you are building
4248 ;; pyarrow. NumPy must also be installed. Enabling this
4249 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
4250 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
4251 ;; ARROW_JSON.
4252 "-DARROW_PYTHON=ON"
dae7661a
LF
4253
4254 ;; Building the tests forces on all the
4255 ;; optional features and the use of static
4256 ;; libraries.
4257 "-DARROW_BUILD_TESTS=OFF"
a50628bb
KCB
4258 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
4259 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
dae7661a
LF
4260 "-DARROW_BUILD_STATIC=OFF")))
4261 (inputs
b60089e8 4262 `(("boost" ,boost)
28b5ef11 4263 ("brotli" ,brotli)
23af76f1 4264 ("bzip2" ,bzip2)
a50628bb 4265 ("double-conversion" ,double-conversion)
a50628bb
KCB
4266 ("gflags" ,gflags)
4267 ("glog" ,glog)
23af76f1 4268 ("grpc" ,grpc)
a50628bb 4269 ("protobuf" ,protobuf)
23af76f1
GH
4270 ("python-3" ,python)
4271 ("python-numpy" ,python-numpy)
a50628bb 4272 ("rapidjson" ,rapidjson)
a50628bb 4273 ("re2" ,re2)
23af76f1 4274 ("snappy" ,snappy)
b60089e8
RW
4275 ("xsimd" ,xsimd)))
4276 ;; These are all listed under Requires.private in arrow.pc
4277 (propagated-inputs
8394619b
LC
4278 (list `(,apache-thrift "lib") lz4 utf8proc zlib
4279 `(,zstd "lib")))
a50628bb 4280 (native-inputs
8394619b 4281 (list pkg-config))
a50628bb 4282 (outputs '("out" "lib" "include"))
dae7661a
LF
4283 (home-page "https://arrow.apache.org/")
4284 (synopsis "Columnar in-memory analytics")
4285 (description "Apache Arrow is a columnar in-memory analytics layer
a50628bb 4286designed to accelerate big data. It houses a set of canonical in-memory
dae7661a 4287representations of flat and hierarchical data along with multiple
a50628bb 4288language-bindings for structure manipulation. It also provides IPC and common
dae7661a
LF
4289algorithm implementations.")
4290 (license license:asl2.0)))
5e5ac710 4291
c8727617
RW
4292(define-public apache-arrow-0.16
4293 (package
4294 (name "apache-arrow")
4295 (version "0.16.0")
4296 (source
4297 (origin
4298 (method git-fetch)
4299 (uri (git-reference
4300 (url "https://github.com/apache/arrow")
4301 (commit (string-append "apache-arrow-" version))))
4302 (file-name (git-file-name name version))
4303 (sha256
4304 (base32
4305 "15bplqy5708bxy1mynzjkd3d2g8v2wd36z8l0ap8yyyq54l3gdvy"))))
4306 (build-system cmake-build-system)
4307 (arguments
4308 `(#:tests? #f
4309 #:phases
4310 (modify-phases %standard-phases
4311 (add-before 'configure 'enter-source-directory
4312 (lambda _
4313 (chdir "cpp")
4314 (substitute* "src/parquet/CMakeLists.txt"
4315 ((" parquet_constants.cpp") "")
4316 (("set\\(THRIFT_OUTPUT_FILES \\$\\{THRIFT_OUTPUT_FILES\\}.*") "")
4317 ((".*\"\\$\\{THRIFT_OUTPUT_DIR\\}/parquet_constants.cpp\"\\).*") ""))))
4318 (add-after 'unpack 'set-env
4319 (lambda _
4320 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
4321 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
4322 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
4323 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson")))))
4324 #:build-type "Release"
4325 #:configure-flags
4326 (list "-DARROW_PYTHON=ON"
4327 "-DARROW_GLOG=ON"
4328 "-DARROW_SSE42=OFF"
4329 "-DARROW_BOOST_USE_SHARED=ON"
4330 ;; Parquet options
4331 "-DARROW_PARQUET=ON"
4332
4333 ;; The maintainers disallow using system versions of
4334 ;; jemalloc:
4335 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
4336 ;; is unfortunate because jemalloc increases performance:
4337 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
4338 "-DARROW_JEMALLOC=OFF"
4339
4340 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
4341 ;; option that instructs the build system how to resolve
4342 ;; each dependency. SYSTEM = Finding the dependency in
4343 ;; system paths using CMake's built-in find_package
4344 ;; function, or using pkg-config for packages that do not
4345 ;; have this feature
4346 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
4347
4348 ;; Split output into its component packages.
4349 (string-append "-DCMAKE_INSTALL_PREFIX="
4350 (assoc-ref %outputs "out"))
4351 (string-append "-DCMAKE_INSTALL_RPATH="
4352 (assoc-ref %outputs "out")
4353 "/lib")
4354 (string-append "-DCMAKE_INSTALL_BINDIR="
4355 (assoc-ref %outputs "out")
4356 "/bin")
4357 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
4358 (assoc-ref %outputs "include")
4359 "/share/include")
4360
4361
4362 "-DARROW_WITH_SNAPPY=ON"
4363 "-DARROW_WITH_ZLIB=ON"
4364 "-DARROW_WITH_ZSTD=ON"
4365 "-DARROW_WITH_LZ4=ON"
4366 "-DARROW_COMPUTE=ON"
4367 "-DARROW_CSV=ON"
4368 "-DARROW_DATASET=ON"
4369 "-DARROW_FILESYSTEM=ON"
4370 "-DARROW_HDFS=ON"
4371 "-DARROW_JSON=ON"
4372 ;; Arrow Python C++ integration library (required for
4373 ;; building pyarrow). This library must be built against
4374 ;; the same Python version for which you are building
4375 ;; pyarrow. NumPy must also be installed. Enabling this
4376 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
4377 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
4378 ;; ARROW_JSON.
4379 "-DARROW_PYTHON=ON"
4380
4381 ;; Building the tests forces on all the
4382 ;; optional features and the use of static
4383 ;; libraries.
4384 "-DARROW_BUILD_TESTS=OFF"
4385 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
4386 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
4387 "-DARROW_BUILD_STATIC=OFF")))
4388 (inputs
4389 `(("boost" ,boost)
4390 ("brotli" ,google-brotli)
4391 ("double-conversion" ,double-conversion)
4392 ("snappy" ,snappy)
4393 ("gflags" ,gflags)
4394 ("glog" ,glog)
4395 ("apache-thrift" ,apache-thrift "lib")
4396 ("protobuf" ,protobuf)
4397 ("rapidjson" ,rapidjson)
4398 ("zlib" ,zlib)
4399 ("bzip2" ,bzip2)
4400 ("lz4" ,lz4)
4401 ("zstd" ,zstd "lib")
4402 ("re2" ,re2)
4403 ("grpc" ,grpc)
4404 ("python-3" ,python)
4405 ("python-numpy" ,python-numpy)))
4406 (native-inputs
4407 (list pkg-config apache-thrift))
4408 (outputs '("out" "include"))
4409 (home-page "https://arrow.apache.org/")
4410 (synopsis "Columnar in-memory analytics")
4411 (description "Apache Arrow is a columnar in-memory analytics layer
4412designed to accelerate big data. It houses a set of canonical in-memory
4413representations of flat and hierarchical data along with multiple
4414language-bindings for structure manipulation. It also provides IPC and common
4415algorithm implementations.")
4416 (license license:asl2.0)))
4417
5e5ac710
LF
4418(define-public python-pyarrow
4419 (package
a50628bb 4420 (inherit apache-arrow)
5e5ac710 4421 (name "python-pyarrow")
5e5ac710
LF
4422 (build-system python-build-system)
4423 (arguments
a50628bb 4424 '(#:tests? #f ; XXX There are no tests in the "python" directory
5e5ac710
LF
4425 #:phases
4426 (modify-phases %standard-phases
0fa926c2 4427 (delete 'build) ; XXX the build is performed again during the install phase
5e5ac710 4428 (add-after 'unpack 'enter-source-directory
532cfc5b 4429 (lambda _ (chdir "python")))
a50628bb 4430 (add-after 'unpack 'make-git-checkout-writable
5e5ac710 4431 (lambda _
532cfc5b
RW
4432 (for-each make-file-writable (find-files "."))))
4433 (add-before 'install 'patch-cmake-variables
4434 (lambda* (#:key inputs #:allow-other-keys)
4435 ;; Replace cmake locations with hardcoded guix links for the
4436 ;; underlying C++ library and headers. This is a pretty awful
4437 ;; hack.
4438 (substitute* "cmake_modules/FindParquet.cmake"
4439 (("# Licensed to the Apache Software Foundation" m)
4440 (string-append "set(PARQUET_INCLUDE_DIR \""
4441 (assoc-ref inputs "apache-arrow:include")
4442 "/share/include\")\n" m))
4443 (("find_package_handle_standard_args" m)
4444 (string-append "set(PARQUET_LIB_DIR \""
4445 (assoc-ref inputs "apache-arrow:lib")
4446 "/lib\")\n" m)))))
4447 (add-before 'install 'patch-parquet-library
4448 (lambda _
4449 (substitute* "CMakeLists.txt"
4450 (("parquet_shared") "parquet"))))
4451 (add-before 'install 'set-PYARROW_WITH_PARQUET
4452 (lambda _
4453 (setenv "PYARROW_WITH_PARQUET" "1"))))))
5e5ac710 4454 (propagated-inputs
532cfc5b
RW
4455 `(("apache-arrow:lib" ,apache-arrow "lib")
4456 ("apache-arrow:include" ,apache-arrow "include")
5e5ac710
LF
4457 ("python-numpy" ,python-numpy)
4458 ("python-pandas" ,python-pandas)
4459 ("python-six" ,python-six)))
4460 (native-inputs
c69959f0 4461 `(("cmake" ,cmake-minimal)
a50628bb 4462 ("pkg-config" ,pkg-config)
5e5ac710
LF
4463 ("python-cython" ,python-cython)
4464 ("python-pytest" ,python-pytest)
0fa926c2 4465 ("python-pytest-runner" ,python-pytest-runner)
5e5ac710 4466 ("python-setuptools-scm" ,python-setuptools-scm)))
a50628bb 4467 (outputs '("out"))
5e5ac710
LF
4468 (home-page "https://arrow.apache.org/docs/python/")
4469 (synopsis "Python bindings for Apache Arrow")
a50628bb
KCB
4470 (description
4471 "This library provides a Pythonic API wrapper for the reference Arrow C++
a3613f11
RW
4472implementation, along with tools for interoperability with pandas, NumPy, and
4473other traditional Python scientific computing packages.")
4474 (license license:asl2.0)))
4475
4476(define-public python-pyarrow-0.16
4477 (package
4478 (inherit apache-arrow-0.16)
4479 (name "python-pyarrow")
4480 (build-system python-build-system)
4481 (arguments
4482 '(#:tests? #f ; XXX There are no tests in the "python" directory
4483 #:phases
4484 (modify-phases %standard-phases
4485 (delete 'build) ; XXX the build is performed again during the install phase
4486 (add-after 'unpack 'enter-source-directory
4487 (lambda _ (chdir "python")))
4488 (add-after 'unpack 'make-git-checkout-writable
4489 (lambda _
4490 (for-each make-file-writable (find-files "."))))
4491 (add-before 'install 'patch-cmake-variables
4492 (lambda* (#:key inputs #:allow-other-keys)
4493 ;; Replace cmake locations with hardcoded guix links for the
4494 ;; underlying C++ library and headers. This is a pretty awful
4495 ;; hack.
4496 (substitute* "cmake_modules/FindParquet.cmake"
4497 (("# Licensed to the Apache Software Foundation" m)
4498 (string-append "set(PARQUET_INCLUDE_DIR \""
4499 (assoc-ref inputs "apache-arrow:include")
4500 "/share/include\")\n" m))
4501 (("find_package_handle_standard_args" m)
4502 (string-append "set(PARQUET_LIB_DIR \""
4503 (assoc-ref inputs "apache-arrow:lib")
4504 "/lib\")\n" m)))))
4505 (add-before 'install 'patch-parquet-library
4506 (lambda _
4507 (substitute* "CMakeLists.txt"
4508 (("parquet_shared") "parquet"))))
4509 (add-before 'install 'set-PYARROW_WITH_PARQUET
4510 (lambda _
4511 (setenv "PYARROW_WITH_PARQUET" "1"))))))
4512 (propagated-inputs
4513 `(("apache-arrow:lib" ,apache-arrow-0.16)
4514 ("apache-arrow:include" ,apache-arrow-0.16 "include")
4515 ("python-numpy" ,python-numpy)
4516 ("python-pandas" ,python-pandas)
4517 ("python-six" ,python-six)))
4518 (native-inputs
4519 (list cmake-minimal
4520 pkg-config
4521 python-cython
4522 python-pytest
4523 python-pytest-runner
4524 python-setuptools-scm))
4525 (outputs '("out"))
4526 (home-page "https://arrow.apache.org/docs/python/")
4527 (synopsis "Python bindings for Apache Arrow")
4528 (description
4529 "This library provides a Pythonic API wrapper for the reference Arrow C++
a50628bb
KCB
4530implementation, along with tools for interoperability with pandas, NumPy, and
4531other traditional Python scientific computing packages.")
5e5ac710
LF
4532 (license license:asl2.0)))
4533
450d5dc2
PL
4534(define-public python-crate
4535 (package
4536 (name "python-crate")
19181820 4537 (version "0.23.2")
450d5dc2
PL
4538 (source (origin
4539 (method url-fetch)
4540 (uri (pypi-uri "crate" version))
4541 (sha256
4542 (base32
19181820 4543 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx"))))
450d5dc2
PL
4544 (build-system python-build-system)
4545 (propagated-inputs
8394619b 4546 (list python-urllib3))
450d5dc2
PL
4547 (home-page "https://github.com/crate/crate-python")
4548 (synopsis "CrateDB Python client")
4549 (description
4550 "This package provides a Python client library for CrateDB.
4551It implements the Python DB API 2.0 specification and includes support for
4552SQLAlchemy.")
4553 (license license:asl2.0)))
ae8a0184
GLV
4554
4555(define-public libdbi
4556 (package
4557 (name "libdbi")
4558 (version "0.9.0")
4559 (source (origin
4560 (method url-fetch)
4561 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
4562 version "/libdbi-" version ".tar.gz"))
4563 (sha256
4564 (base32
4565 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
4566 (build-system gnu-build-system)
4567 (synopsis "Database independent abstraction layer in C")
4568 (description
4569 "This library implements a database independent abstraction layer in C,
4570similar to the DBI/DBD layer in Perl. Writing one generic set of code,
4571programmers can leverage the power of multiple databases and multiple
4572simultaneous database connections by using this framework.")
4573 (home-page "http://libdbi.sourceforge.net/")
4574 (license license:lgpl2.1+)))
df81de86
GLV
4575
4576(define-public libdbi-drivers
4577 (package
4578 (name "libdbi-drivers")
4579 (version "0.9.0")
4580 (source (origin
4581 (method url-fetch)
4582 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
4583 "libdbi-drivers/libdbi-drivers-" version
4584 "/libdbi-drivers-" version ".tar.gz"))
4585 (sha256
4586 (base32
4587 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
4588 (build-system gnu-build-system)
4589 (native-inputs
8394619b
LC
4590 (list ;; For tests.
4591 inetutils glibc-locales mariadb))
df81de86
GLV
4592 (inputs
4593 `(("libdbi" ,libdbi)
9077cf68
MB
4594 ("mariadb:dev" ,mariadb "dev")
4595 ("mariadb:lib" ,mariadb "lib")
df81de86
GLV
4596 ("postgresql" ,postgresql)
4597 ("sqlite" ,sqlite)))
4598 (arguments
4599 `(#:configure-flags
4600 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
9077cf68
MB
4601 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
4602 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
df81de86
GLV
4603 (postgresql (assoc-ref %build-inputs "postgresql"))
4604 (sqlite (assoc-ref %build-inputs "sqlite")))
4605 (list "--disable-docs"
4606 (string-append "--with-dbi-incdir=" libdbi "/include")
4607 (string-append "--with-dbi-libdir=" libdbi "/lib")
4608 "--with-mysql"
9077cf68
MB
4609 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
4610 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
df81de86
GLV
4611 "--with-pgsql"
4612 (string-append "--with-pgsql-incdir=" postgresql "/include")
4613 (string-append "--with-pgsql-libdir=" postgresql "/lib")
4614 "--with-sqlite3"
4615 (string-append "--with-sqlite-incdir=" sqlite "/include")
4616 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
4e902da6 4617 #:tests? #f ; FIXME: Find why the tests get stuck forever.
df81de86
GLV
4618 #:phases
4619 (modify-phases %standard-phases
4620 (add-after 'unpack 'fix-tests
4621 (lambda* (#:key inputs #:allow-other-keys)
4622 (substitute* "tests/test_mysql.sh"
4623 (("^MYMYSQLD=.*")
4624 (string-append "MYMYSQLD="
9077cf68 4625 (assoc-ref inputs "mariadb")
df81de86
GLV
4626 "/bin/mysqld")))
4627 #t))
4628 (add-after 'install 'remove-empty-directories
4629 (lambda* (#:key outputs #:allow-other-keys)
4630 (let ((var (string-append (assoc-ref outputs "out") "/var")))
4631 (delete-file-recursively var))
4632 #t)))))
4633 (synopsis "Database drivers for the libdbi framework")
4634 (description
4635 "The @code{libdbi-drivers} library provides the database specific drivers
4636for the @code{libdbi} framework.
4637
4638The drivers officially supported by @code{libdbi} are:
4639@itemize
4640@item MySQL,
4641@item PostgreSQL,
4642@item SQLite.
4643@end itemize")
4644 (home-page "http://libdbi-drivers.sourceforge.net/")
4645 (license license:lgpl2.1+)))
6d26ee3b
PN
4646
4647(define-public soci
4648 (package
4649 (name "soci")
1ba3df18 4650 (version "4.0.2")
6d26ee3b
PN
4651 (source (origin
4652 (method git-fetch)
4653 (uri (git-reference
4654 (url "https://github.com/SOCI/soci/")
1ba3df18 4655 (commit (string-append "v" version))))
6d26ee3b
PN
4656 (file-name (git-file-name name version))
4657 (sha256
4658 (base32
1ba3df18 4659 "0qc6d71lyrfh5zb7pmfihd1hjyazlkgq6p0g06ans77wnnjh0k9l"))))
6d26ee3b 4660 (build-system cmake-build-system)
ac6e19b0
RG
4661 (propagated-inputs
4662 ;; Headers of soci has include-references to headers of these inputs.
691c4185
TGR
4663 `(("firebird" ,firebird)
4664 ("postgresql" ,postgresql)
6d26ee3b
PN
4665 ("sqlite" ,sqlite)
4666 ("odbc" ,unixodbc)
4667 ("boost" ,boost)
997abda9 4668 ("mariadb:dev" ,mariadb "dev")))
6d26ee3b 4669 (arguments
d8fe4554
TGR
4670 `(#:configure-flags
4671 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it.
28da3c19
TGR
4672 (list "-DCMAKE_CXX_STANDARD=17"
4673 "-DSOCI_LIBDIR=lib")
4674 #:tests? #f)) ; may require running database management systems
6d26ee3b
PN
4675 (synopsis "C++ Database Access Library")
4676 (description
4677 "SOCI is an abstraction layer for several database backends, including
4678PostreSQL, SQLite, ODBC and MySQL.")
4679 (home-page "http://soci.sourceforge.net/")
4680 (license license:boost1.0)))
0c0a2831
SH
4681
4682(define-public freetds
4683 (package
4684 (name "freetds")
bf5f7585 4685 (version "1.2.20")
0c0a2831
SH
4686 (source
4687 (origin
4688 (method url-fetch)
4689 (uri (string-append "https://www.freetds.org/files/stable/"
4690 "freetds-" version ".tar.gz"))
4691 (sha256
bf5f7585 4692 (base32 "11fzwcahc1bc8npxbif0448v9cwyf7k04167i7fcspmfw7a0hj0d"))))
0c0a2831
SH
4693 (build-system gnu-build-system)
4694 (arguments
4695 ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection,
4696 ;; disabled for now.
4697 `(#:tests? #f))
4698 (home-page "https://www.freetds.org/")
4699 (synopsis "Client libraries for MS SQL and Sybase servers")
4700 (description
4701 "FreeTDS is an implementation of the Tabular DataStream protocol, used for
4702connecting to MS SQL and Sybase servers over TCP/IP.")
4703 (license license:lgpl2.0+)))
b8e7b284 4704
3091ca3e 4705(define-public python-tinydb
4706 (package
4707 (name "python-tinydb")
4708 (version "4.5.2")
4709 (source (origin
4710 (method url-fetch)
4711 (uri (pypi-uri "tinydb" version))
4712 (sha256
4713 (base32 "1x9c4s42930wwal3ds0plwb57kg5c3gj7kbpy64c29vq478b463x"))))
4714 (build-system python-build-system)
4715 ;; PyPi tarball does not contain tests and github repository does not
4716 ;; have a setup.py file (only pyproject).
4717 (arguments `(#:tests? #f))
4718 (propagated-inputs
8394619b 4719 (list python-typing-extensions))
3091ca3e 4720 (home-page "https://github.com/msiemens/tinydb")
4721 (synopsis "TinyDB is a lightweight document oriented database")
4722 (description
4723 "TinyDB is a small document oriented database written in pure Python
4724with no external dependencies. The targets are small apps that would
4725be blown away by a SQL-DB or an external database server.")
4726 (license license:expat)))
4727
b8e7b284
AHA
4728(define-public sequeler
4729 (package
4730 (name "sequeler")
b9af3a6e 4731 (version "0.8.2")
b8e7b284
AHA
4732 (source (origin
4733 (method git-fetch)
4734 (uri (git-reference
4735 (url "https://github.com/Alecaddd/sequeler")
4736 (commit (string-append "v" version))))
4737 (file-name (git-file-name name version))
4738 (sha256
4739 (base32
b9af3a6e 4740 "0biggmsn8k7j6pdrwk29whl56qlfgvf5d9vjpgz4nyqih56wgh9j"))))
b8e7b284
AHA
4741 (build-system meson-build-system)
4742 (arguments
4743 '(#:glib-or-gtk? #t
4744 #:phases
4745 (modify-phases %standard-phases
4746 (add-after 'unpack 'skip-gtk-update-icon-cache
4747 ;; Don't create 'icon-theme.cache'.
4748 (lambda _
4749 (substitute* "build-aux/meson_post_install.py"
4750 (("gtk-update-icon-cache") "true")
b9af3a6e 4751 (("update-desktop-database") "true")))))))
b8e7b284
AHA
4752 (native-inputs
4753 `(;("appstream-glib" ,appstream-glib) ; validation fails for lack of network
4754 ("gettext-minimal" ,gettext-minimal)
4755 ("glib:bin" ,glib "bin") ; for glib-compile-resources
4756 ("gtk+" ,gtk+ "bin")
4757 ("pkg-config" ,pkg-config)
4758 ("vala" ,vala)))
4759 (inputs
4760 `(("glib" ,glib)
4761 ("granite" ,granite)
4762 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
4763 ("gtk+" ,gtk+)
4764 ("gtksourceview-3" ,gtksourceview-3)
4765 ("libgda" ,libgda)
4766 ("libgee" ,libgee)
4767 ("libsecret" ,libsecret)
4768 ("libssh2" ,libssh2)
4769 ("libxml2" ,libxml2)))
4770 (synopsis "Friendly SQL Client")
4771 (description "Sequeler is a native Linux SQL client built in Vala and
4772Gtk. It allows you to connect to your local and remote databases, write SQL in
4773a handy text editor with language recognition, and visualize SELECT results in
4774a Gtk.Grid Widget.")
4775 (home-page "https://github.com/Alecaddd/sequeler")
4776 (license license:gpl2+)))
9183b814
ZZ
4777
4778(define-public sqlitebrowser
4779 (package
4780 (name "sqlitebrowser")
4781 (version "3.12.2")
4782 (source
4783 (origin
4784 (method git-fetch)
4785 (uri (git-reference
4786 (url "https://github.com/sqlitebrowser/sqlitebrowser")
4787 (commit (string-append "v" version))))
1898b838 4788 (file-name (git-file-name name version))
9183b814
ZZ
4789 (sha256
4790 (base32 "1ljqzcx388mmni8lv9jz5r58alhsjrrqi4nzjnbfki94rn4ray6z"))
1898b838
EF
4791 (modules '((guix build utils)))
4792 (snippet
4793 '(begin
4794 (delete-file-recursively "libs/qcustomplot-source/")
3ece5dbc 4795 (delete-file-recursively "libs/qhexedit/")
1898b838 4796 (delete-file-recursively "libs/qscintilla")))))
9183b814
ZZ
4797 (build-system qt-build-system)
4798 (arguments
3d8ee86a 4799 (list #:configure-flags
3ece5dbc 4800 ;; TODO: Unbundle json (json-modern-cxx).
1898b838
EF
4801 #~(list (string-append "-DQSCINTILLA_INCLUDE_DIR="
4802 #$(this-package-input "qscintilla")
4803 "/include/Qsci")
3d8ee86a 4804 "-DFORCE_INTERNAL_QCUSTOMPLOT=OFF"
3ece5dbc 4805 "-DFORCE_INTERNAL_QHEXEDIT=OFF"
3d8ee86a 4806 "-DENABLE_TESTING=ON")))
9183b814
ZZ
4807 (inputs
4808 (list qcustomplot
3ece5dbc 4809 qhexedit
1898b838 4810 qscintilla
9183b814
ZZ
4811 qtbase-5
4812 sqlite))
eef8e2ec 4813 (native-inputs (list qttools-5))
9183b814 4814 (home-page "https://sqlitebrowser.org/")
078d880f
TGR
4815 (synopsis "Visual database browser and editor for SQLite")
4816 (description "Sqlitebrowser lets you create, design, and edit database files
4817compatible with SQLite using a graphical user interface.")
9183b814
ZZ
4818 (license
4819 ;; dual license
4820 (list license:gpl3+
4821 license:mpl2.0))))
cec5a522 4822
4823(define-public sqls
4824 (package
4825 (name "sqls")
4826 (version "0.2.18")
4827 (home-page "https://github.com/lighttiger2505/sqls")
4828 (source (origin
4829 (method git-fetch)
4830 (uri (git-reference
4831 (url home-page)
4832 (commit (string-append "v" version))))
4833 (file-name (git-file-name name version))
4834 (sha256
4835 (base32
4836 "13837v27avdp2nls3vyy7ml12nj7rxragchwf92adn10ffp4aj6c"))))
4837 (build-system go-build-system)
4838 (arguments
4839 '(#:import-path "github.com/lighttiger2505/sqls"))
4840 (inputs (list go-github-com-go-sql-driver-mysql
4841 go-github-com-lib-pq
4842 go-github-com-mattn-go-sqlite3
4843 go-github-com-olekukonko-tablewriter
4844 go-github-com-pkg-errors
4845 go-github-com-sourcegraph-jsonrpc2
4846 go-golang-org-x-crypto
4847 go-github.com-mattn-go-runewidth
4848 go-golang-org-x-xerrors
4849 go-gopkg-in-yaml-v2))
4850 (synopsis "SQL language server written in Go")
4851 (description
4852 "This package implements the @acronym{LSP, Language Server Protocol} for SQL.")
4853 (license license:expat)))
59625e3c
HG
4854
4855(define-public python-dogpile.cache
4856 (package
4857 (name "python-dogpile.cache")
4858 (version "1.1.8")
4859 (source (origin
4860 (method url-fetch)
4861 (uri (pypi-uri "dogpile.cache" version))
4862 (sha256
4863 (base32
4864 "0kpx42vxzss4sz5ic6mp01a97zinzm6q76n8li2gbi4ccfxyhi6q"))))
4865 (build-system python-build-system)
4866 (arguments
4867 '(#:phases
4868 (modify-phases %standard-phases
4869 (replace 'check
4870 (lambda* (#:key tests? #:allow-other-keys)
4871 (when tests?
4872 (invoke "pytest")))))))
4873 (native-inputs (list python-mako python-pytest))
4874 (propagated-inputs (list python-decorator python-stevedore))
4875 (home-page "https://github.com/sqlalchemy/dogpile.cache")
4876 (synopsis "Caching front-end based on the Dogpile lock")
4877 (description "@code{dogpile.cache} is a caching API which provides a
4878generic interface to caching backends of any variety, and additionally
4879provides API hooks which integrate these cache backends with the locking
4880mechanism of @code{dogpile}.")
4881 (license license:expat)))