Merge branch 'staging'
[jackhill/guix/guix.git] / gnu / packages / databases.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
11 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
14 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
15 ;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
18 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
19 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
20 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
21 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
22 ;;; Copyright © 2017, 2020 Thomas Danckaert <post@thomasdanckaert.be>
23 ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
24 ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
25 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
26 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
27 ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
28 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
29 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
30 ;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
31 ;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
32 ;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
33 ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
34 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
35 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
36 ;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
37 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
38 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
39 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
40 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
41 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
42 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
43 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
44 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
45 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
46 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
47 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
48 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
49 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
50 ;;;
51 ;;; This file is part of GNU Guix.
52 ;;;
53 ;;; GNU Guix is free software; you can redistribute it and/or modify it
54 ;;; under the terms of the GNU General Public License as published by
55 ;;; the Free Software Foundation; either version 3 of the License, or (at
56 ;;; your option) any later version.
57 ;;;
58 ;;; GNU Guix is distributed in the hope that it will be useful, but
59 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
60 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 ;;; GNU General Public License for more details.
62 ;;;
63 ;;; You should have received a copy of the GNU General Public License
64 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
65
66 (define-module (gnu packages databases)
67 #:use-module (gnu packages)
68 #:use-module (gnu packages admin)
69 #:use-module (gnu packages algebra)
70 #:use-module (gnu packages autotools)
71 #:use-module (gnu packages avahi)
72 #:use-module (gnu packages base)
73 #:use-module (gnu packages bash)
74 #:use-module (gnu packages bison)
75 #:use-module (gnu packages boost)
76 #:use-module (gnu packages check)
77 #:use-module (gnu packages cmake)
78 #:use-module (gnu packages compression)
79 #:use-module (gnu packages crypto)
80 #:use-module (gnu packages curl)
81 #:use-module (gnu packages cyrus-sasl)
82 #:use-module (gnu packages dbm)
83 #:use-module (gnu packages emacs)
84 #:use-module (gnu packages flex)
85 #:use-module (gnu packages gcc)
86 #:use-module (gnu packages gettext)
87 #:use-module (gnu packages glib)
88 #:use-module (gnu packages gnupg)
89 #:use-module (gnu packages golang)
90 #:use-module (gnu packages guile)
91 #:use-module (gnu packages icu4c)
92 #:use-module (gnu packages jemalloc)
93 #:use-module (gnu packages language)
94 #:use-module (gnu packages libedit)
95 #:use-module (gnu packages libevent)
96 #:use-module (gnu packages linux)
97 #:use-module (gnu packages lisp)
98 #:use-module (gnu packages lisp-xyz)
99 #:use-module (gnu packages logging)
100 #:use-module (gnu packages man)
101 #:use-module (gnu packages maths)
102 #:use-module (gnu packages multiprecision)
103 #:use-module (gnu packages ncurses)
104 #:use-module (gnu packages onc-rpc)
105 #:use-module (gnu packages parallel)
106 #:use-module (gnu packages pcre)
107 #:use-module (gnu packages perl)
108 #:use-module (gnu packages perl-check)
109 #:use-module (gnu packages perl-web)
110 #:use-module (gnu packages pkg-config)
111 #:use-module (gnu packages popt)
112 #:use-module (gnu packages protobuf)
113 #:use-module (gnu packages python)
114 #:use-module (gnu packages python-crypto)
115 #:use-module (gnu packages python-science)
116 #:use-module (gnu packages python-web)
117 #:use-module (gnu packages python-xyz)
118 #:use-module (gnu packages rdf)
119 #:use-module (gnu packages readline)
120 #:use-module (gnu packages regex)
121 #:use-module (gnu packages rpc)
122 #:use-module (gnu packages ruby)
123 #:use-module (gnu packages serialization)
124 #:use-module (gnu packages sphinx)
125 #:use-module (gnu packages sqlite)
126 #:use-module (gnu packages tcl)
127 #:use-module (gnu packages terminals)
128 #:use-module (gnu packages textutils)
129 #:use-module (gnu packages time)
130 #:use-module (gnu packages tls)
131 #:use-module (gnu packages valgrind)
132 #:use-module (gnu packages web)
133 #:use-module (gnu packages xml)
134 #:use-module ((guix licenses) #:prefix license:)
135 #:use-module (guix packages)
136 #:use-module (guix download)
137 #:use-module (guix bzr-download)
138 #:use-module (guix git-download)
139 #:use-module (guix hg-download)
140 #:use-module (guix build-system emacs)
141 #:use-module (guix build-system gnu)
142 #:use-module (guix build-system go)
143 #:use-module (guix build-system perl)
144 #:use-module (guix build-system python)
145 #:use-module (guix build-system ruby)
146 #:use-module (guix build-system cmake)
147 #:use-module (guix build-system scons)
148 #:use-module (guix build-system trivial)
149 #:use-module (guix utils)
150 #:use-module (srfi srfi-1)
151 #:use-module (srfi srfi-26)
152 #:use-module (ice-9 match))
153
154 (define-public 4store
155 (package
156 (name "4store")
157 (version "1.1.6")
158 (source (origin
159 (method git-fetch)
160 (uri (git-reference
161 (url "https://github.com/4store/4store")
162 (commit (string-append "v" version))))
163 (file-name (git-file-name name version))
164 (sha256
165 (base32 "1kzdfmwpzy64cgqlkcz5v4klwx99w0jk7afckyf7yqbqb4rydmpk"))
166 (patches (search-patches "4store-unset-preprocessor-directive.patch"
167 "4store-fix-buildsystem.patch"))))
168 (build-system gnu-build-system)
169 (native-inputs
170 `(("perl" ,perl)
171 ("python" ,python-2)
172 ("autoconf" ,autoconf)
173 ("automake" ,automake)
174 ("gettext" ,gettext-minimal)
175 ("libtool" ,libtool)
176 ("pcre" ,pcre "bin") ;for 'pcre-config'
177 ("pkg-config" ,pkg-config)))
178 (inputs
179 `(("glib" ,glib)
180 ("rasqal" ,rasqal)
181 ("libxml2" ,libxml2)
182 ("raptor2" ,raptor2)
183 ("readline" ,readline)
184 ("avahi" ,avahi)
185 ("cyrus-sasl" ,cyrus-sasl)
186 ("openssl" ,openssl)
187 ("util-linux" ,util-linux "lib")))
188 ;; http://www.4store.org has been down for a while now.
189 (home-page "https://github.com/4store/4store")
190 (synopsis "Clustered RDF storage and query engine")
191 (description "4store is a RDF/SPARQL store written in C, supporting
192 either single machines or networked clusters.")
193 (license license:gpl3+)))
194
195 (define-public go-gopkg.in-mgo.v2
196 (package
197 (name "go-gopkg.in-mgo.v2")
198 (version "2016.08.01")
199 (source (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/go-mgo/mgo")
203 (commit (string-append "r" version))))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32
207 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
208 (build-system go-build-system)
209 (arguments
210 `(#:import-path "gopkg.in/mgo.v2"
211 ;; TODO: The tests fail as MongoDB fails to start
212 ;; Error parsing command line: unrecognised option '--chunkSize'
213 #:tests? #f
214 #:phases
215 (modify-phases %standard-phases
216 (delete 'reset-gzip-timestamps)
217 (add-before 'check 'start-mongodb
218 (lambda* (#:key tests? #:allow-other-keys)
219 (when tests?
220 (with-directory-excursion "src/gopkg.in/mgo.v2"
221 (invoke "make" "startdb")))
222 #t))
223 (add-after 'check 'stop'mongodb
224 (lambda* (#:key tests? #:allow-other-keys)
225 (when tests?
226 (with-directory-excursion "src/gopkg.in/mgo.v2"
227 (invoke "make" "stopdb")))
228 #t)))))
229 (native-inputs
230 `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
231 ("mongodb" ,mongodb)
232 ("daemontools" ,daemontools)))
233 (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
234 (description
235 "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
236 It implements a rich selection of features under a simple API following
237 standard Go idioms.")
238 (home-page "https://labix.org/mgo")
239 (license license:bsd-2)))
240
241 (define-public ephemeralpg
242 (package
243 (name "ephemeralpg")
244 (version "3.1")
245 (source
246 (origin
247 (method url-fetch)
248 (uri (string-append
249 "https://eradman.com/ephemeralpg/code/ephemeralpg-"
250 version ".tar.gz"))
251 (sha256
252 (base32 "1ap22ki8yz6agd0qybcjgs4b9izw1rwwcgpxn3jah2ccfyax34s6"))))
253 (build-system gnu-build-system)
254 (arguments
255 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
256 (string-append "PREFIX=" %output))
257 #:phases
258 (modify-phases %standard-phases
259 (delete 'configure) ; no configure script
260 (add-after 'install 'wrap
261 (lambda* (#:key inputs outputs #:allow-other-keys)
262 (let ((out (assoc-ref outputs "out")))
263 (wrap-program (string-append out "/bin/pg_tmp")
264 `("PATH" ":" prefix
265 (,(string-append (assoc-ref inputs "util-linux")
266 "/bin")
267 ,(string-append (assoc-ref inputs "postgresql")
268 "/bin")
269 ;; For getsocket.
270 ,(string-append out "/bin")))))
271 #t)))
272 #:test-target "test"))
273 (inputs
274 `(("postgresql" ,postgresql)
275 ("util-linux" ,util-linux)))
276 (native-inputs
277 ;; For tests.
278 `(("ruby" ,ruby)
279 ("which" ,which)))
280 (home-page "https://eradman.com/ephemeralpg/")
281 (synopsis "Run temporary PostgreSQL databases")
282 (description
283 "@code{pg_tmp} creates temporary PostgreSQL databases, suitable for tasks
284 like running software test suites. Temporary databases created with
285 @code{pg_tmp} have a limited shared memory footprint and are automatically
286 garbage-collected after a configurable number of seconds (the default is
287 60).")
288 (license license:isc)))
289
290 (define-public es-dump-restore
291 (package
292 (name "es-dump-restore")
293 (version "2.1.0")
294 (source
295 (origin
296 (method url-fetch)
297 (uri (rubygems-uri "es_dump_restore" version))
298 (sha256
299 (base32
300 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
301 (build-system ruby-build-system)
302 (arguments
303 '(#:tests? #f)) ;; No testsuite.
304 (propagated-inputs
305 `(("ruby-httpclient" ,ruby-httpclient)
306 ("ruby-multi-json" ,ruby-multi-json)
307 ("ruby-progress_bar" ,ruby-progress_bar)
308 ("ruby-rubyzip" ,ruby-rubyzip)
309 ("ruby-thor" ,ruby-thor)))
310 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
311 (description
312 "This package provides a utility for dumping the contents of an
313 ElasticSearch index to a compressed file and restoring the dumpfile back to an
314 ElasticSearch server")
315 (home-page "https://github.com/patientslikeme/es_dump_restore")
316 (license license:expat)))
317
318 (define-public firebird
319 (package
320 (name "firebird")
321 (version "3.0.7")
322 (source
323 (let ((revision "33374-0"))
324 (origin
325 (method url-fetch)
326 (uri (string-append "https://github.com/FirebirdSQL/"
327 "firebird/releases/download/R"
328 (string-replace-substring version "." "_") "/"
329 "Firebird-" version "." revision ".tar.bz2"))
330 (sha256
331 (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
332 (modules '((guix build utils)))
333 (snippet
334 `(begin
335 (for-each
336 delete-file-recursively
337 (list "extern/btyacc/test" ; TODO: package and remove entirely
338 "extern/editline"
339 "extern/icu"
340 "extern/libtommath"
341 "extern/zlib"
342 "src/include/firebird/impl/boost"
343
344 ;; Missing licence.
345 "builds/install/arch-specific/solaris"
346 "extern/SfIO"
347 "src/msgs/templates.sql"
348
349 ;; Generated files missing sources.
350 "doc/Firebird-3-QuickStart.pdf"
351 (string-append "doc/Firebird-" ,version
352 "-ReleaseNotes.pdf")
353 "doc/README.SecureRemotePassword.html"))
354 #t)))))
355 (build-system gnu-build-system)
356 (outputs (list "debug" "out"))
357 (arguments
358 `(#:configure-flags
359 (let ((out (assoc-ref %outputs "out")))
360 (list (string-append "--with-fbsbin=" out "/sbin")
361 (string-append "--with-fbdoc=" out "/share/doc/"
362 ,name "-" ,version)
363 (string-append "--with-fbconf=" out "/lib/firebird")
364 (string-append "--with-fbintl=" out "/lib/firebird/intl")
365 (string-append "--with-fbmisc=" out "/lib/firebird/misc")
366 (string-append "--with-fbmsg=" out "/lib/firebird")
367 (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
368 (string-append "--with-fbudf=" out "/lib/firebird/UDF")
369 "--with-fbglock=/run/firebird"
370 "--with-fblog=/var/log/firebird"
371 "--with-fbhelp=/var/lib/firebird/system"
372 "--with-fbsecure-db=/var/lib/firebird/secure"
373 "--without-fbsample"
374 "--without-fbsample-db"
375 "--with-system-editline"))
376 #:make-flags
377 (list (string-append "CC=" ,(cc-for-target))
378 ;; The plugins/ can't find libfbclient otherwise.
379 (string-append "LDFLAGS=-Wl,-rpath="
380 (assoc-ref %outputs "out") "/lib"))
381 #:tests? #f ; no test suite
382 #:modules ((guix build gnu-build-system)
383 (guix build utils)
384 (srfi srfi-26))
385 #:phases
386 (modify-phases %standard-phases
387 (add-after 'unpack 'use-system-boost
388 (lambda _
389 (substitute* "src/include/firebird/Message.h"
390 (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
391 "<boost/preprocessor/seq/for_each_i.hpp>")
392 (("FB_BOOST_") "BOOST_"))
393 #t))
394 (add-after 'unpack 'patch-installation
395 (lambda _
396 (substitute*
397 "builds/install/arch-specific/linux/makeInstallImage.sh.in"
398 (("/bin/sh") (which "bash"))
399 ;; Remove shell script helpers from $PATH.
400 (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
401 ;; Put files where Guix users expect them.
402 (("(License\\.txt.*)@FB_CONFDIR" match)
403 (string-append match "@FB_DOCDIR@"))
404 (("@FB_CONFDIR@(.*License\\.txt.*)" match)
405 (string-append "@FB_DOCDIR@" match))
406 (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
407 (string-append head "@FB_DOCDIR@" tail "\n")))
408 (substitute*
409 (list "builds/install/posix-common/changeServerMode.sh.in"
410 "builds/install/posix-common/install.sh.in")
411 ;; Skip phases that (could) cause problems in Guix.
412 (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
413 ":")
414 ;; Skip phases that are merely pointless on Guix.
415 (("buildUninstallFile|installInitdScript|startFirebird") ":")
416 ;; Omit randomly generated password with bonus timestamp.
417 (("setDBAPassword") ":"))
418
419 ;; These promote proprietary workflows not relevant on Guix.
420 (for-each delete-file-recursively
421 (find-files "doc" "README\\.(build\\.msvc|NT|Win)"))
422 #t))
423 (add-after 'configure 'delete-init-scripts
424 (lambda _
425 (delete-file-recursively "gen/install/misc")
426 #t))
427 (add-before 'build 'set-build-environment-variables
428 (lambda _
429 ;; ‘isql’ needs to run & find libfbclient.so during the build.
430 ;; This doubles as a rudimentary test in lieu of a test suite.
431 (setenv "LD_LIBRARY_PATH"
432 (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
433 #t))
434 (add-before 'install 'keep-embedded-debug-symbols
435 (lambda _
436 ;; Let the gnu-build-system separate & deal with them later.
437 ;; XXX Upstream would use ‘--strip-unneeded’, shaving a whole
438 ;; megabyte off Guix's 7.7M libEngine12.so, for example.
439 (substitute* "gen/Makefile.install"
440 (("readelf") "false"))
441 #t))
442 (add-after 'install 'prune-undesirable-files
443 (lambda* (#:key outputs #:allow-other-keys)
444 (let ((out (assoc-ref outputs "out")))
445 (with-directory-excursion out
446 ;; Remove example binaries.
447 (for-each delete-file-recursively
448 (find-files "." "example"))
449 ;; Delete (now-)empty directories.
450 (for-each rmdir
451 (list "include/firebird/impl"
452 "lib/firebird/plugins/udr"))
453 #t)))))))
454 (inputs
455 `(("boost" ,boost)
456 ("editline" ,editline)
457 ("icu4c" ,icu4c-67)
458 ("libtommath" ,libtommath)
459 ("ncurses" ,ncurses)
460 ("zlib" ,zlib)))
461 (home-page "https://www.firebirdsql.org")
462 (synopsis "Relational database with many ANSI SQL standard features")
463 (description
464 "Firebird is an SQL @acronym{RDBMS, relational database management system}
465 with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}) including
466 @acronym{UDFs, user-defined functions} and PSQL stored procedures, cursors, and
467 triggers. Transactions provide full ACID-compliant referential integrity.
468
469 The database requires very little manual maintenance once set up, making it
470 ideal for small business or embedded use.
471
472 When installed as a traditional local or remote (network) database server,
473 Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
474 may be a better choice for such very large environments.
475
476 Firebird can also be embedded into stand-alone applications that don't want or
477 need a full client & server. Used in this manner, it offers richer SQL support
478 than SQLite as well as the option to seamlessly migrate to a client/server
479 database later.")
480 (properties
481 `((lint-hidden-cve . ("CVE-2017-6369"))))
482 (license
483 ;; See doc/license/README.license.usage.txt for rationale & details.
484 (list license:bsd-3 ; src/common/sha2/
485 license:bsd-4 ; src/common/enc.cpp
486 license:gpl2+ ; builds/posix/make.defaults
487 (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
488 "InterBase Public License v1.0")
489 (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
490 "Initial Developer's Public License v1.0")
491 license:lgpl2.1 ; exception for OSI-compatible licences
492 license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
493 license:public-domain)))) ; including files without explicit licence
494
495 (define-public leveldb
496 (package
497 (name "leveldb")
498 (version "1.22")
499 (source (origin
500 (method git-fetch)
501 (uri (git-reference
502 (url "https://github.com/google/leveldb")
503 (commit version)))
504 (file-name (git-file-name name version))
505 (sha256
506 (base32
507 "0qrnhiyq7r4wa1a4wi82zgns35smj94mcjsc7kfs1k6ia9ys79z7"))))
508 (build-system cmake-build-system)
509 (arguments
510 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DLEVELDB_BUILD_TESTS=ON")))
511 (inputs
512 `(("snappy" ,snappy)))
513 (home-page "https://github.com/google/leveldb")
514 (synopsis "Fast key-value storage library")
515 (description
516 "LevelDB is a fast key-value storage library that provides an ordered
517 mapping from string keys to string values.")
518 (license license:bsd-3)))
519
520 (define-public memcached
521 (package
522 (name "memcached")
523 (version "1.6.9")
524 (source
525 (origin
526 (method url-fetch)
527 (uri (string-append
528 "https://memcached.org/files/memcached-" version ".tar.gz"))
529 (sha256
530 (base32 "1lcjy1b9krnb2gk72qd1fvivlfiyfvknfi3wngyvyk9ifzijr9nm"))))
531 (build-system gnu-build-system)
532 (inputs
533 `(("libevent" ,libevent)
534 ("cyrus-sasl" ,cyrus-sasl)))
535 (home-page "https://memcached.org/")
536 (synopsis "In-memory caching service")
537 (description "Memcached is an in-memory key-value store. It has a small
538 and generic API, and was originally intended for use with dynamic web
539 applications.")
540 (license license:bsd-3)))
541
542 (define-public libmemcached
543 (package
544 (name "libmemcached")
545 (version "1.0.18")
546 ;; We build from the sources since we want to build the extra HTML
547 ;; documentation which is not included with the release.
548 (source (origin
549 (method bzr-fetch)
550 (uri (bzr-reference
551 (url "lp:libmemcached/1.0")
552 (revision (string-append "tag:" version))))
553 (file-name (string-append name "-" version "-checkout"))
554 (sha256
555 (base32
556 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))
557 (patches
558 (search-patches "libmemcached-build-with-gcc7.patch"))))
559 (build-system gnu-build-system)
560 (native-inputs
561 `(("memcached" ,memcached)
562 ("libtool" ,libtool)
563 ("autoconf" ,autoconf)
564 ("automake" ,automake)
565 ("bison" ,bison)
566 ("flex" ,flex)
567 ("perl" ,perl)
568 ("python-sphinx" ,python-sphinx))) ;to build the HTML doc.
569 (inputs
570 `(("libevent" ,libevent)
571 ("cyrus-sasl" ,cyrus-sasl)))
572 (outputs '("out" "doc"))
573 (arguments
574 '(#:phases
575 (modify-phases %standard-phases
576 (add-before 'bootstrap 'fix-configure.ac
577 ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
578 ;; get the error ``configure: error: cannot find install-sh,
579 ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
580 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
581 ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
582 (lambda _
583 (delete-file "bootstrap.sh") ;not useful in the context of Guix
584 (substitute* "configure.ac"
585 (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
586 (("(^AC_INIT.*)" anchor)
587 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))
588 #t))
589 (add-before 'bootstrap 'disable-failing-tests
590 ;; See: https://bugs.launchpad.net/libmemcached/+bug/1803926
591 (lambda _
592 ;; Mark some heavily failing test suites as expected to fail.
593 (substitute* "Makefile.am"
594 (("(XFAIL_TESTS =[^\n]*)" xfail_tests)
595 (string-append xfail_tests " tests/testudp"
596 " tests/libmemcached-1.0/testapp"
597 " tests/libmemcached-1.0/testsocket")))
598 ;; Disable two tests of the unittest test suite.
599 (substitute* "libtest/unittest.cc"
600 ((".*echo_fubar_BINARY \\},.*") "")
601 ((".*application_doesnotexist_BINARY \\},.*") ""))
602 #t))
603 (add-after 'disable-dns-tests 'build-and-install-html-doc
604 (lambda* (#:key outputs #:allow-other-keys)
605 (let ((html (string-append (assoc-ref outputs "doc")
606 "/share/doc/libmemcached/html/")))
607 (invoke "make" "install-html")
608 ;; Cleanup useless files.
609 (for-each delete-file-recursively
610 (map (lambda (x) (string-append html x))
611 '("_sources" ".doctrees" ".buildinfo"))))
612 #t)))))
613 (home-page "https://libmemcached.org/")
614 (synopsis "C++ library for memcached")
615 (description "libMemcached is a library to use memcached in C/C++
616 applications. It comes with a complete reference guide and documentation of
617 the API, and provides features such as:
618 @itemize
619 @item Asynchronous and synchronous transport support
620 @item Consistent hashing and distribution
621 @item Tunable hashing algorithm to match keys
622 @item Access to large object support
623 @item Local replication
624 @end itemize")
625 (license license:bsd-3)))
626
627 (define-public python-pylibmc
628 (package
629 (name "python-pylibmc")
630 (version "1.6.1")
631 (source
632 (origin
633 (method url-fetch)
634 (uri (pypi-uri "pylibmc" version))
635 (sha256
636 (base32 "1sg7d9j0v6g3xg3finf4l1hb72c13vcyyi6rqrc9shbx903d93ca"))))
637 (build-system python-build-system)
638 (arguments
639 '(#:phases
640 (modify-phases %standard-phases
641 (add-before 'check 'start-memcached-daemon
642 ;; The test suite requires a memcached server.
643 (lambda _
644 (invoke "memcached" "-d"))))))
645 (native-inputs
646 `(("memcached" ,memcached)
647 ("python-nose" ,python-nose)))
648 (inputs
649 `(("libmemcached" ,libmemcached)
650 ("zlib" ,zlib)
651 ("cyrus-sasl" ,cyrus-sasl)))
652 (home-page "http://sendapatch.se/projects/pylibmc/")
653 (synopsis "Python client for memcached")
654 (description
655 "@code{pylibmc} is a client in Python for memcached. It is a wrapper
656 around TangentOrg’s libmemcached library, and can be used as a drop-in
657 replacement for the code@{python-memcached} library.")
658 (license license:bsd-3)))
659
660 (define-public python2-pylibmc
661 (package-with-python2 python-pylibmc))
662
663 (define-public mongodb
664 (package
665 (name "mongodb")
666 (version "3.4.10")
667 (source (origin
668 (method url-fetch)
669 (uri (string-append "https://github.com/mongodb/mongo/archive/r"
670 version ".tar.gz"))
671 (file-name (string-append name "-" version ".tar.gz"))
672 (sha256
673 (base32 "0676lvkljj7a5hdhv78dbykqnqrj9lbn9799mi84b8vbnzsq961r"))
674 (modules '((guix build utils)))
675 (snippet
676 '(begin
677 (for-each (lambda (dir)
678 (delete-file-recursively
679 (string-append "src/third_party/" dir)))
680 '("pcre-8.41" "scons-2.5.0" "snappy-1.1.3"
681 "valgrind-3.11.0" "wiredtiger"
682 "yaml-cpp-0.5.3" "zlib-1.2.8"))
683 #t))
684 (patches
685 (list
686 (search-patch "mongodb-support-unknown-linux-distributions.patch")))))
687 (build-system scons-build-system)
688 (inputs
689 `(("openssl" ,openssl-1.0)
690 ("pcre" ,pcre)
691 ,@(match (%current-system)
692 ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
693 `(("wiredtiger" ,wiredtiger)))
694 (_ `()))
695 ("yaml-cpp" ,yaml-cpp)
696 ("zlib" ,zlib)
697 ("snappy" ,snappy)))
698 (native-inputs
699 `(("valgrind" ,valgrind)
700 ("perl" ,perl)
701 ("python" ,python-2)
702 ("python2-pymongo" ,python2-pymongo)
703 ("python2-pyyaml" ,python2-pyyaml)
704 ("tzdata" ,tzdata-for-tests)))
705 (arguments
706 `(#:scons ,scons-python2
707 #:phases
708 (let ((common-options
709 `(;; "--use-system-tcmalloc" TODO: Missing gperftools
710 "--use-system-pcre"
711 ;; wiredtiger is 64-bit only
712 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
713 (%current-system)))
714 '("i686-linux" "armhf-linux"))
715 ``"--wiredtiger=off"
716 ``"--use-system-wiredtiger")
717 ;; TODO
718 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
719 ;; --use-system-boost
720 "--use-system-snappy"
721 "--use-system-zlib"
722 "--use-system-valgrind"
723 ;; "--use-system-stemmer" TODO: Missing relevant package
724 "--use-system-yaml"
725 "--disable-warnings-as-errors"
726 ,(format #f "--jobs=~a" (parallel-job-count))
727 "--ssl")))
728 (modify-phases %standard-phases
729 (add-after 'unpack 'patch
730 (lambda _
731 ;; Remove use of GNU extensions in parse_number_test.cpp, to
732 ;; allow compiling with GCC 7 or later
733 ;; https://jira.mongodb.org/browse/SERVER-28063
734 (substitute* "src/mongo/base/parse_number_test.cpp"
735 (("0xabcab\\.defdefP-10")
736 "687.16784283419838"))
737 #t))
738 (add-after 'unpack 'scons-propagate-environment
739 (lambda _
740 ;; Modify the SConstruct file to arrange for
741 ;; environment variables to be propagated.
742 (substitute* "SConstruct"
743 (("^env = Environment\\(")
744 "env = Environment(ENV=os.environ, "))
745 #t))
746 (add-after 'unpack 'create-version-file
747 (lambda _
748 (call-with-output-file "version.json"
749 (lambda (port)
750 (display ,(simple-format #f "{
751 \"version\": \"~A\"
752 }" version) port)))
753 #t))
754 (replace 'build
755 (lambda _
756 (apply invoke `("scons"
757 ,@common-options
758 "mongod" "mongo" "mongos"))))
759 (replace 'check
760 (lambda* (#:key tests? inputs #:allow-other-keys)
761 (setenv "TZDIR"
762 (string-append (assoc-ref inputs "tzdata")
763 "/share/zoneinfo"))
764 (when tests?
765 ;; Note that with the tests, especially the unittests, the
766 ;; build can take up to ~45GB of space, as many tests are
767 ;; individual executable files, with some being hundreds of
768 ;; megabytes in size.
769 (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
770 (substitute* "build/unittests.txt"
771 ;; TODO: Don't run the async_stream_test, as it hangs
772 (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
773 "")
774 ;; TODO: This test fails
775 ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
776 (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
777 ""))
778 (invoke "python" "buildscripts/resmoke.py"
779 "--suites=dbtest,unittests"
780 (format #f "--jobs=~a" (parallel-job-count))))
781 #t))
782 (replace 'install
783 (lambda* (#:key outputs #:allow-other-keys)
784 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
785 (install-file "mongod" bin)
786 (install-file "mongos" bin)
787 (install-file "mongo" bin))
788 #t))))))
789 (home-page "https://www.mongodb.org/")
790 (synopsis "High performance and high availability document database")
791 (description
792 "Mongo is a high-performance, high availability, schema-free
793 document-oriented database. A key goal of MongoDB is to bridge the gap
794 between key/value stores (which are fast and highly scalable) and traditional
795 RDBMS systems (which are deep in functionality).")
796 (license (list license:agpl3
797 ;; Some parts are licensed under the Apache License
798 license:asl2.0))))
799
800 (define-public mycli
801 (package
802 (name "mycli")
803 (version "1.22.2")
804 (source
805 (origin
806 (method url-fetch)
807 (uri (pypi-uri "mycli" version))
808 (sha256
809 (base32 "1lq2x95553vdmhw13cxcgsd2g2i32izhsb7hxd4m1iwf9b3msbpv"))))
810 (build-system python-build-system)
811 (arguments
812 `(#:tests? #f)) ; tests expect a running MySQL
813 (propagated-inputs
814 `(("python-cli-helpers" ,python-cli-helpers)
815 ("python-click" ,python-click)
816 ("python-configobj" ,python-configobj)
817 ("python-cryptography" ,python-cryptography)
818 ("python-prompt-toolkit" ,python-prompt-toolkit)
819 ("python-pygments" ,python-pygments)
820 ("python-pymysql" ,python-pymysql)
821 ("python-sqlparse" ,python-sqlparse)))
822 (home-page "http://mycli.net")
823 (synopsis
824 "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
825 (description
826 "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
827 auto-completion and syntax highlighting.")
828 (license license:bsd-3)))
829
830 ;; XXX When updating, check whether boost-for-mysql is still needed.
831 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
832 (define-public mysql
833 (package
834 (name "mysql")
835 (version "5.7.27")
836 (source (origin
837 (method url-fetch)
838 (uri (list (string-append
839 "https://dev.mysql.com/get/Downloads/MySQL-"
840 (version-major+minor version) "/"
841 name "-" version ".tar.gz")
842 (string-append
843 "https://downloads.mysql.com/archives/get/file/"
844 name "-" version ".tar.gz")))
845 (sha256
846 (base32
847 "1fhv16zr46pxm1j8vb8x8mh3nwzglg01arz8gnazbmjqldr5idpq"))))
848 (build-system cmake-build-system)
849 (arguments
850 `(#:configure-flags
851 '("-DBUILD_CONFIG=mysql_release"
852 "-DWITH_SSL=system"
853 "-DWITH_ZLIB=system"
854 "-DDEFAULT_CHARSET=utf8"
855 "-DDEFAULT_COLLATION=utf8_general_ci"
856 "-DMYSQL_DATADIR=/var/lib/mysql"
857 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
858 "-DINSTALL_INFODIR=share/mysql/docs"
859 "-DINSTALL_MANDIR=share/man"
860 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
861 "-DINSTALL_SCRIPTDIR=bin"
862 "-DINSTALL_INCLUDEDIR=include/mysql"
863 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
864 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
865 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
866 "-DINSTALL_DOCDIR=share/mysql/docs"
867 "-DINSTALL_SHAREDIR=share/mysql"
868 ;; Get rid of test data.
869 "-DINSTALL_MYSQLTESTDIR="
870 "-DINSTALL_SQLBENCHDIR=")
871 #:phases (modify-phases %standard-phases
872 (add-after
873 'install 'remove-extra-binaries
874 (lambda* (#:key outputs #:allow-other-keys)
875 (let ((out (assoc-ref outputs "out")))
876 ;; Remove the 3 *_embedded files, which weigh in at
877 ;; 14 MiB each.
878 (for-each delete-file
879 (find-files (string-append out "/bin")
880 "_embedded$"))
881 #t))))))
882 (native-inputs
883 `(("bison" ,bison)
884 ("perl" ,perl)
885 ("pkg-config" ,pkg-config)))
886 (inputs
887 `(("boost" ,boost-for-mysql)
888 ("libaio" ,libaio)
889 ("libtirpc" ,libtirpc)
890 ("ncurses" ,ncurses)
891 ("openssl" ,openssl)
892 ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
893 ("zlib" ,zlib)))
894 (home-page "https://www.mysql.com/")
895 (synopsis "Fast, easy to use, and popular database")
896 (description
897 "MySQL is a fast, reliable, and easy to use relational database
898 management system that supports the standardized Structured Query
899 Language.")
900 (license license:gpl2)))
901
902 (define-public mariadb
903 (package
904 (name "mariadb")
905 (version "10.5.8")
906 (source (origin
907 (method url-fetch)
908 (uri (string-append "https://downloads.mariadb.com/MariaDB"
909 "/mariadb-" version "/source/mariadb-"
910 version ".tar.gz"))
911 (sha256
912 (base32
913 "1s3vfm73911cddjhgpcbkya6nz7ag2zygg56qqzwscn5ybv28j7b"))
914 (modules '((guix build utils)))
915 (snippet
916 '(begin
917 ;; Delete bundled snappy and xz.
918 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
919 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
920 ;; This file checks that the bundled sources are present and
921 ;; declares build procedures for them.
922 (("^include\\(TokuThirdParty\\)") ""))
923 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
924 ;; Don't attempt to use the procedures we just removed.
925 ((" build_lzma build_snappy") ""))
926
927 ;; Preserve CMakeLists.txt for these.
928 (for-each (lambda (file)
929 (unless (string-suffix? "CMakeLists.txt" file)
930 (delete-file file)))
931 (append (find-files "extra/wolfssl")
932 (find-files "zlib")))
933 #t))))
934 (build-system cmake-build-system)
935 (outputs '("out" "lib" "dev"))
936 (arguments
937 `(#:configure-flags
938 (list
939 "-DBUILD_CONFIG=mysql_release"
940 ;; Linking with libarchive fails, like this:
941
942 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
943 ;; relocation R_X86_64_32 against `.bss' can not be used when
944 ;; making a shared object; recompile with -fPIC
945
946 ;; For now, disable the features that that use libarchive (xtrabackup).
947 "-DWITH_LIBARCHIVE=OFF"
948
949 ;; Disable the TokuDB engine, because its test suite frequently fails,
950 ;; and loading it crashes the server: <https://bugs.gnu.org/35521>.
951 "-DTOKUDB_OK=OFF"
952
953 ;; Ensure the system libraries are used.
954 "-DWITH_JEMALLOC=yes"
955 "-DWITH_PCRE=system"
956 "-DWITH_SSL=system"
957 "-DWITH_ZLIB=system"
958
959 "-DDEFAULT_CHARSET=utf8"
960 "-DDEFAULT_COLLATION=utf8_general_ci"
961 "-DMYSQL_DATADIR=/var/lib/mysql"
962 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
963
964 ;; Do not install the benchmark suite.
965 "-DINSTALL_SQLBENCHDIR=false"
966
967 (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib"))
968 (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib")
969 "/lib")
970 (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out")
971 "/share/mysql/docs")
972 (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out")
973 "/share/man")
974 (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin")
975 (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin")
976 "-DCMAKE_INSTALL_LIBDIR=lib"
977 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
978 (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev")
979 "/include/mysql")
980 (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out")
981 "/share/mysql/docs")
982 (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out")
983 "/share/mysql/docs")
984 (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out")
985 "/share/mysql/support-files")
986 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
987 "-DINSTALL_SHAREDIR=share")
988 #:phases
989 (modify-phases %standard-phases
990 (add-after 'unpack 'adjust-output-references
991 (lambda _
992 ;; The build system invariably prepends $CMAKE_INSTALL_PREFIX
993 ;; to other variables such as $INSTALL_INCLUDEDIR, which does
994 ;; not work when the latter uses an absolute file name.
995 (substitute* "libmariadb/mariadb_config/mariadb_config.c.in"
996 (("%s/@INSTALL_INCLUDEDIR@")
997 (string-append "@INSTALL_INCLUDEDIR@"))
998 ;; As of 10.5.8, the mariadb_config program tries to be
999 ;; clever and computes the installation directory relative
1000 ;; to /proc/self/exe when running on Linux. Make it fall
1001 ;; back to the old behaviour.
1002 (("defined\\(__linux__\\)")
1003 "0"))
1004 (substitute* "libmariadb/mariadb_config/libmariadb.pc.in"
1005 (("\\$\\{prefix\\}/@INSTALL_INCLUDEDIR@")
1006 "@INSTALL_INCLUDEDIR@"))
1007 (substitute* "support-files/mariadb.pc.in"
1008 (("^(include|bin|script|doc|man)dir=\\$\\{prefix\\}/" _ dir)
1009 (string-append dir "dir=")))
1010 (substitute* "include/CMakeLists.txt"
1011 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_INCLUDEDIR\\}")
1012 "${INSTALL_INCLUDEDIR}"))
1013 (substitute* "cmake/mariadb_connector_c.cmake"
1014 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_BINDIR\\}")
1015 "${INSTALL_BINDIR}"))
1016 #t))
1017 (add-after 'unpack 'adjust-tests
1018 (lambda _
1019 (let ((disabled-tests
1020 '(;; These fail because root@hostname == root@localhost in
1021 ;; the build environment, causing a user count mismatch.
1022 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
1023 "funcs_1.is_columns_mysql"
1024 "main.join_cache"
1025 "main.explain_non_select"
1026 "main.stat_tables"
1027 "main.stat_tables_innodb"
1028 "main.upgrade_MDEV-19650"
1029 "roles.acl_statistics"
1030
1031 ;; FIXME: This test checks various table encodings and
1032 ;; fails because Guix defaults to UTF8 instead of the
1033 ;; upstream default latin1_swedish_ci. It's not easily
1034 ;; substitutable because several encodings are tested.
1035 "main.sp2"
1036
1037 ;; XXX: This test occasionally fails on i686-linux:
1038 ;; <https://jira.mariadb.org/browse/MDEV-24458>
1039 ,@(if (string-prefix? "i686" (%current-system))
1040 '("main.myisampack")
1041 '())
1042
1043 ;; This file contains a time bomb which makes it fail after
1044 ;; 2030-12-31. See <https://bugs.gnu.org/34351> for details.
1045 "main.mysqldump"))
1046
1047 ;; This file contains a list of known-flaky tests for this
1048 ;; release. Append our own items.
1049 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
1050 (for-each (lambda (test)
1051 (format unstable-tests "~a : ~a\n"
1052 test "Disabled in Guix"))
1053 disabled-tests)
1054 (close-port unstable-tests)
1055
1056 ;; XXX: These fail because they expect a latin1 charset and
1057 ;; collation. See <https://jira.mariadb.org/browse/MDEV-21264>.
1058 (substitute* '("mysql-test/main/gis_notembedded.result"
1059 "mysql-test/main/system_mysql_db.result")
1060 (("latin1_swedish_ci") "utf8_general_ci")
1061 (("\tlatin1") "\tutf8"))
1062
1063 (substitute* "mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test"
1064 (("/bin/bash")
1065 (which "bash")))
1066
1067 (substitute* "mysql-test/mysql-test-run.pl"
1068 (("/bin/ls") (which "ls"))
1069 (("/bin/sh") (which "sh")))
1070 #t)))
1071 (add-before 'configure 'disable-plugins
1072 (lambda _
1073 (let ((disable-plugin (lambda (name)
1074 (call-with-output-file
1075 (string-append "plugin/" name
1076 "/CMakeLists.txt")
1077 (lambda (port)
1078 (format port "\n")))))
1079 (disabled-plugins '(;; XXX: Causes a test failure.
1080 "disks")))
1081 (for-each disable-plugin disabled-plugins)
1082 #t)))
1083 (replace 'check
1084 (lambda* (#:key (tests? #t) #:allow-other-keys)
1085 (if tests?
1086 (with-directory-excursion "mysql-test"
1087 (invoke "./mtr" "--verbose"
1088 "--retry=3"
1089 "--testcase-timeout=40"
1090 "--suite-timeout=600"
1091 "--parallel" (number->string (parallel-job-count))
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"
1096 "--skip-test-list=unstable-tests"))
1097 (format #t "test suite not run~%"))
1098 #t))
1099 (add-after
1100 'install 'post-install
1101 (lambda* (#:key inputs outputs #:allow-other-keys)
1102 (let* ((out (assoc-ref outputs "out"))
1103 (dev (assoc-ref outputs "dev"))
1104 (lib (assoc-ref outputs "lib"))
1105 (openssl (assoc-ref inputs "openssl")))
1106 (substitute* (list (string-append out "/bin/mariadb-install-db")
1107 (string-append out "/bin/mysql_install_db"))
1108 (("basedir=\"\"")
1109 (string-append "basedir=\"" out "\""))
1110 (("\\$basedir/share/mysql")
1111 (string-append lib "/share/mysql")))
1112
1113 (with-directory-excursion lib
1114 ;; Remove tests.
1115 (delete-file-recursively "mysql-test")
1116 ;; Remove static libraries.
1117 (for-each delete-file (find-files "lib" "\\.a$")))
1118
1119 (with-directory-excursion out
1120 (delete-file "share/man/man1/mysql-test-run.pl.1")
1121 ;; Delete huge and unnecessary executables.
1122 (for-each delete-file (find-files "bin" "test$")))
1123 (mkdir-p (string-append dev "/share"))
1124 (mkdir-p (string-append dev "/bin"))
1125 (rename-file (string-append lib "/bin/mariadbd")
1126 (string-append out "/bin/mariadbd"))
1127 (rename-file (string-append lib "/bin/mysqld")
1128 (string-append out "/bin/mysqld"))
1129 (mkdir-p (string-append dev "/lib"))
1130 (rename-file (string-append lib "/lib/pkgconfig")
1131 (string-append dev "/lib/pkgconfig"))
1132 (rename-file (string-append lib "/bin/mariadb_config")
1133 (string-append dev "/bin/mariadb_config"))
1134 (rename-file (string-append out "/bin/mysql_config")
1135 (string-append dev "/bin/mysql_config"))
1136
1137 ;; Embed an absolute reference to OpenSSL in mysql_config
1138 ;; and the pkg-config file to avoid propagation.
1139 ;; XXX: how to do this for mariadb_config.c.in?
1140 (substitute* (list (string-append dev "/bin/mysql_config")
1141 (string-append dev "/lib/pkgconfig/mariadb.pc"))
1142 (("-lssl -lcrypto" all)
1143 (string-append "-L" openssl "/lib " all)))
1144
1145 #t))))))
1146 (native-inputs
1147 `(("bison" ,bison)
1148 ("perl" ,perl)))
1149 (inputs
1150 `(("jemalloc" ,jemalloc)
1151 ("libaio" ,libaio)
1152 ("libxml2" ,libxml2)
1153 ("ncurses" ,ncurses)
1154 ("openssl" ,openssl)
1155 ("pam" ,linux-pam)
1156 ("pcre2" ,pcre2)
1157 ("xz" ,xz)
1158 ("zlib" ,zlib)))
1159 ;; The test suite is very resource intensive and can take more than three
1160 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
1161 (properties '((timeout . 64800))) ;18 hours
1162 (home-page "https://mariadb.org/")
1163 (synopsis "SQL database server")
1164 (description
1165 "MariaDB is a multi-user and multi-threaded SQL database server, designed
1166 as a drop-in replacement of MySQL.")
1167 (license license:gpl2)))
1168
1169 (define-public mariadb-connector-c
1170 (package
1171 (name "mariadb-connector-c")
1172 (version "3.1.11")
1173 (source
1174 (origin
1175 (method url-fetch)
1176 (uri (string-append
1177 "https://downloads.mariadb.org/f/connector-c-" version
1178 "/mariadb-connector-c-" version "-src.tar.gz"
1179 "/from/https%3A//mirrors.ukfast.co.uk/sites/mariadb/?serve"))
1180 (sha256
1181 (base32 "03svzahdf7czjlm695c11r4bfd04qdqgx8r1vkpr1zlkjhwnqvry"))))
1182 (inputs
1183 `(("openssl" ,openssl)))
1184 (build-system cmake-build-system)
1185 (arguments
1186 '(#:tests? #f)) ; no tests
1187 (home-page "https://mariadb.com/kb/en/mariadb-connector-c/")
1188 (synopsis "Client library to connect to MySQL or MariaDB")
1189 (description "The MariaDB Connector/C is used to connect applications
1190 developed in C/C++ to MariaDB and MySQL databases.")
1191 (license license:lgpl2.1+)))
1192
1193 ;; Don't forget to update the other postgresql packages when upgrading this one.
1194 (define-public postgresql-13
1195 (package
1196 (name "postgresql")
1197 (version "13.1")
1198 (source (origin
1199 (method url-fetch)
1200 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1201 version "/postgresql-" version ".tar.bz2"))
1202 (sha256
1203 (base32
1204 "07z6zwr58dckaa97yl9ml240z83d1lhgaxw9aq49i8lsp21mqd0j"))
1205 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
1206 (build-system gnu-build-system)
1207 (arguments
1208 `(#:configure-flags '("--with-uuid=e2fs" "--with-openssl"
1209 ;; PostgreSQL installs its own Makefile (should it?).
1210 ;; Prevent it from retaining needless references to
1211 ;; the build tools in order to save size.
1212 "MKDIR_P=mkdir -p" "INSTALL_BIN=install -c"
1213 "LD=ld" "TAR=tar")
1214 #:phases
1215 (modify-phases %standard-phases
1216 (add-before 'configure 'patch-/bin/sh
1217 (lambda _
1218 ;; Refer to the actual shell.
1219 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
1220 "src/bin/psql/command.c")
1221 (("/bin/sh") (which "sh")))
1222 #t))
1223 (add-after 'build 'build-contrib
1224 (lambda _
1225 (invoke "make" "-C" "contrib")))
1226 (add-after 'install 'install-contrib
1227 (lambda _
1228 (invoke "make" "-C" "contrib" "install"))))))
1229 (inputs
1230 `(("readline" ,readline)
1231 ("libuuid" ,util-linux "lib")
1232 ("openssl" ,openssl)
1233 ("zlib" ,zlib)))
1234 (home-page "https://www.postgresql.org/")
1235 (synopsis "Powerful object-relational database system")
1236 (description
1237 "PostgreSQL is a powerful object-relational database system. It is fully
1238 ACID compliant, has full support for foreign keys, joins, views, triggers, and
1239 stored procedures (in multiple languages). It includes most SQL:2008 data
1240 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
1241 TIMESTAMP. It also supports storage of binary large objects, including
1242 pictures, sounds, or video.")
1243 (license (license:x11-style "file://COPYRIGHT"))))
1244
1245 (define-public postgresql-11
1246 (package
1247 (inherit postgresql-13)
1248 (name "postgresql")
1249 (version "11.6")
1250 (source (origin
1251 (inherit (package-source postgresql-13))
1252 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1253 version "/postgresql-" version ".tar.bz2"))
1254 (sha256
1255 (base32
1256 "0w1iq488kpzfgfnlw4k32lz5by695mpnkq461jrgsr99z5zlz4j9"))))))
1257
1258 (define-public postgresql-10
1259 (package
1260 (inherit postgresql-11)
1261 (version "10.13")
1262 (source (origin
1263 (inherit (package-source postgresql-11))
1264 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1265 version "/postgresql-" version ".tar.bz2"))
1266 (sha256
1267 (base32
1268 "1qal0yp7a90yzya7hl56gsmw5fvacplrdhpn7h9gnbyr1i2iyw2d"))))))
1269
1270 (define-public postgresql-9.6
1271 (package
1272 (inherit postgresql-10)
1273 (version "9.6.16")
1274 (source (origin
1275 (inherit (package-source postgresql-10))
1276 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1277 version "/postgresql-" version ".tar.bz2"))
1278 (sha256
1279 (base32
1280 "1rr2dgv4ams8r2lp13w85c77rkmzpb88fjlc28mvlw6zq2fblv2w"))))))
1281
1282 (define-public postgresql postgresql-13)
1283
1284 (define-public pgloader
1285 (package
1286 (name "pgloader")
1287 (version "3.6.2")
1288 (source
1289 (origin
1290 (method git-fetch)
1291 (uri (git-reference
1292 (url "https://github.com/dimitri/pgloader")
1293 (commit (string-append "v" version))))
1294 (sha256
1295 (base32 "06i1jd2za3ih5caj2b4vzlzags5j65vv8dfdbz0ggdrp40wfd5lh"))
1296 (file-name (git-file-name name version))))
1297 (build-system gnu-build-system)
1298 (arguments
1299 ;; NOTE: (Sharlatan-20210119T211511+0000) Tests are disabled due to being
1300 ;; dependent on Quicklisp, main build target is `pgloader-standalone' which
1301 ;; does not require Quicklisp workarounds. There is no `install' target
1302 ;; configured in Makefile.
1303 `(#:tests? #f
1304 #:strip-binaries? #f
1305 #:make-flags
1306 (list "pgloader-standalone" "BUILDAPP_SBCL=buildapp")
1307 #:phases
1308 (modify-phases %standard-phases
1309 (delete 'configure)
1310 (add-after 'unpack 'set-home
1311 (lambda _
1312 (setenv "HOME" "/tmp")
1313 #t))
1314 (add-after 'unpack 'patch-Makefile
1315 (lambda _
1316 (substitute* "Makefile"
1317 (("--sbcl.*") "--sbcl $(CL) --asdf-path . \\\n"))
1318 #t))
1319 (replace 'install
1320 (lambda* (#:key outputs #:allow-other-keys)
1321 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
1322 (mkdir-p bin)
1323 (install-file "build/bin/pgloader" bin))
1324 #t)))))
1325 (native-inputs
1326 `(("buildapp" ,buildapp)
1327 ("sbcl" ,sbcl)))
1328 (inputs
1329 `(("alexandria" ,sbcl-alexandria)
1330 ("cl-abnf" ,sbcl-cl-abnf)
1331 ("cl-base64" ,sbcl-cl-base64)
1332 ("cl-csv" ,sbcl-cl-csv)
1333 ("cl-fad" ,sbcl-cl-fad)
1334 ("cl-log" ,sbcl-cl-log)
1335 ("cl-markdown" ,sbcl-cl-markdown)
1336 ("cl-mustache" ,sbcl-cl-mustache)
1337 ("cl-ppcre" ,sbcl-cl-ppcre)
1338 ("cl-sqlite" ,sbcl-cl-sqlite)
1339 ("closer-mop" ,sbcl-closer-mop)
1340 ("command-line-arguments" ,sbcl-command-line-arguments)
1341 ("db3" ,sbcl-db3)
1342 ("drakma" ,sbcl-drakma)
1343 ("esrap" ,sbcl-esrap)
1344 ("flexi-streams" ,sbcl-flexi-streams)
1345 ("ixf" ,sbcl-ixf)
1346 ("local-time" ,sbcl-local-time)
1347 ("lparallel" ,sbcl-lparallel)
1348 ("metabang-bind" ,sbcl-metabang-bind)
1349 ("mssql" ,sbcl-mssql)
1350 ("postmodern" ,sbcl-postmodern)
1351 ("py-configparser" ,sbcl-py-configparser)
1352 ("qmynd" ,sbcl-qmynd)
1353 ("quri" ,sbcl-quri)
1354 ("split-sequence" ,sbcl-split-sequence)
1355 ("trivial-backtrace" ,sbcl-trivial-backtrace)
1356 ("usocket" ,sbcl-usocket)
1357 ("uuid" ,sbcl-uuid)
1358 ("yason" ,sbcl-yason)
1359 ("zs3" ,sbcl-zs3)))
1360 (home-page "https://pgloader.io/")
1361 (synopsis "Tool to migrate data to PostgreSQL")
1362 (description
1363 "@code{pgloader} is a program that can load data or migrate databases from
1364 CSV, DB3, iXF, SQLite, MS-SQL or MySQL to PostgreSQL.")
1365 (license (license:x11-style "file://LICENSE"))))
1366
1367 (define-public python-pymysql
1368 (package
1369 (name "python-pymysql")
1370 (version "0.9.3")
1371 (source
1372 (origin
1373 (method url-fetch)
1374 (uri (pypi-uri "PyMySQL" version))
1375 (sha256
1376 (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
1377 (build-system python-build-system)
1378 (native-inputs
1379 `(("python-unittest2" ,python-unittest2)))
1380 (inputs
1381 `(("python-cryptography" ,python-cryptography)))
1382 (arguments
1383 `(#:tests? #f)) ; tests expect a running MySQL
1384 (home-page "https://github.com/PyMySQL/PyMySQL/")
1385 (synopsis "Pure-Python MySQL driver")
1386 (description
1387 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
1388 Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
1389 (license license:expat)))
1390
1391 (define-public python2-pymysql
1392 (package-with-python2 python-pymysql))
1393
1394 (define-public qdbm
1395 (package
1396 (name "qdbm")
1397 (version "1.8.78")
1398 (source
1399 (origin
1400 (method url-fetch)
1401 (uri (string-append "http://fallabs.com/" name "/"
1402 name "-" version ".tar.gz"))
1403 (sha256
1404 (base32
1405 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
1406 (build-system gnu-build-system)
1407 (arguments
1408 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1409 (assoc-ref %outputs "out")
1410 "/lib"))
1411 #:make-flags (list "CFLAGS=-fPIC")))
1412 (home-page "https://fallabs.com/qdbm/")
1413 (synopsis "Key-value database")
1414 (description "QDBM is a library of routines for managing a
1415 database. The database is a simple data file containing key-value
1416 pairs. Every key and value is serial bytes with variable length.
1417 Binary data as well as character strings can be used as a key or a
1418 value. There is no concept of data tables or data types. Records are
1419 organized in a hash table or B+ tree.")
1420 (license license:lgpl2.1+)))
1421
1422 (define-public recutils
1423 (package
1424 (name "recutils")
1425 (version "1.8")
1426 (source (origin
1427 (method url-fetch)
1428 (uri (string-append "mirror://gnu/recutils/recutils-"
1429 version ".tar.gz"))
1430 (sha256
1431 (base32
1432 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
1433 (build-system gnu-build-system)
1434
1435 (arguments '(#:configure-flags
1436 (list (string-append "--with-bash-headers="
1437 (assoc-ref %build-inputs "bash:include")
1438 "/include/bash"))))
1439
1440 (native-inputs `(("bc" ,bc)
1441 ("bash:include" ,bash "include")
1442 ("check" ,check-0.14)
1443 ("pkg-config" ,pkg-config)))
1444
1445 ;; TODO: Add more optional inputs.
1446 (inputs `(("curl" ,curl)
1447 ("libgcrypt" ,libgcrypt)
1448 ("libuuid" ,util-linux "lib")))
1449 (synopsis "Manipulate plain text files as databases")
1450 (description
1451 "GNU Recutils is a set of tools and libraries for creating and
1452 manipulating text-based, human-editable databases. Despite being text-based,
1453 databases created with Recutils carry all of the expected features such as
1454 unique fields, primary keys, time stamps and more. Many different field
1455 types are supported, as is encryption.")
1456 (license license:gpl3+)
1457 (home-page "https://www.gnu.org/software/recutils/")))
1458
1459 (define-public emacs-recutils
1460 (package
1461 (inherit recutils)
1462 (name "emacs-recutils")
1463 (build-system emacs-build-system)
1464 (arguments
1465 '(#:phases
1466 (modify-phases %standard-phases
1467 (add-after 'unpack 'change-directory
1468 (lambda _
1469 (chdir "etc")
1470 #t)))))
1471 (native-inputs '())
1472 (inputs '())
1473 (synopsis "Emacs mode for working with recutils database files")
1474 (description "This package provides an Emacs major mode @code{rec-mode}
1475 for working with GNU Recutils text-based, human-editable databases. It
1476 supports editing, navigation, and querying of recutils database files
1477 including field and record folding.")))
1478
1479 (define-public rocksdb
1480 (package
1481 (name "rocksdb")
1482 (version "6.11.4")
1483 (source (origin
1484 (method git-fetch)
1485 (uri (git-reference
1486 (url "https://github.com/facebook/rocksdb")
1487 (commit (string-append "v" version))))
1488 (file-name (git-file-name name version))
1489 (sha256
1490 (base32
1491 "0n19p9cd13jg0lnibrzwkxs4xlrhyj3knypkd2ic41arbds0bdnl"))
1492 (modules '((guix build utils)))
1493 (snippet
1494 '(begin
1495 ;; TODO: unbundle gtest.
1496 (delete-file "build_tools/gnu_parallel")
1497 (substitute* "Makefile"
1498 (("build_tools/gnu_parallel") "parallel"))
1499 #t))))
1500 (build-system gnu-build-system)
1501 (arguments
1502 `(#:make-flags (list "CC=gcc" "V=1"
1503 ;; Ceph requires that RTTI is enabled.
1504 "USE_RTTI=1"
1505 "date=1970-01-01" ; build reproducibly
1506 (string-append "INSTALL_PATH="
1507 (assoc-ref %outputs "out"))
1508
1509 ;; Running the full test suite takes hours and require
1510 ;; a lot of disk space. Instead we only run a subset
1511 ;; (see .travis.yml and Makefile).
1512 "ROCKSDBTESTS_END=db_tailing_iter_test")
1513 #:test-target "check_some"
1514 ;; Many tests fail on 32-bit platforms. There are multiple reports about
1515 ;; this upstream, but it's not going to be supported any time soon.
1516 #:tests? (let ((system ,(or (%current-target-system)
1517 (%current-system))))
1518 (or (string-prefix? "x86_64-linux" system)
1519 (string-prefix? "aarch64-linux" system)))
1520 #:phases
1521 (modify-phases %standard-phases
1522 (add-after 'unpack 'patch-Makefile
1523 (lambda _
1524 (substitute* "Makefile"
1525 ;; Don't depend on the static library when installing.
1526 (("install: install-static")
1527 "install: install-shared")
1528 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1529 #t))
1530 (delete 'configure)
1531 ;; The default target is only needed for tests and built on demand.
1532 (delete 'build)
1533 (add-before 'check 'disable-optimizations
1534 (lambda _
1535 ;; Prevent the build from passing '-march=native' to the compiler.
1536 (setenv "PORTABLE" "1")
1537 #t))
1538 (add-before 'check 'disable-failing-tests
1539 (lambda _
1540 (substitute* "Makefile"
1541 ;; These tests reliably fail due to "Too many open files".
1542 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
1543 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
1544 #t))
1545 (add-after 'check 'build
1546 ;; The default build target is a debug build for tests. The
1547 ;; install target depends on the "shared_lib" release target
1548 ;; so we build it here for clarity.
1549 (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
1550 (apply invoke "make" "shared_lib"
1551 `(,@(if parallel-build?
1552 `("-j" ,(number->string (parallel-job-count)))
1553 '())
1554 ,@make-flags)))))))
1555 (native-inputs
1556 `(("parallel" ,parallel)
1557 ("perl" ,perl)
1558 ("procps" ,procps)
1559 ("python" ,python-2)
1560 ("which" ,which)))
1561 (inputs
1562 `(("bzip2" ,bzip2)
1563 ("gflags" ,gflags)
1564 ("jemalloc" ,jemalloc)
1565 ("lz4" ,lz4)
1566 ("snappy" ,snappy)
1567 ("zlib" ,zlib)))
1568 (home-page "https://rocksdb.org/")
1569 (synopsis "Persistent key-value store for fast storage")
1570 (description
1571 "RocksDB is a library that forms the core building block for a fast
1572 key-value server, especially suited for storing data on flash drives. It
1573 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1574 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1575 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
1576 compactions, making it specially suitable for storing multiple terabytes of
1577 data in a single database. RocksDB is partially based on @code{LevelDB}.")
1578 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
1579 ;; files carry the 3-clause BSD license.
1580 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
1581
1582 (define-public sparql-query
1583 (package
1584 (name "sparql-query")
1585 (version "1.1")
1586 (source (origin
1587 (method git-fetch)
1588 (uri (git-reference
1589 (url "https://github.com/tialaramex/sparql-query")
1590 (commit version)))
1591 (sha256
1592 (base32 "0a84a89idpjhj9w2y3fmvzv7ldps1cva1kxvfmh897k02kaniwxk"))
1593 (file-name (git-file-name name version))))
1594 (build-system gnu-build-system)
1595 (inputs
1596 `(("curl" ,curl)
1597 ("glib" ,glib)
1598 ("libxml2" ,libxml2)
1599 ("ncurses" ,ncurses)
1600 ("readline" ,readline)))
1601 (native-inputs
1602 `(("pkg-config" ,pkg-config)))
1603 (arguments
1604 `(#:make-flags '("CC=gcc")
1605 #:phases
1606 (modify-phases %standard-phases
1607 (delete 'configure)
1608 ;; The Makefile uses git to obtain versioning information. This phase
1609 ;; substitutes the git invocation with the package version.
1610 (add-after 'unpack 'remove-git-dependency
1611 (lambda _
1612 (substitute* "Makefile"
1613 (("^gitrev :=.*$")
1614 (string-append "gitrev = \"v" ,version "\"")))
1615 #t))
1616 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1617 ;; This replacement does the same thing, except for using $PREFIX/bin
1618 ;; instead.
1619 (replace 'install
1620 (lambda* (#:key outputs #:allow-other-keys)
1621 (let* ((out (assoc-ref outputs "out"))
1622 (bin (string-append out "/bin")))
1623 (install-file "sparql-query" bin)
1624 (symlink (string-append bin "/sparql-query")
1625 (string-append bin "/sparql-update")))
1626 #t))
1627 (replace 'check
1628 (lambda* (#:key make-flags #:allow-other-keys)
1629 (apply invoke "make" `(,@make-flags "scan-test"))
1630 (invoke "./scan-test"))))))
1631 (home-page "https://github.com/tialaramex/sparql-query/")
1632 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1633 (description "Sparql-query is a command-line tool for accessing SPARQL
1634 endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
1635 tools for interrogating SQL databases. For example, you can enter a query over
1636 several lines, using a semi-colon at the end of a line to indicate the end of
1637 your query. It also supports readline so that you can more easily recall and
1638 edit previous queries, even across sessions. It can be used non-interactively,
1639 for example from a shell script.")
1640 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1641 ;; others (like sparql-query.c) contain a GPLv2+ license header.
1642 (license (list license:gpl3+))))
1643
1644 (define-public sqitch
1645 (package
1646 (name "sqitch")
1647 (version "1.1.0")
1648 (source
1649 (origin
1650 (method url-fetch)
1651 (uri (string-append
1652 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
1653 version ".tar.gz"))
1654 (sha256
1655 (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
1656 (build-system perl-build-system)
1657 (arguments
1658 '(#:phases
1659 (modify-phases %standard-phases
1660 (add-before 'check 'set-check-environment
1661 (lambda _
1662 (setenv "TZ" "UTC")
1663 (setenv "HOME" "/tmp")
1664 #t))
1665 (add-after 'install 'wrap-program
1666 (lambda* (#:key outputs #:allow-other-keys)
1667 (let* ((out (assoc-ref outputs "out"))
1668 (path (getenv "PERL5LIB")))
1669 (wrap-program (string-append out "/bin/sqitch")
1670 `("PERL5LIB" ":" prefix
1671 (,(string-append out "/lib/perl5/site_perl"
1672 ":"
1673 path)))))
1674 #t)))))
1675 (native-inputs
1676 `(("perl-capture-tiny" ,perl-capture-tiny)
1677 ("perl-io-pager" ,perl-io-pager)
1678 ("perl-module-build" ,perl-module-build)
1679 ("perl-module-runtime" ,perl-module-runtime)
1680 ("perl-path-class" ,perl-path-class)
1681 ("perl-test-deep" ,perl-test-deep)
1682 ("perl-test-dir" ,perl-test-dir)
1683 ("perl-test-exception" ,perl-test-exception)
1684 ("perl-test-file" ,perl-test-file)
1685 ("perl-test-file-contents" ,perl-test-file-contents)
1686 ("perl-test-mockmodule" ,perl-test-mockmodule)
1687 ("perl-test-mockobject" ,perl-test-mockobject)
1688 ("perl-test-nowarnings" ,perl-test-nowarnings)
1689 ("perl-test-warn" ,perl-test-warn)))
1690 (inputs
1691 `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1692 ("perl-clone" ,perl-clone)
1693 ("perl-config-gitlike" ,perl-config-gitlike)
1694 ("perl-datetime" ,perl-datetime)
1695 ("perl-datetime-timezone" ,perl-datetime-timezone)
1696 ("perl-dbd-mysql" ,perl-dbd-mysql)
1697 ("perl-dbd-pg" ,perl-dbd-pg)
1698 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1699 ("perl-dbi" ,perl-dbi)
1700 ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1701 ("perl-encode-locale" ,perl-encode-locale)
1702 ("perl-hash-merge" ,perl-hash-merge)
1703 ("perl-ipc-run3" ,perl-ipc-run3)
1704 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1705 ("perl-libintl-perl" ,perl-libintl-perl)
1706 ("perl-list-moreutils" ,perl-list-moreutils)
1707 ("perl-moo" ,perl-moo)
1708 ("perl-mysql-config" ,perl-mysql-config)
1709 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1710 ("perl-path-class" ,perl-path-class)
1711 ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1712 ("perl-string-formatter" ,perl-string-formatter)
1713 ("perl-string-shellquote" ,perl-string-shellquote)
1714 ("perl-sub-exporter" ,perl-sub-exporter)
1715 ("perl-template-tiny" ,perl-template-tiny)
1716 ("perl-template-toolkit" ,perl-template-toolkit)
1717 ("perl-throwable" ,perl-throwable)
1718 ("perl-try-tiny" ,perl-try-tiny)
1719 ("perl-type-tiny" ,perl-type-tiny)
1720 ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1721 ("perl-uri" ,perl-uri)
1722 ("perl-uri-db" ,perl-uri-db)))
1723 (home-page "https://sqitch.org/")
1724 (synopsis "Database change management tool")
1725 (description
1726 "Sqitch is a standalone change management system for database schemas,
1727 which uses SQL to describe changes.")
1728 (license license:x11)))
1729
1730 (define-public sqlcrush
1731 ;; Unfortunately, there is no proper upstream release and may never be.
1732 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1733 (revision "1"))
1734 (package
1735 (name "sqlcrush")
1736 (version (git-version "0.1.5" revision commit))
1737 (source (origin
1738 (method git-fetch)
1739 (uri (git-reference
1740 (url "https://github.com/coffeeandscripts/sqlcrush")
1741 (commit commit)))
1742 (file-name (git-file-name name version))
1743 (sha256
1744 (base32
1745 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1746 (build-system python-build-system)
1747 (inputs
1748 `(("python-cryptography" ,python-cryptography)
1749 ("python-psycopg2" ,python-psycopg2)
1750 ("python-pymysql" ,python-pymysql)
1751 ("python-sqlalchemy" ,python-sqlalchemy)))
1752 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1753 (synopsis "Text console-based database viewer and editor")
1754 (description
1755 "SQLcrush lets you view and edit a database directly from the text
1756 console through an ncurses interface. You can explore each table's structure,
1757 browse and edit the contents, add and delete entries, all while tracking your
1758 changes.")
1759 (license license:gpl3+)))) ; no headers, see README.md
1760
1761 (define-public tdb
1762 (package
1763 (name "tdb")
1764 (version "1.4.3")
1765 (source (origin
1766 (method url-fetch)
1767 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
1768 version ".tar.gz"))
1769 (sha256
1770 (base32
1771 "06waz0k50c7v3chd08mzp2rv7w4k4q9isbxx3vhlfpx1vy9q61f8"))))
1772 (build-system gnu-build-system)
1773 (arguments
1774 '(#:phases
1775 (modify-phases %standard-phases
1776 (replace 'configure
1777 (lambda* (#:key outputs #:allow-other-keys)
1778 (let ((out (assoc-ref outputs "out")))
1779 ;; The 'configure' script is a wrapper for Waf and
1780 ;; doesn't recognize things like '--enable-fast-install'.
1781 (invoke "./configure"
1782 (string-append "--prefix=" out))))))))
1783 (native-inputs
1784 `(;; TODO: Build the documentation.
1785 ;; ("docbook-xsl" ,docbook-xsl)
1786 ;; ("libxml2" ,libxml2)
1787 ;; ("libxslt" ,libxslt)
1788 ("python" ,python) ;for the Waf build system
1789 ("which" ,which)))
1790 (home-page "https://tdb.samba.org/")
1791 (synopsis "Trivial database")
1792 (description
1793 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1794 and BSD's DB except that it allows multiple simultaneous writers and uses
1795 locking internally to keep writers from trampling on each other. TDB is also
1796 extremely small.")
1797 (license license:lgpl3+)))
1798
1799 (define-public perl-dbi
1800 (package
1801 (name "perl-dbi")
1802 (version "1.643")
1803 (source (origin
1804 (method url-fetch)
1805 (uri (string-append
1806 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1807 version ".tar.gz"))
1808 (sha256
1809 (base32
1810 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa"))))
1811 (build-system perl-build-system)
1812 (synopsis "Database independent interface for Perl")
1813 (description "This package provides an database interface for Perl.")
1814 (home-page "https://metacpan.org/release/DBI")
1815 (license license:perl-license)))
1816
1817 (define-public perl-dbix-class
1818 (package
1819 (name "perl-dbix-class")
1820 (version "0.082842")
1821 (source
1822 (origin
1823 (method url-fetch)
1824 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1825 "DBIx-Class-" version ".tar.gz"))
1826 (sha256
1827 (base32 "1rh7idjjbibc1zmiaaarask434lh0lx7f2xyfwmy37k9fa0xcpmh"))))
1828 (build-system perl-build-system)
1829 (native-inputs
1830 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1831 ("perl-file-temp" ,perl-file-temp)
1832 ("perl-module-install" ,perl-module-install)
1833 ("perl-package-stash" ,perl-package-stash)
1834 ("perl-test-deep" ,perl-test-deep)
1835 ("perl-test-exception" ,perl-test-exception)
1836 ("perl-test-warn" ,perl-test-warn)))
1837 (propagated-inputs
1838 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1839 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1840 ("perl-class-inspector" ,perl-class-inspector)
1841 ("perl-config-any" ,perl-config-any)
1842 ("perl-context-preserve" ,perl-context-preserve)
1843 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1844 ("perl-data-page" ,perl-data-page)
1845 ("perl-dbi" ,perl-dbi)
1846 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1847 ("perl-hash-merge" ,perl-hash-merge)
1848 ("perl-module-find" ,perl-module-find)
1849 ("perl-moo" ,perl-moo)
1850 ("perl-mro-compat" ,perl-mro-compat)
1851 ("perl-namespace-clean" ,perl-namespace-clean)
1852 ("perl-path-class" ,perl-path-class)
1853 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1854 ("perl-scope-guard" ,perl-scope-guard)
1855 ("perl-sql-abstract-classic" ,perl-sql-abstract-classic)
1856 ("perl-sub-name" ,perl-sub-name)
1857 ("perl-text-balanced" ,perl-text-balanced)
1858 ("perl-try-tiny" ,perl-try-tiny)))
1859 (home-page "https://metacpan.org/release/DBIx-Class")
1860 (synopsis "Extensible and flexible object <-> relational mapper")
1861 (description "An SQL to OO mapper with an object API inspired by
1862 Class::DBI (with a compatibility layer as a springboard for porting) and a
1863 resultset API that allows abstract encapsulation of database operations. It
1864 aims to make representing queries in your code as perl-ish as possible while
1865 still providing access to as many of the capabilities of the database as
1866 possible, including retrieving related records from multiple tables in a
1867 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1868 \"ORDER BY\" and \"HAVING\" support.")
1869 (license license:perl-license)))
1870
1871 (define-public perl-dbix-class-cursor-cached
1872 (package
1873 (name "perl-dbix-class-cursor-cached")
1874 (version "1.001004")
1875 (source
1876 (origin
1877 (method url-fetch)
1878 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1879 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1880 (sha256
1881 (base32
1882 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
1883 (build-system perl-build-system)
1884 (native-inputs
1885 `(("perl-cache-cache" ,perl-cache-cache)
1886 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1887 ("perl-module-install" ,perl-module-install)))
1888 (propagated-inputs
1889 `(("perl-carp-clan" ,perl-carp-clan)
1890 ("perl-dbix-class" ,perl-dbix-class)))
1891 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
1892 (synopsis "Cursor with built-in caching support")
1893 (description "DBIx::Class::Cursor::Cached provides a cursor class with
1894 built-in caching support.")
1895 (license license:perl-license)))
1896
1897 (define-public perl-dbix-class-introspectablem2m
1898 (package
1899 (name "perl-dbix-class-introspectablem2m")
1900 (version "0.001002")
1901 (source
1902 (origin
1903 (method url-fetch)
1904 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1905 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1906 (sha256
1907 (base32
1908 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
1909 (build-system perl-build-system)
1910 (native-inputs
1911 `(("perl-module-install" ,perl-module-install)))
1912 (propagated-inputs
1913 `(("perl-dbix-class" ,perl-dbix-class)))
1914 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
1915 (synopsis "Introspect many-to-many relationships")
1916 (description "Because the many-to-many relationships are not real
1917 relationships, they can not be introspected with DBIx::Class. Many-to-many
1918 relationships are actually just a collection of convenience methods installed
1919 to bridge two relationships. This DBIx::Class component can be used to store
1920 all relevant information about these non-relationships so they can later be
1921 introspected and examined.")
1922 (license license:perl-license)))
1923
1924 (define-public perl-dbix-class-schema-loader
1925 (package
1926 (name "perl-dbix-class-schema-loader")
1927 (version "0.07049")
1928 (source
1929 (origin
1930 (method url-fetch)
1931 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1932 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1933 (sha256
1934 (base32
1935 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
1936 (build-system perl-build-system)
1937 (native-inputs
1938 `(("perl-config-any" ,perl-config-any)
1939 ("perl-config-general" ,perl-config-general)
1940 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1941 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
1942 ("perl-module-install" ,perl-module-install)
1943 ("perl-moose" ,perl-moose)
1944 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1945 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1946 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1947 ("perl-test-deep" ,perl-test-deep)
1948 ("perl-test-differences" ,perl-test-differences)
1949 ("perl-test-exception" ,perl-test-exception)
1950 ("perl-test-pod" ,perl-test-pod)
1951 ("perl-test-warn" ,perl-test-warn)))
1952 (propagated-inputs
1953 `(("perl-class-unload" ,perl-class-unload)
1954 ("perl-class-inspector" ,perl-class-inspector)
1955 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1956 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1957 ("perl-carp-clan" ,perl-carp-clan)
1958 ("perl-data-dump" ,perl-data-dump)
1959 ("perl-dbix-class" ,perl-dbix-class)
1960 ("perl-hash-merge" ,perl-hash-merge)
1961 ("perl-list-moreutils" ,perl-list-moreutils)
1962 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1963 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1964 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1965 ("perl-namespace-clean" ,perl-namespace-clean)
1966 ("perl-mro-compat" ,perl-mro-compat)
1967 ("perl-scope-guard" ,perl-scope-guard)
1968 ("perl-string-camelcase" ,perl-string-camelcase)
1969 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1970 ("perl-sub-name" ,perl-sub-name)
1971 ("perl-try-tiny" ,perl-try-tiny)))
1972 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
1973 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
1974 (synopsis "Create a DBIx::Class::Schema based on a database")
1975 (description "DBIx::Class::Schema::Loader automates the definition of a
1976 DBIx::Class::Schema by scanning database table definitions and setting up the
1977 columns, primary keys, unique constraints and relationships.")
1978 (license license:perl-license)))
1979
1980 (define-public perl-dbd-pg
1981 (package
1982 (name "perl-dbd-pg")
1983 (version "3.7.4")
1984 (source
1985 (origin
1986 (method url-fetch)
1987 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1988 "DBD-Pg-" version ".tar.gz"))
1989 (sha256
1990 (base32
1991 "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
1992 (build-system perl-build-system)
1993 (native-inputs
1994 `(("perl-dbi" ,perl-dbi)))
1995 (propagated-inputs
1996 `(("perl-dbi" ,perl-dbi)
1997 ("postgresql" ,postgresql)))
1998 (home-page "https://metacpan.org/release/DBD-Pg")
1999 (synopsis "DBI PostgreSQL interface")
2000 (description "This package provides a PostgreSQL driver for the Perl5
2001 @dfn{Database Interface} (DBI).")
2002 (license license:perl-license)))
2003
2004 (define-public perl-dbd-mysql
2005 (package
2006 (name "perl-dbd-mysql")
2007 (version "4.050")
2008 (source
2009 (origin
2010 (method url-fetch)
2011 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
2012 "DBD-mysql-" version ".tar.gz"))
2013 (sha256
2014 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
2015 (build-system perl-build-system)
2016 (arguments
2017 `(#:phases
2018 (modify-phases %standard-phases
2019 (add-before 'configure 'skip-library-detection
2020 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
2021 ;; are really only needed for the test suite; their absence does not
2022 ;; affect the build or the end result.
2023 (lambda _
2024 (substitute* "Makefile.PL"
2025 (("use Devel::CheckLib;" match)
2026 (string-append "# " match))
2027 (("assert_lib")
2028 "print"))
2029 #t)))
2030 ;; Tests require running MySQL server.
2031 #:tests? #f))
2032 (propagated-inputs
2033 `(("perl-dbi" ,perl-dbi)
2034 ("mysql" ,mariadb "lib")
2035 ("mysql-dev" ,mariadb "dev")))
2036 (home-page "https://metacpan.org/release/DBD-mysql")
2037 (synopsis "DBI MySQL interface")
2038 (description "This package provides a MySQL driver for the Perl5
2039 @dfn{Database Interface} (DBI).")
2040 (license license:perl-license)))
2041
2042 (define-public perl-dbd-sqlite
2043 (package
2044 (name "perl-dbd-sqlite")
2045 (version "1.66")
2046 (source (origin
2047 (method url-fetch)
2048 (uri (string-append
2049 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
2050 version ".tar.gz"))
2051 (sha256
2052 (base32
2053 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
2054 (build-system perl-build-system)
2055 (inputs `(("sqlite" ,sqlite)))
2056 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
2057 (synopsis "SQlite interface for Perl")
2058 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
2059 the entire thing in the distribution. So in order to get a fast transaction
2060 capable RDBMS working for your Perl project you simply have to install this
2061 module, and nothing else.")
2062 (license license:perl-license)
2063 (home-page "https://metacpan.org/release/DBD-SQLite")))
2064
2065 (define-public perl-mysql-config
2066 (package
2067 (name "perl-mysql-config")
2068 (version "1.04")
2069 (source
2070 (origin
2071 (method url-fetch)
2072 (uri (string-append
2073 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
2074 version
2075 ".tar.gz"))
2076 (sha256
2077 (base32
2078 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
2079 (build-system perl-build-system)
2080 (home-page "https://metacpan.org/release/MySQL-Config")
2081 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
2082 (description
2083 "@code{MySQL::Config} emulates the @code{load_defaults} function from
2084 libmysqlclient. It will fill an array with long options, ready to be parsed by
2085 @code{Getopt::Long}.")
2086 (license license:perl-license)))
2087
2088 (define-public perl-sql-abstract
2089 (package
2090 (name "perl-sql-abstract")
2091 (version "1.87")
2092 (source
2093 (origin
2094 (method url-fetch)
2095 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
2096 "SQL-Abstract-" version ".tar.gz"))
2097 (sha256
2098 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9"))))
2099 (build-system perl-build-system)
2100 (native-inputs
2101 `(("perl-module-install" ,perl-module-install)
2102 ("perl-test-deep" ,perl-test-deep)
2103 ("perl-test-exception" ,perl-test-exception)
2104 ("perl-test-warn" ,perl-test-warn)))
2105 (propagated-inputs
2106 `(("perl-hash-merge" ,perl-hash-merge)
2107 ("perl-moo" ,perl-moo)
2108 ("perl-mro-compat" ,perl-mro-compat)
2109 ("perl-text-balanced" ,perl-text-balanced)))
2110 (home-page "https://metacpan.org/release/SQL-Abstract")
2111 (synopsis "Generate SQL from Perl data structures")
2112 (description "This module was inspired by the excellent DBIx::Abstract.
2113 While based on the concepts used by DBIx::Abstract, the concepts used have
2114 been modified to make the SQL easier to generate from Perl data structures.
2115 The underlying idea is for this module to do what you mean, based on the data
2116 structures you provide it, so that you don't have to modify your code every
2117 time your data changes.")
2118 (license license:perl-license)))
2119
2120 (define-public perl-sql-abstract-classic
2121 (package
2122 (name "perl-sql-abstract-classic")
2123 (version "1.91")
2124 (source
2125 (origin
2126 (method url-fetch)
2127 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
2128 "SQL-Abstract-Classic-" version ".tar.gz"))
2129 (sha256
2130 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
2131 (build-system perl-build-system)
2132 (native-inputs
2133 `(("perl-test-deep" ,perl-test-deep)
2134 ("perl-test-exception" ,perl-test-exception)
2135 ("perl-test-warn" ,perl-test-warn)))
2136 (propagated-inputs
2137 `(("perl-mro-compat" ,perl-mro-compat)
2138 ("perl-sql-abstract" ,perl-sql-abstract)))
2139 (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
2140 (synopsis "Generate SQL from Perl data structures")
2141 (description
2142 "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
2143 to preserve the ability of users to opt into the new way of doing things in
2144 later versions according to their own schedules.
2145
2146 It is an abstract SQL generation module based on the concepts used by
2147 @code{DBIx::Abstract}, with several important differences, especially when it
2148 comes to @code{WHERE} clauses. These concepts were modified to make the SQL
2149 easier to generate from Perl data structures.
2150
2151 The underlying idea is for this module to do what you mean, based on the data
2152 structures you provide it. You shouldn't have to modify your code every time
2153 your data changes, as this module figures it out.")
2154 (license license:perl-license)))
2155
2156 (define-public perl-sql-splitstatement
2157 (package
2158 (name "perl-sql-splitstatement")
2159 (version "1.00020")
2160 (source
2161 (origin
2162 (method url-fetch)
2163 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
2164 "SQL-SplitStatement-" version ".tar.gz"))
2165 (sha256
2166 (base32
2167 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
2168 (build-system perl-build-system)
2169 (native-inputs
2170 `(("perl-test-exception" ,perl-test-exception)))
2171 (propagated-inputs
2172 `(("perl-class-accessor" ,perl-class-accessor)
2173 ("perl-list-moreutils" ,perl-list-moreutils)
2174 ("perl-regexp-common" ,perl-regexp-common)
2175 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
2176 (home-page "https://metacpan.org/release/SQL-SplitStatement")
2177 (synopsis "Split SQL code into atomic statements")
2178 (description "This module tries to split any SQL code, even including
2179 non-standard extensions, into the atomic statements it is composed of.")
2180 (license license:perl-license)))
2181
2182 (define-public perl-sql-tokenizer
2183 (package
2184 (name "perl-sql-tokenizer")
2185 (version "0.24")
2186 (source
2187 (origin
2188 (method url-fetch)
2189 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
2190 "SQL-Tokenizer-" version ".tar.gz"))
2191 (sha256
2192 (base32
2193 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
2194 (build-system perl-build-system)
2195 (home-page "https://metacpan.org/release/SQL-Tokenizer")
2196 (synopsis "SQL tokenizer")
2197 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
2198 claim to be a parser or query verifier. It just creates sane tokens from a
2199 valid SQL query.")
2200 (license license:perl-license)))
2201
2202 (define-public unixodbc
2203 (package
2204 (name "unixodbc")
2205 (version "2.3.9")
2206 (source (origin
2207 (method url-fetch)
2208 (uri
2209 (string-append
2210 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
2211 version ".tar.gz"))
2212 (sha256
2213 (base32 "01xj65d02i3yjy7p9z08y9jakcs5szmz4rask868n7387nn3x0sj"))))
2214 (build-system gnu-build-system)
2215 (synopsis "Data source abstraction library")
2216 (description "Unixodbc is a library providing an API with which to access
2217 data sources. Data sources include SQL Servers and any software with an ODBC
2218 Driver.")
2219 (license license:lgpl2.1+)
2220 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
2221 (home-page "http://www.unixodbc.org")))
2222
2223 (define-public unqlite
2224 (package
2225 (name "unqlite")
2226 (version "1.1.6")
2227 (source (origin
2228 (method url-fetch)
2229 ;; Contains bug fixes against the official release, and has an
2230 ;; autotooled build system.
2231 (uri (string-append "https://github.com/aidin36/tocc/releases/"
2232 "download/v1.0.0/"
2233 "unqlite-unofficial-" version ".tar.gz"))
2234 (sha256
2235 (base32
2236 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
2237 (build-system gnu-build-system)
2238 (arguments `(#:tests? #f)) ;No check target
2239 (home-page "https://www.unqlite.org")
2240 (synopsis "In-memory key/value and document store")
2241 (description
2242 "UnQLite is an in-process software library which implements a
2243 self-contained, serverless, zero-configuration, transactional NoSQL
2244 database engine. UnQLite is a document store database similar to
2245 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
2246 similar to BerkeleyDB, LevelDB, etc.")
2247 (license license:bsd-2)))
2248
2249 (define-public redis
2250 (package
2251 (name "redis")
2252 (version "6.0.10")
2253 (source (origin
2254 (method url-fetch)
2255 (uri (string-append "http://download.redis.io/releases/redis-"
2256 version".tar.gz"))
2257 (sha256
2258 (base32
2259 "1gc529nfh8frk4pynyjlnmzvwa0j9r5cmqwyd7537sywz6abifvr"))
2260 (modules '((guix build utils)))
2261 (snippet
2262 ;; Delete bundled jemalloc, as the package will use the libc one
2263 '(begin (delete-file-recursively "deps/jemalloc")
2264 #t))))
2265 (build-system gnu-build-system)
2266 (native-inputs
2267 `(("procps" ,procps) ; for tests
2268 ("tcl" ,tcl))) ; for tests
2269 (arguments
2270 '(#:phases
2271 (modify-phases %standard-phases
2272 (delete 'configure)
2273 (add-after 'unpack 'use-correct-tclsh
2274 (lambda* (#:key inputs #:allow-other-keys)
2275 (substitute* "runtest"
2276 (("^TCLSH=.*")
2277 (string-append "TCLSH="
2278 (assoc-ref inputs "tcl")
2279 "/bin/tclsh")))
2280 #t))
2281 (add-after 'unpack 'adjust-tests
2282 (lambda _
2283 ;; Disable failing tests
2284 (substitute* "tests/test_helper.tcl"
2285 ((" integration/replication[^-]") "")
2286 ((" integration/replication-4") "")
2287 ((" integration/replication-psync") ""))
2288 #t)))
2289 #:make-flags `("CC=gcc"
2290 "MALLOC=libc"
2291 "LDFLAGS=-ldl"
2292 ,(string-append "PREFIX="
2293 (assoc-ref %outputs "out")))))
2294 (synopsis "Key-value cache and store")
2295 (description "Redis is an advanced key-value cache and store. Redis
2296 supports many data structures including strings, hashes, lists, sets, sorted
2297 sets, bitmaps and hyperloglogs.")
2298 (home-page "https://redis.io/")
2299 (license license:bsd-3)))
2300
2301 (define-public kyotocabinet
2302 (package
2303 (name "kyotocabinet")
2304 (version "1.2.79")
2305 (source (origin
2306 (method url-fetch)
2307 (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
2308 "kyotocabinet-" version ".tar.gz"))
2309 (sha256
2310 (base32
2311 "079ymsahlrijswgwfr2la9yw5h57l752cprhp5dz31iamsj1vyv7"))))
2312 (build-system gnu-build-system)
2313 (arguments
2314 `(#:configure-flags
2315 (list
2316 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
2317 (string-append "LDFLAGS=-Wl,-rpath="
2318 (assoc-ref %outputs "out") "/lib"))))
2319 (inputs `(("zlib" ,zlib)))
2320 (home-page "https://fallabs.com/kyotocabinet/")
2321 (synopsis
2322 "Kyoto Cabinet is a modern implementation of the DBM database")
2323 (description
2324 "Kyoto Cabinet is a standalone file-based database that supports Hash
2325 and B+ Tree data storage models. It is a fast key-value lightweight
2326 database and supports many programming languages. It is a NoSQL database.")
2327 (license license:gpl3+)))
2328
2329 (define-public tokyocabinet
2330 (package
2331 (name "tokyocabinet")
2332 (version "1.4.48")
2333 (source
2334 (origin
2335 (method url-fetch)
2336 (uri (string-append "http://fallabs.com/tokyocabinet/"
2337 name "-" version ".tar.gz"))
2338 (sha256
2339 (base32
2340 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
2341 (build-system gnu-build-system)
2342 (arguments
2343 `(#:configure-flags
2344 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
2345 (string-append "LDFLAGS=-Wl,-rpath="
2346 (assoc-ref %outputs "out") "/lib"))))
2347 (inputs
2348 `(("zlib" ,zlib)))
2349 (home-page "http://fallabs.com/tokyocabinet/")
2350 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
2351 (description
2352 "Tokyo Cabinet is a library of routines for managing a database.
2353 The database is a simple data file containing records, each is a pair of a
2354 key and a value. Every key and value is serial bytes with variable length.
2355 Both binary data and character string can be used as a key and a value.
2356 There is neither concept of data tables nor data types. Records are
2357 organized in hash table, B+ tree, or fixed-length array.")
2358 (license license:lgpl2.1+)))
2359
2360 (define-public wiredtiger
2361 (package
2362 (name "wiredtiger")
2363 (version "2.9.1")
2364 (source (origin
2365 (method url-fetch)
2366 (uri (string-append
2367 "http://source.wiredtiger.com/releases/wiredtiger-"
2368 version ".tar.bz2"))
2369 (sha256
2370 (base32
2371 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
2372 (build-system gnu-build-system)
2373 (arguments
2374 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
2375 #:phases
2376 (modify-phases %standard-phases
2377 (add-before 'check 'disable-test/fops
2378 (lambda _
2379 ;; XXX: timed out after 3600 seconds of silence
2380 (substitute* "Makefile"
2381 (("test/fops") ""))
2382 #t)))))
2383 (inputs
2384 `(("lz4" ,lz4)
2385 ("zlib" ,zlib)
2386 ("snappy" ,snappy)))
2387 (home-page "http://source.wiredtiger.com/")
2388 (synopsis "NoSQL data engine")
2389 (description
2390 "WiredTiger is an extensible platform for data management. It supports
2391 row-oriented storage (where all columns of a row are stored together),
2392 column-oriented storage (where columns are stored in groups, allowing for
2393 more efficient access and storage of column subsets) and log-structured merge
2394 trees (LSM), for sustained throughput under random insert workloads.")
2395 (license license:gpl3) ; or GPL-2
2396 ;; configure.ac: WiredTiger requires a 64-bit build.
2397 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
2398
2399 (define-public wiredtiger-3
2400 (package
2401 (inherit wiredtiger)
2402 (name "wiredtiger")
2403 (version "3.1.0")
2404 (source (origin
2405 (method url-fetch)
2406 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
2407 version ".tar.bz2"))
2408 (sha256
2409 (base32
2410 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
2411
2412 (define-public guile-wiredtiger
2413 (package
2414 (name "guile-wiredtiger")
2415 (version "0.7.0")
2416 (source (origin
2417 (method git-fetch)
2418 (uri (git-reference
2419 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
2420 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
2421 (file-name (string-append name "-" version "-checkout"))
2422 (sha256
2423 (base32
2424 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
2425 (build-system gnu-build-system)
2426 (arguments
2427 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
2428 #:configure-flags
2429 (list (string-append "--with-libwiredtiger-prefix="
2430 (assoc-ref %build-inputs "wiredtiger")))
2431 #:make-flags '("GUILE_AUTO_COMPILE=0")))
2432 (native-inputs
2433 `(("autoconf" ,autoconf)
2434 ("automake" ,automake)
2435 ("pkg-config" ,pkg-config)))
2436 (inputs
2437 `(("wiredtiger" ,wiredtiger-3)
2438 ("guile" ,guile-2.2)))
2439 (propagated-inputs
2440 `(("guile-bytestructures" ,guile-bytestructures)))
2441 (synopsis "WiredTiger bindings for GNU Guile")
2442 (description
2443 "This package provides Guile bindings to the WiredTiger ``NoSQL''
2444 database.")
2445 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
2446 (license license:gpl3+)))
2447
2448 (define-public perl-db-file
2449 (package
2450 (name "perl-db-file")
2451 (version "1.855")
2452 (source
2453 (origin
2454 (method url-fetch)
2455 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
2456 version ".tar.gz"))
2457 (sha256
2458 (base32 "0q599h7g4jkzks5dxf1zifx9k7l9vif26r2dlgkzxkg6bfif5zyr"))))
2459 (build-system perl-build-system)
2460 (inputs `(("bdb" ,bdb)))
2461 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
2462 (arguments
2463 `(#:phases (modify-phases %standard-phases
2464 (add-before
2465 'configure 'modify-config.in
2466 (lambda* (#:key inputs #:allow-other-keys)
2467 (substitute* "config.in"
2468 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
2469 #t)))))
2470 (home-page "https://metacpan.org/release/DB_File")
2471 (synopsis "Perl5 access to Berkeley DB version 1.x")
2472 (description
2473 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
2474 (license license:perl-license)))
2475
2476 (define-public lmdb
2477 (package
2478 (name "lmdb")
2479 (version "0.9.27")
2480 (source
2481 (origin
2482 (method git-fetch)
2483 (uri (git-reference
2484 (url "https://git.openldap.org/openldap/openldap.git")
2485 (commit (string-append "LMDB_" version))))
2486 (file-name (git-file-name name version))
2487 (sha256
2488 (base32 "09xqqm8yjsf1gv4gd4llal48sms76hfhxadx6rik1j2g5v3d3f1k"))))
2489 (build-system gnu-build-system)
2490 (arguments
2491 `(#:test-target "test"
2492 #:phases
2493 (modify-phases %standard-phases
2494 (replace 'configure
2495 (lambda* (#:key outputs #:allow-other-keys)
2496 (chdir "libraries/liblmdb")
2497 (substitute* "Makefile"
2498 (("/usr/local") (assoc-ref outputs "out")))
2499 #t))
2500 (add-after 'install 'create-pkg-config-file
2501 (lambda* (#:key outputs #:allow-other-keys)
2502 (let ((out (assoc-ref outputs "out")))
2503 (mkdir-p (string-append out "/lib/pkgconfig"))
2504 (with-output-to-file (string-append out "/lib/pkgconfig/liblmdb.pc")
2505 (lambda _
2506 (format #t "prefix=~a~@
2507 exec_prefix=~a~@
2508 libdir=~a/lib~@
2509 includedir=~a/include~@
2510 ~@
2511 Name: liblmdb~@
2512 Version: ~a~@
2513 Description: Lightning Memory-Mapped Database library~@
2514 Libs: -L${libdir} -llmdb~@
2515 Cflags: -I${includedir}~%"
2516 out out out out ,version)))
2517 #t))))))
2518 (home-page "https://symas.com/lmdb/")
2519 (synopsis "Lightning Memory-Mapped Database library")
2520 (description
2521 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
2522 transactional database. Unlike more complex relational databases, LMDB handles
2523 only key-value pairs (stored as arbitrary byte arrays) and relies on the
2524 underlying operating system for caching and locking, keeping the code small and
2525 simple.
2526 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
2527 disk-based databases with high read performance that scales linearly over
2528 multiple cores. The size of each database is limited only by the size of the
2529 virtual address space — not physical RAM.")
2530 (license license:openldap2.8)))
2531
2532 (define-public lmdbxx
2533 (package
2534 (name "lmdbxx")
2535 (version "0.9.14.0")
2536 (source
2537 (origin
2538 (method git-fetch)
2539 (uri (git-reference
2540 (url "https://github.com/drycpp/lmdbxx")
2541 (commit version)))
2542 (file-name (git-file-name name version))
2543 (sha256
2544 (base32 "1jmb9wg2iqag6ps3z71bh72ymbcjrb6clwlkgrqf1sy80qwvlsn6"))))
2545 (arguments
2546 `(#:make-flags
2547 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
2548 #:phases
2549 (modify-phases %standard-phases
2550 (delete 'configure))))
2551 (build-system gnu-build-system)
2552 (inputs `(("lmdb" ,lmdb)))
2553 (home-page "http://lmdbxx.sourceforge.net")
2554 (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library")
2555 (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the
2556 @code{LMDB} embedded database library, offering both an error-checked
2557 procedural interface and an object-oriented resource interface with RAII
2558 semantics.")
2559 (license license:unlicense)))
2560
2561 (define-public libpqxx
2562 (package
2563 (name "libpqxx")
2564 (version "4.0.1")
2565 (source (origin
2566 (method url-fetch)
2567 (uri (string-append
2568 "http://pqxx.org/download/software/libpqxx/"
2569 name "-" version ".tar.gz"))
2570 (sha256
2571 (base32
2572 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
2573 (build-system gnu-build-system)
2574 (native-inputs
2575 `(("python" ,python-2)))
2576 (inputs `(("postgresql" ,postgresql)))
2577 (arguments
2578 `(#:tests? #f ; # FAIL: 1
2579 #:phases
2580 (modify-phases %standard-phases
2581 (add-before 'configure 'fix-sed-command
2582 (lambda _
2583 ;; Newer sed versions error out if double brackets are not used.
2584 (substitute* "configure"
2585 (("\\[:space:\\]") "[[:space:]]"))
2586 #t)))))
2587 (synopsis "C++ connector for PostgreSQL")
2588 (description
2589 "Libpqxx is a C++ library to enable user programs to communicate with the
2590 PostgreSQL database back-end. The database back-end can be local or it may be
2591 on another machine, accessed via TCP/IP.")
2592 (home-page "http://pqxx.org/")
2593 (license license:bsd-3)))
2594
2595 (define-public python-peewee
2596 (package
2597 (name "python-peewee")
2598 (version "3.14.0")
2599 (source
2600 (origin
2601 (method url-fetch)
2602 (uri (pypi-uri "peewee" version))
2603 (sha256
2604 (base32 "1yl49gxrg0c2x3n3r60z3lixw9am8b61s0477l9vjabhhx1yziar"))))
2605 (build-system python-build-system)
2606 (arguments
2607 `(#:tests? #f)) ; fails to import test data
2608 (inputs
2609 `(("sqlite" ,sqlite)))
2610 (native-inputs
2611 `(("python-cython" ,python-cython)))
2612 (home-page "https://github.com/coleifer/peewee/")
2613 (synopsis "Small object-relational mapping utility")
2614 (description
2615 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
2616 handles converting between pythonic values and those used by databases, so you
2617 can use Python types in your code without having to worry. It has built-in
2618 support for sqlite, mysql and postgresql. If you already have a database, you
2619 can autogenerate peewee models using @code{pwiz}, a model generator.")
2620 (license license:expat)))
2621
2622 (define-public python2-peewee
2623 (package-with-python2 python-peewee))
2624
2625 (define-public python-tortoise-orm
2626 (package
2627 (name "python-tortoise-orm")
2628 (version "0.16.7")
2629 (source
2630 (origin
2631 (method url-fetch)
2632 (uri (pypi-uri "tortoise-orm" version))
2633 (sha256
2634 (base32
2635 "0wr7p4v0b16ypm9fcpwpl99kf491m6w3jkd13xcsgq13fy73fbqc"))))
2636 (build-system python-build-system)
2637 ;; Disable tests for now. They pull in a lot of dependencies.
2638 (arguments `(#:tests? #f))
2639 (native-inputs
2640 `(("python-asynctest" ,python-asynctest)
2641 ("python-nose2" ,python-nose2)))
2642 (propagated-inputs
2643 `(("python-aiosqlite" ,python-aiosqlite)
2644 ("python-pypika" ,python-pypika)
2645 ("python-ciso8601" ,python-ciso8601)
2646 ("python-typing-extensions"
2647 ,python-typing-extensions)))
2648 (home-page
2649 "https://github.com/tortoise/tortoise-orm")
2650 (synopsis
2651 "Easy async ORM for python, built with relations in mind")
2652 (description
2653 "Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper)
2654 inspired by Django. Tortoise ORM was build with relations in mind and
2655 admiration for the excellent and popular Django ORM. It’s engraved in its
2656 design that you are working not with just tables, you work with relational
2657 data.")
2658 (license license:asl2.0)))
2659
2660 (define-public sqlcipher
2661 (package
2662 (name "sqlcipher")
2663 (version "3.4.2")
2664 (source
2665 (origin
2666 (method url-fetch)
2667 (uri (string-append "https://github.com/sqlcipher/" name
2668 "/archive/v" version ".tar.gz"))
2669 (sha256
2670 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
2671 (file-name (string-append name "-" version ".tar.gz"))))
2672 (build-system gnu-build-system)
2673 (inputs
2674 `(("libcrypto" ,openssl)
2675 ("libtcl8.6" ,tcl))) ; required for running the tests
2676 (native-inputs
2677 `(("tcl" ,tcl)))
2678 (arguments
2679 '(#:configure-flags
2680 '("--enable-tempstore=yes"
2681 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2682 "LDFLAGS=-lcrypto -ltcl8.6"
2683 "--disable-tcl")
2684 ;; tests cannot be run from the Makefile
2685 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2686 #:test-target "testfixture"
2687 #:phases
2688 (modify-phases %standard-phases
2689 (add-before 'check 'build-test-runner
2690 (assoc-ref %standard-phases 'check))
2691 (replace 'check
2692 (lambda _
2693 (invoke "./testfixture" "test/crypto.test"))))))
2694 (home-page "https://www.zetetic.net/sqlcipher/")
2695 (synopsis
2696 "Library providing transparent encryption of SQLite database files")
2697 (description "SQLCipher is an implementation of SQLite, extended to
2698 provide transparent 256-bit AES encryption of database files. Pages are
2699 encrypted before being written to disk and are decrypted when read back. It’s
2700 well suited for protecting embedded application databases and for mobile
2701 development.")
2702 ;; The source files
2703 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2704 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2705 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2706 ;; source files are in the public domain.
2707 (license (list license:public-domain license:bsd-3))))
2708
2709 (define-public python-pyodbc-c
2710 (package
2711 (name "python-pyodbc-c")
2712 (version "3.1.4")
2713 (source
2714 (origin
2715 (method url-fetch)
2716 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2717 "archive.tar.gz?ref=v" version))
2718 (sha256
2719 (base32
2720 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
2721 (file-name (string-append name "-" version ".tar.gz"))))
2722 (build-system python-build-system)
2723 (inputs
2724 `(("unixodbc" ,unixodbc)))
2725 (arguments
2726 `(;; No unit tests exist.
2727 #:tests? #f))
2728 (home-page "https://github.com/mkleehammer/pyodbc")
2729 (synopsis "Python ODBC Library")
2730 (description "@code{python-pyodbc-c} provides a Python DB-API driver
2731 for ODBC.")
2732 (license (license:x11-style "file://LICENSE.TXT"))))
2733
2734 (define-public python2-pyodbc-c
2735 (package-with-python2 python-pyodbc-c))
2736
2737 (define-public python-pyodbc
2738 (package
2739 (name "python-pyodbc")
2740 (version "4.0.30")
2741 (source
2742 (origin
2743 (method url-fetch)
2744 (uri (pypi-uri "pyodbc" version))
2745 (sha256
2746 (base32 "0skjpraar6hcwsy82612bpj8nw016ncyvvq88j5syrikxgp5saw5"))
2747 (file-name (string-append name "-" version ".tar.gz"))))
2748 (build-system python-build-system)
2749 (inputs
2750 `(("unixodbc" ,unixodbc)))
2751 (arguments
2752 `(#:tests? #f)) ; no unit tests exist
2753 (home-page "https://github.com/mkleehammer/pyodbc")
2754 (synopsis "Python ODBC Library")
2755 (description "@code{python-pyodbc} provides a Python DB-API driver
2756 for ODBC.")
2757 (license (license:x11-style "file:///LICENSE.TXT"))))
2758
2759 (define-public python2-pyodbc
2760 (package-with-python2 python-pyodbc))
2761
2762 (define-public mdbtools
2763 (package
2764 (name "mdbtools")
2765 (version "0.7.1")
2766 (source
2767 (origin
2768 (method git-fetch)
2769 (uri (git-reference
2770 (url "https://github.com/brianb/mdbtools")
2771 (commit version)))
2772 (file-name (git-file-name name version))
2773 (sha256
2774 (base32
2775 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
2776 (build-system gnu-build-system)
2777 (inputs
2778 `(("glib" ,glib)))
2779 (native-inputs
2780 `(("autoconf" ,autoconf)
2781 ("automake" ,automake)
2782 ("libtool" ,libtool)
2783 ("pkg-config" ,pkg-config)
2784 ("txt2man" ,txt2man)
2785 ("which" ,which)))
2786 (home-page "http://mdbtools.sourceforge.net/")
2787 (synopsis "Read Microsoft Access databases")
2788 (description "MDB Tools is a set of tools and applications to read the
2789 proprietary MDB file format used in Microsoft's Access database package. This
2790 includes programs to export schema and data from Microsoft's Access database
2791 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2792 etc., and an SQL engine for performing simple SQL queries.")
2793 (license (list license:lgpl2.0
2794 license:gpl2+))))
2795
2796 (define-public python-lmdb
2797 (package
2798 (name "python-lmdb")
2799 (version "1.0.0")
2800 (source (origin
2801 (method url-fetch)
2802 (uri (pypi-uri "lmdb" version))
2803 (sha256
2804 (base32
2805 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
2806 (modules '((guix build utils)))
2807 (snippet
2808 ;; Delete bundled lmdb source files.
2809 '(begin
2810 (for-each delete-file (list "lib/lmdb.h"
2811 "lib/mdb.c"
2812 "lib/midl.c"
2813 "lib/midl.h"))
2814 #t))))
2815 (build-system python-build-system)
2816 (inputs
2817 `(("lmdb" ,lmdb)))
2818 (arguments
2819 `(#:phases
2820 (modify-phases %standard-phases
2821 (add-before 'build 'use-system-lmdb
2822 (lambda* (#:key inputs #:allow-other-keys)
2823 (let ((lmdb (assoc-ref inputs "lmdb")))
2824 (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
2825 (setenv "LMDB_FORCE_SYSTEM" "set")
2826 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2827 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2828 #t))))
2829 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2830 #:tests? #f))
2831 (home-page "https://github.com/dw/py-lmdb")
2832 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2833 (description
2834 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2835 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2836 (license
2837 (list license:openldap2.8
2838 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2839 ;; but not actually needed on platforms currently supported by Guix.
2840 license:bsd-3))))
2841
2842 (define-public python-orator
2843 (package
2844 (name "python-orator")
2845 (version "0.9.9")
2846 (source (origin
2847 (method url-fetch)
2848 (uri (pypi-uri "orator" version))
2849 (sha256
2850 (base32
2851 "0mbgybz63ryhr9p1f4glnls5c57jp6il3dw0kf97f3pj80687rvg"))))
2852 (build-system python-build-system)
2853 ;; FIXME: Tests are not distributed with PyPI, and the repository
2854 ;; does not contain setup.py. How to test?
2855 (arguments '(#:tests? #f))
2856 (propagated-inputs
2857 `(("python-backpack" ,python-backpack)
2858 ("python-blinker" ,python-blinker)
2859 ("python-cleo" ,python-cleo)
2860 ("python-faker" ,python-faker)
2861 ("python-inflection" ,python-inflection)
2862 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2863 ("python-pendulum" ,python-pendulum)
2864 ("python-pyaml" ,python-pyaml)
2865 ("python-pygments" ,python-pygments)
2866 ("python-pyyaml" ,python-pyyaml)
2867 ("python-simplejson" ,python-simplejson)
2868 ("python-six" ,python-six)
2869 ("python-wrapt" ,python-wrapt)))
2870 (home-page "https://orator-orm.com/")
2871 (synopsis "ActiveRecord ORM for Python")
2872 (description
2873 "Orator provides a simple ActiveRecord-like Object Relational Mapping
2874 implementation for Python.")
2875 (license license:expat)
2876 (properties `((python2-variant . ,(delay python2-orator))))))
2877
2878 (define-public python2-orator
2879 (package-with-python2 (strip-python2-variant python-orator)))
2880
2881 (define-public virtuoso-ose
2882 (package
2883 (name "virtuoso-ose")
2884 (version "7.2.5")
2885 (source
2886 (origin
2887 (method url-fetch)
2888 (uri (string-append
2889 "https://github.com/openlink/virtuoso-opensource/releases/"
2890 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2891 (sha256
2892 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2893 (build-system gnu-build-system)
2894 (arguments
2895 `(#:tests? #f ; Tests require a network connection.
2896 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2897 ;; This indicates that the internal zlib code may still be used.
2898 #:configure-flags '("--without-internal-zlib"
2899 "--with-readline"
2900 "--enable-static=no")
2901 #:phases
2902 (modify-phases %standard-phases
2903 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
2904 ;; the build output. The following phase removes it.
2905 (add-after 'install 'remove-static-libs
2906 (lambda* (#:key outputs #:allow-other-keys)
2907 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2908 (for-each (lambda (file)
2909 (delete-file (string-append lib "/" file)))
2910 '("libvirtuoso-t.a"
2911 "libvirtuoso-t.la"))))))))
2912 (inputs
2913 `(("openssl" ,openssl-1.0)
2914 ("net-tools" ,net-tools)
2915 ("readline" ,readline)
2916 ("zlib" ,zlib)))
2917 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2918 (synopsis "Multi-model database system")
2919 (description "Virtuoso is a scalable cross-platform server that combines
2920 relational, graph, and document data management with web application server
2921 and web services platform functionality.")
2922 ;; configure: error: ... can only be build on 64bit platforms
2923 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2924 (license license:gpl2)))
2925
2926 (define-public python-ccm
2927 (package
2928 (name "python-ccm")
2929 (version "2.1.6")
2930 (source
2931 (origin
2932 (method url-fetch)
2933 (uri (pypi-uri "ccm" version))
2934 (sha256
2935 (base32
2936 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2937 (build-system python-build-system)
2938 (propagated-inputs
2939 `(("python-pyyaml" ,python-pyyaml)
2940 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2941 ;; functionality
2942 ("python-psutil" ,python-psutil)
2943 ("python-six" ,python-six)))
2944 (home-page "https://github.com/pcmanus/ccm")
2945 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2946 localhost")
2947 (description "Cassandra Cluster Manager is a development tool for testing
2948 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2949 on localhost.")
2950 (license license:asl2.0)))
2951
2952 (define-public python2-ccm
2953 (package-with-python2 python-ccm))
2954
2955 (define-public python2-pysqlite
2956 (package
2957 (name "python2-pysqlite")
2958 (version "2.8.3")
2959 (source
2960 (origin
2961 (method url-fetch)
2962 (uri (pypi-uri "pysqlite" version))
2963 (sha256
2964 (base32
2965 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2966 (build-system python-build-system)
2967 (inputs
2968 `(("sqlite" ,sqlite)))
2969 (arguments
2970 `(#:python ,python-2 ; incompatible with Python 3
2971 #:tests? #f)) ; no test target
2972 (home-page "https://github.com/ghaering/pysqlite")
2973 (synopsis "SQLite bindings for Python")
2974 (description
2975 "Pysqlite provides SQLite bindings for Python that comply to the
2976 Database API 2.0T.")
2977 (license license:zlib)))
2978
2979 (define-public python-sqlalchemy
2980 (package
2981 (name "python-sqlalchemy")
2982 (version "1.3.20")
2983 (source
2984 (origin
2985 (method url-fetch)
2986 (uri (pypi-uri "SQLAlchemy" version))
2987 (sha256
2988 (base32 "18b9am7bsqc4nj3d2h5r93i002apczxfvpfpcqbd6f0385zmrwnj"))))
2989 (build-system python-build-system)
2990 (native-inputs
2991 `(("python-cython" ,python-cython) ; for C extensions
2992 ("python-pytest" ,python-pytest)
2993 ("python-mock" ,python-mock))) ; for tests
2994 (arguments
2995 `(#:phases
2996 (modify-phases %standard-phases
2997 (replace 'check
2998 (lambda _ (invoke "py.test"))))))
2999 (home-page "https://www.sqlalchemy.org")
3000 (synopsis "Database abstraction library")
3001 (description
3002 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
3003 gives application developers the full power and flexibility of SQL. It
3004 provides a full suite of well known enterprise-level persistence patterns,
3005 designed for efficient and high-performing database access, adapted into a
3006 simple and Pythonic domain language.")
3007 (license license:x11)))
3008
3009 (define-public python2-sqlalchemy
3010 (package-with-python2 python-sqlalchemy))
3011
3012 (define-public python-sqlalchemy-utils
3013 (package
3014 (name "python-sqlalchemy-utils")
3015 (version "0.32.21")
3016 (source
3017 (origin
3018 (method url-fetch)
3019 (uri (pypi-uri "SQLAlchemy-Utils" version))
3020 (sha256
3021 (base32
3022 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
3023 (build-system python-build-system)
3024 (arguments
3025 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
3026 ;; #:phases
3027 ;; (modify-phases %standard-phases
3028 ;; (replace 'check
3029 ;; (lambda _
3030 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
3031 (propagated-inputs
3032 `(("python-six" ,python-six)
3033 ("python-sqlalchemy" ,python-sqlalchemy)))
3034 (native-inputs
3035 `(("python-dateutil" ,python-dateutil)
3036 ("python-flexmock" ,python-flexmock)
3037 ("python-psycopg2" ,python-psycopg2)
3038 ("python-pytest" ,python-pytest)
3039 ("python-pytz" ,python-pytz)))
3040 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
3041 (synopsis "Various utility functions for SQLAlchemy")
3042 (description
3043 "SQLAlchemy-utils provides various utility functions and custom data types
3044 for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
3045
3046 You might also want to install the following optional dependencies:
3047 @enumerate
3048 @item @code{python-passlib}
3049 @item @code{python-babel}
3050 @item @code{python-cryptography}
3051 @item @code{python-pytz}
3052 @item @code{python-psycopg2}
3053 @item @code{python-furl}
3054 @item @code{python-flask-babel}
3055 @end enumerate
3056 ")
3057 (license license:bsd-3)))
3058
3059 (define-public python2-sqlalchemy-utils
3060 (package-with-python2 python-sqlalchemy-utils))
3061
3062 (define-public python-alchemy-mock
3063 (package
3064 (name "python-alchemy-mock")
3065 (version "0.4.3")
3066 (home-page "https://github.com/miki725/alchemy-mock")
3067 (source (origin
3068 (method url-fetch)
3069 (uri (pypi-uri "alchemy-mock" version))
3070 (sha256
3071 (base32
3072 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
3073 (build-system python-build-system)
3074 (arguments
3075 '(#:phases (modify-phases %standard-phases
3076 (replace 'check
3077 (lambda _
3078 ;; Create pytest.ini that adds doctest options to
3079 ;; prevent test failure. Taken from tox.ini.
3080 (call-with-output-file "pytest.ini"
3081 (lambda (port)
3082 (format port "[pytest]
3083 doctest_optionflags=IGNORE_EXCEPTION_DETAIL
3084 ")))
3085 (invoke "pytest" "-vv" "--doctest-modules"
3086 "alchemy_mock/"))))))
3087 (native-inputs
3088 `(("python-mock" ,python-mock)
3089 ("python-pytest" ,python-pytest)))
3090 (propagated-inputs
3091 `(("python-six" ,python-six)
3092 ("python-sqlalchemy" ,python-sqlalchemy)))
3093 (synopsis "Mock helpers for SQLAlchemy")
3094 (description
3095 "This package provides mock helpers for SQLAlchemy that makes it easy
3096 to mock an SQLAlchemy session while preserving the ability to do asserts.
3097
3098 Normally Normally SQLAlchemy's expressions cannot be easily compared as
3099 comparison on binary expression produces yet another binary expression, but
3100 this library provides functions to facilitate such comparisons.")
3101 (license license:expat)))
3102
3103 (define-public python-alembic
3104 (package
3105 (name "python-alembic")
3106 (version "1.4.3")
3107 (source
3108 (origin
3109 (method url-fetch)
3110 (uri (pypi-uri "alembic" version))
3111 (sha256
3112 (base32 "0if2dgb088clk738p26bwk50735h6jpd2kacdgc5capv2hiz6d2k"))))
3113 (build-system python-build-system)
3114 (arguments
3115 '(#:phases (modify-phases %standard-phases
3116 (replace 'check
3117 (lambda _
3118 (invoke "pytest" "-vv"))))))
3119 (native-inputs
3120 `(("python-mock" ,python-mock)
3121 ("python-pytest-cov" ,python-pytest-cov)))
3122 (propagated-inputs
3123 `(("python-dateutil" ,python-dateutil)
3124 ("python-sqlalchemy" ,python-sqlalchemy)
3125 ("python-mako" ,python-mako)
3126 ("python-editor" ,python-editor)))
3127 (home-page "https://bitbucket.org/zzzeek/alembic")
3128 (synopsis "Database migration tool for SQLAlchemy")
3129 (description
3130 "Alembic is a lightweight database migration tool for usage with the
3131 SQLAlchemy Database Toolkit for Python.")
3132 (license license:expat)))
3133
3134 (define-public python2-alembic
3135 (package-with-python2 python-alembic))
3136
3137 (define-public python-pickleshare
3138 (package
3139 (name "python-pickleshare")
3140 (version "0.7.5")
3141 (source
3142 (origin
3143 (method url-fetch)
3144 (uri (pypi-uri "pickleshare" version))
3145 (sha256
3146 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
3147 (build-system python-build-system)
3148 (arguments
3149 `(#:phases (modify-phases %standard-phases
3150 (replace 'check
3151 (lambda _
3152 (invoke "pytest"))))))
3153 (native-inputs
3154 `(("python-pytest" ,python-pytest)))
3155 (home-page "https://github.com/vivainio/pickleshare")
3156 (synopsis "Tiny key value database with concurrency support")
3157 (description
3158 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
3159 Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
3160 shelve, many processes can access the database simultaneously. Changing a
3161 value in database is immediately visible to other processes accessing the same
3162 database. Concurrency is possible because the values are stored in separate
3163 files. Hence the “database” is a directory where all files are governed by
3164 PickleShare.")
3165 (properties `((python2-variant . ,(delay python2-pickleshare))))
3166 (license license:expat)))
3167
3168 (define-public python2-pickleshare
3169 (let ((pickleshare (package-with-python2
3170 (strip-python2-variant python-pickleshare))))
3171 (package (inherit pickleshare)
3172 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
3173 ,@(package-propagated-inputs pickleshare))))))
3174
3175 (define-public python-apsw
3176 (package
3177 (name "python-apsw")
3178 (version "3.31.1-r1")
3179 (source
3180 (origin
3181 (method url-fetch)
3182 (uri (string-append "https://github.com/rogerbinns/apsw/releases"
3183 "/download/" version "/apsw-" version ".zip"))
3184 (sha256
3185 (base32
3186 "1gap5lr6c7bp134nzvfwr693i6d0fqyaysg3ms2cayjldv616yfx"))))
3187 (build-system python-build-system)
3188 (native-inputs
3189 `(("unzip" ,unzip)))
3190 (inputs
3191 `(("sqlite" ,sqlite)))
3192 (arguments
3193 `(#:phases
3194 (modify-phases %standard-phases
3195 (replace 'build
3196 (lambda _
3197 (invoke "python" "setup.py" "build" "--enable-all-extensions")
3198 #t))
3199 (add-after 'build 'build-test-helper
3200 (lambda _
3201 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
3202 "-I." "-Isqlite3" "src/testextension.c")
3203 #t))
3204 (replace 'check
3205 (lambda* (#:key inputs outputs #:allow-other-keys)
3206 (add-installed-pythonpath inputs outputs)
3207 (invoke "python" "setup.py" "test")
3208 #t)))))
3209 (home-page "https://github.com/rogerbinns/apsw/")
3210 (synopsis "Another Python SQLite Wrapper")
3211 (description "APSW is a Python wrapper for the SQLite
3212 embedded relational database engine. In contrast to other wrappers such as
3213 pysqlite it focuses on being a minimal layer over SQLite attempting just to
3214 translate the complete SQLite API into Python.")
3215 (license license:zlib)))
3216
3217 (define-public python2-apsw
3218 (package-with-python2 python-apsw))
3219
3220 (define-public python-aiosqlite
3221 (package
3222 (name "python-aiosqlite")
3223 (version "0.12.0")
3224 (source
3225 (origin
3226 (method url-fetch)
3227 (uri (pypi-uri "aiosqlite" version))
3228 (sha256
3229 (base32
3230 "1w8248yz85xyzvvh4jaxnc59fqil45aka6h82kn1rcih4rjxbnn1"))))
3231 (build-system python-build-system)
3232 (native-inputs
3233 `(("python-aiounittest" ,python-aiounittest)))
3234 (home-page "https://github.com/jreese/aiosqlite")
3235 (synopsis
3236 "Asyncio bridge for sqlite3")
3237 (description
3238 "The package aiosqlite replicates the standard sqlite3 module, but with
3239 async versions of all the standard connection and cursor methods, and context
3240 managers for automatically closing connections.")
3241 (license license:expat)))
3242
3243 (define-public python2-neo4j-driver
3244 (package
3245 (name "python2-neo4j-driver")
3246 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
3247 (version "1.4.0")
3248 (source (origin
3249 (method url-fetch)
3250 (uri (pypi-uri "neo4j-driver" version))
3251 (sha256
3252 (base32
3253 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
3254 (build-system python-build-system)
3255 (arguments
3256 `(#:python ,python-2))
3257 (home-page "https://neo4j.com/developer/python/")
3258 (synopsis "Neo4j driver code written in Python")
3259 (description "This package provides the Neo4j Python driver that connects
3260 to the database using Neo4j's binary protocol. It aims to be minimal, while
3261 being idiomatic to Python.")
3262 (license license:asl2.0)))
3263
3264 (define-public python2-py2neo
3265 (package
3266 (name "python2-py2neo")
3267 (version "3.1.2")
3268 (source (origin
3269 (method url-fetch)
3270 (uri (pypi-uri "py2neo" version))
3271 (sha256
3272 (base32
3273 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
3274 (build-system python-build-system)
3275 (arguments
3276 `(#:python ,python-2))
3277 (home-page "https://py2neo.org")
3278 (synopsis "Library and toolkit for working with Neo4j in Python")
3279 (description "This package provides a client library and toolkit for
3280 working with Neo4j from within Python applications and from the command
3281 line. The core library has no external dependencies and has been carefully
3282 designed to be easy and intuitive to use.")
3283 (license license:asl2.0)))
3284
3285 (define-public python-psycopg2
3286 (package
3287 (name "python-psycopg2")
3288 (version "2.8.6")
3289 (source
3290 (origin
3291 (method url-fetch)
3292 (uri (pypi-uri "psycopg2" version))
3293 (sha256
3294 (base32 "0hzmk6b1hb5riqkljr5xics6p4zbvmis6knbczb7zhq7273zc8zv"))))
3295 (build-system python-build-system)
3296 (arguments
3297 ;; Tests would require a postgresql database "psycopg2_test"
3298 ;; and a running postgresql database management service.
3299 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
3300 (inputs
3301 `(("postgresql" ,postgresql))) ; libpq
3302 (home-page "http://initd.org/psycopg/")
3303 (synopsis "Python PostgreSQL adapter")
3304 (description
3305 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
3306 2.0.")
3307 (license license:lgpl3+)))
3308
3309 (define-public python2-psycopg2
3310 (package-with-python2 python-psycopg2))
3311
3312 (define-public python-sadisplay
3313 (package
3314 (name "python-sadisplay")
3315 (version "0.4.8")
3316 (source
3317 (origin
3318 (method url-fetch)
3319 (uri (pypi-uri "sadisplay" version))
3320 (sha256
3321 (base32
3322 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
3323 (build-system python-build-system)
3324 (propagated-inputs
3325 `(("python-sqlalchemy" ,python-sqlalchemy)))
3326 (native-inputs
3327 ;; For tests.
3328 `(("python-nose" ,python-nose)))
3329 (home-page "https://bitbucket.org/estin/sadisplay")
3330 (synopsis "SQLAlchemy schema displayer")
3331 (description "This package provides a program to build Entity
3332 Relationship diagrams from a SQLAlchemy model (or directly from the
3333 database).")
3334 (license license:bsd-3)))
3335
3336 (define-public python2-sadisplay
3337 (package-with-python2 python-sadisplay))
3338
3339 (define-public yoyo-migrations
3340 (package
3341 (name "yoyo-migrations")
3342 (version "7.2.0")
3343 (source
3344 (origin
3345 ;; We use the upstream repository, as the tests are not included in the
3346 ;; PyPI releases.
3347 (method hg-fetch)
3348 (uri (hg-reference
3349 (url "https://hg.sr.ht/~olly/yoyo")
3350 (changeset (string-append "v" version "-release"))))
3351 (file-name (string-append name "-" version "-checkout"))
3352 (sha256
3353 (base32 "0q2z9bgdj3wyix7yvqsayfs21grp5av8ilh411lgmjhigszkvhcq"))))
3354 (build-system python-build-system)
3355 (arguments
3356 ;; XXX: Tests require a connection to some pgsql database and psycopg
3357 ;; fails to connect to it.
3358 '(#:tests? #f))
3359 (propagated-inputs
3360 `(("python-sqlparse" ,python-sqlparse)
3361 ("python-tabulate" ,python-tabulate)))
3362 (home-page "https://ollycope.com/software/yoyo/latest/")
3363 (synopsis "Database migrations with SQL")
3364 (description
3365 "Yoyo is a database schema migration tool. Migrations are written as SQL
3366 files or Python scripts that define a list of migration steps.")
3367 (license license:asl2.0)))
3368
3369 (define-public python-mysqlclient
3370 (package
3371 (name "python-mysqlclient")
3372 (version "2.0.1")
3373 (source
3374 (origin
3375 (method url-fetch)
3376 (uri (pypi-uri "mysqlclient" version))
3377 (sha256
3378 (base32
3379 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
3380 (build-system python-build-system)
3381 (arguments '(#:tests? #f)) ;XXX: requires a live database
3382 (inputs
3383 `(("mysql-dev" ,mariadb "dev")))
3384 (home-page "https://github.com/PyMySQL/mysqlclient-python")
3385 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
3386 (description "MySQLdb is an interface to the popular MySQL database server
3387 for Python. The design goals are:
3388 @enumerate
3389 @item Compliance with Python database API version 2.0 [PEP-0249],
3390 @item Thread-safety,
3391 @item Thread-friendliness (threads will not block each other).
3392 @end enumerate")
3393 (license license:gpl2)))
3394
3395 (define-public python-hiredis
3396 (package
3397 (name "python-hiredis")
3398 (version "0.2.0")
3399 (source
3400 (origin
3401 (method url-fetch)
3402 (uri (pypi-uri "hiredis" version))
3403 (sha256
3404 (base32
3405 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
3406 (build-system python-build-system)
3407 (arguments
3408 ;; no tests
3409 `(#:tests? #f))
3410 (home-page "https://github.com/redis/hiredis-py")
3411 (synopsis "Python extension that wraps protocol parsing code in hiredis")
3412 (description "Python-hiredis is a python extension that wraps protocol
3413 parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
3414 (license license:bsd-3)))
3415
3416 (define-public python2-hiredis
3417 (package-with-python2 python-hiredis))
3418
3419 (define-public python-fakeredis
3420 (package
3421 (name "python-fakeredis")
3422 (version "1.2.1")
3423 (source
3424 (origin
3425 (method url-fetch)
3426 (uri (pypi-uri "fakeredis" version))
3427 (sha256
3428 (base32
3429 "1s12mn4q4hz7402139khn9fx56kibj7nn0d6w81hn0zs07b90wpc"))))
3430 (build-system python-build-system)
3431 (arguments
3432 ;; no tests
3433 `(#:tests? #f))
3434 (propagated-inputs
3435 `(("python-sortedcontainers" ,python-sortedcontainers)))
3436 (home-page "https://github.com/jamesls/fakeredis")
3437 (synopsis "Fake implementation of redis API for testing purposes")
3438 (description
3439 "Fakeredis is a pure-Python implementation of the redis-py Python client
3440 that simulates talking to a redis server. It was created for a single purpose:
3441 to write unit tests.
3442
3443 Setting up redis is not hard, but one often wants to write unit tests that don't
3444 talk to an external server such as redis. This module can be used as a
3445 reasonable substitute.")
3446 (license license:bsd-3)))
3447
3448 (define-public python2-fakeredis
3449 (package-with-python2 python-fakeredis))
3450
3451 (define-public python-redis
3452 (package
3453 (name "python-redis")
3454 (version "3.5.3")
3455 (source
3456 (origin
3457 (method url-fetch)
3458 (uri (pypi-uri "redis" version))
3459 (sha256
3460 (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
3461 (build-system python-build-system)
3462 ;; Tests require a running Redis server.
3463 (arguments '(#:tests? #f))
3464 ;; As long as we are not running test, we do not need this input :-)
3465 ;;(native-inputs
3466 ;; `(("python-pytest" ,python-pytest)))
3467 (home-page "https://github.com/andymccurdy/redis-py")
3468 (synopsis "Redis Python client")
3469 (description
3470 "This package provides a Python interface to the Redis key-value store.")
3471 (license license:expat)))
3472
3473 (define-public python2-redis
3474 (package-with-python2 python-redis))
3475
3476 (define-public python-rq
3477 (package
3478 (name "python-rq")
3479 (version "1.5.2")
3480 (source
3481 (origin
3482 (method git-fetch)
3483 (uri (git-reference
3484 (url "https://github.com/rq/rq")
3485 (commit (string-append "v" version))))
3486 (file-name (git-file-name name version))
3487 (sha256
3488 (base32 "0ikqmpq0g1qiqwd7ar1286l4hqjb6aj2wr844gihhb8ijzwhp8va"))))
3489 (build-system python-build-system)
3490 (arguments
3491 '(#:phases (modify-phases %standard-phases
3492 (add-before 'check 'start-redis
3493 (lambda _
3494 (invoke "redis-server" "--daemonize" "yes")))
3495 (replace 'check
3496 (lambda* (#:key outputs #:allow-other-keys)
3497 (let ((out (assoc-ref outputs "out")))
3498 ;; Drop test that needs the SDK for Sentry.io.
3499 (delete-file "tests/test_sentry.py")
3500 ;; Ensure 'rq' and 'rqworker' ends up on PATH.
3501 (setenv "PATH" (string-append out "/bin:"
3502 (getenv "PATH")))
3503 (invoke "pytest" "-vv")))))))
3504 (native-inputs
3505 `(("python-mock" ,python-mock)
3506 ("python-pytest" ,python-pytest)
3507 ("redis" ,redis)))
3508 (propagated-inputs
3509 `(("python-click" ,python-click)
3510 ("python-redis" ,python-redis)))
3511 (home-page "https://python-rq.org/")
3512 (synopsis "Simple job queues for Python")
3513 (description
3514 "RQ (Redis Queue) is a simple Python library for queueing jobs and
3515 processing them in the background with workers. It is backed by Redis and it
3516 is designed to have a low barrier to entry.")
3517 (license license:bsd-2)))
3518
3519 (define-public python2-rq
3520 (package-with-python2 python-rq))
3521
3522 (define-public python-rq-scheduler
3523 (package
3524 (name "python-rq-scheduler")
3525 (version "0.10.0")
3526 (home-page "https://github.com/rq/rq-scheduler")
3527 (source (origin
3528 (method git-fetch)
3529 (uri (git-reference
3530 (url home-page)
3531 (commit (string-append "v" version))))
3532 (file-name (git-file-name name version))
3533 (sha256
3534 (base32
3535 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
3536 (build-system python-build-system)
3537 (arguments
3538 '(#:phases (modify-phases %standard-phases
3539 (add-before 'check 'start-redis
3540 (lambda _
3541 (invoke "redis-server" "--daemonize" "yes")))
3542 (replace 'check
3543 (lambda _
3544 (substitute* "run_tests.py"
3545 (("/usr/bin/env")
3546 (which "env")))
3547 (invoke "./run_tests.py"))))))
3548 (native-inputs
3549 `(("redis" ,redis)
3550 ("which" ,which)))
3551 (propagated-inputs
3552 `(("python-croniter" ,python-croniter)
3553 ("python-rq" ,python-rq)))
3554 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
3555 (description
3556 "This package provides job scheduling capabilities to @code{python-rq}
3557 (Redis Queue).")
3558 (license license:expat)))
3559
3560 (define-public python-trollius-redis
3561 (package
3562 (name "python-trollius-redis")
3563 (version "0.1.4")
3564 (source
3565 (origin
3566 (method url-fetch)
3567 (uri (pypi-uri "trollius_redis" version))
3568 (sha256
3569 (base32
3570 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
3571 (build-system python-build-system)
3572 ;; TODO: Tests require packaging 'hiredis'.
3573 (arguments '(#:tests? #f))
3574 (home-page "https://github.com/benjolitz/trollius-redis")
3575 (synopsis "Port of asyncio-redis to trollius")
3576 (description "@code{trollius-redis} is a Redis client for Python
3577 trollius. It is an asynchronous IO (PEP 3156) implementation of the
3578 Redis protocol.")
3579 (license license:bsd-2)))
3580
3581 (define-public python2-trollius-redis
3582 (package-with-python2 python-trollius-redis))
3583
3584 (define-public python-sqlparse
3585 (package
3586 (name "python-sqlparse")
3587 (version "0.3.1")
3588 (source (origin
3589 (method url-fetch)
3590 (uri (pypi-uri "sqlparse" version))
3591 (sha256
3592 (base32
3593 "0j652a6z7bdf6c77aczfn8m8b2nsr1bcqq48wzghf8vi6wvj0qp1"))))
3594 (build-system python-build-system)
3595 (arguments
3596 `(#:phases
3597 (modify-phases %standard-phases
3598 (replace 'check
3599 (lambda _ (invoke "py.test"))))))
3600 (native-inputs
3601 `(("python-pytest" ,python-pytest)))
3602 (home-page "https://github.com/andialbrecht/sqlparse")
3603 (synopsis "Non-validating SQL parser")
3604 (description "Sqlparse is a non-validating SQL parser for Python. It
3605 provides support for parsing, splitting and formatting SQL statements.")
3606 (license license:bsd-3)))
3607
3608 (define-public python2-sqlparse
3609 (package-with-python2 python-sqlparse))
3610
3611 (define-public python-sql
3612 (package
3613 (name "python-sql")
3614 (version "1.0.0")
3615 (source
3616 (origin
3617 (method url-fetch)
3618 (uri (pypi-uri "python-sql" version))
3619 (sha256
3620 (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
3621 (build-system python-build-system)
3622 (home-page "https://python-sql.tryton.org/")
3623 (synopsis "Library to write SQL queries in a pythonic way")
3624 (description "@code{python-sql} is a library to write SQL queries, that
3625 transforms idiomatic python function calls to well-formed SQL queries.")
3626 (license license:bsd-3)))
3627
3628 (define-public python2-sql
3629 (package-with-python2 python-sql))
3630
3631 (define-public python-pypika
3632 (package
3633 (name "python-pypika")
3634 (version "0.44.0")
3635 (source
3636 (origin (method git-fetch)
3637 (uri (git-reference
3638 (url "https://github.com/kayak/pypika")
3639 (commit (string-append "v" version))))
3640 (file-name (git-file-name name version))
3641 (sha256
3642 (base32
3643 "0mpddrw9z1pzcc40j3pzhd583hlgjx96aa8ak6m9zzhpm4bv3ard"))))
3644 (build-system python-build-system)
3645 (native-inputs
3646 `(("python-parameterized" ,python-parameterized)))
3647 (home-page "https://github.com/kayak/pypika")
3648 (synopsis "SQL query builder API for Python")
3649 (description
3650 "PyPika is a python SQL query builder that exposes the full richness of
3651 the SQL language using a syntax that reflects the resulting query.")
3652 (license license:asl2.0)))
3653
3654 (define-public mongo-tools
3655 (package
3656 (name "mongo-tools")
3657 (version "3.4.0")
3658 (source
3659 (origin (method git-fetch)
3660 (uri (git-reference
3661 (url "https://github.com/mongodb/mongo-tools")
3662 (commit (string-append "r" version))))
3663 (file-name (git-file-name name version))
3664 (sha256
3665 (base32
3666 "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
3667 (build-system go-build-system)
3668 (arguments
3669 `(#:import-path "github.com/mongodb/mongo-tools"
3670 #:modules ((srfi srfi-1)
3671 (guix build go-build-system)
3672 (guix build utils))
3673 #:install-source? #f
3674 #:phases
3675 (let ((all-tools
3676 '("bsondump" "mongodump" "mongoexport" "mongofiles"
3677 "mongoimport" "mongooplog" "mongorestore"
3678 "mongostat" "mongotop")))
3679 (modify-phases %standard-phases
3680 (add-after 'unpack 'delete-bundled-source-code
3681 (lambda _
3682 (delete-file-recursively
3683 "src/github.com/mongodb/mongo-tools/vendor")
3684 #t))
3685 (add-after 'delete-bundled-source-code 'patch-source
3686 (lambda _
3687 ;; Remove a redundant argument that causes compilation to fail.
3688 (substitute*
3689 "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
3690 (("skipping restore of system.profile collection\", db)")
3691 "skipping restore of system.profile collection\")"))
3692 #t))
3693 (replace 'build
3694 (lambda _
3695 (for-each (lambda (tool)
3696 (let ((command
3697 `("go" "build"
3698 ;; This is where the tests expect to find the
3699 ;; executables
3700 "-o" ,(string-append
3701 "src/github.com/mongodb/mongo-tools/bin/"
3702 tool)
3703 "-v"
3704 "-tags=\"ssl sasl\""
3705 "-ldflags"
3706 "-extldflags=-Wl,-z,now,-z,relro"
3707 ,(string-append
3708 "src/github.com/mongodb/mongo-tools/"
3709 tool "/main/" tool ".go"))))
3710 (simple-format #t "build: running ~A\n"
3711 (string-join command))
3712 (apply invoke command)))
3713 all-tools)
3714 #t))
3715 (replace 'check
3716 (lambda _
3717 (with-directory-excursion "src"
3718 (for-each (lambda (tool)
3719 (invoke
3720 "go" "test" "-v"
3721 (string-append "github.com/mongodb/mongo-tools/"
3722 tool)))
3723 all-tools))
3724 #t))
3725 (replace 'install
3726 (lambda* (#:key outputs #:allow-other-keys)
3727 (for-each (lambda (tool)
3728 (install-file
3729 (string-append "src/github.com/mongodb/mongo-tools/bin/"
3730 tool)
3731 (string-append (assoc-ref outputs "out")
3732 "/bin")))
3733 all-tools)
3734 #t))))))
3735 (native-inputs
3736 `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
3737 ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
3738 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
3739 ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
3740 ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
3741 ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
3742 ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
3743 (home-page "https://github.com/mongodb/mongo-tools")
3744 (synopsis "Various tools for interacting with MongoDB and BSON")
3745 (description
3746 "This package includes a collection of tools related to MongoDB.
3747 @table @code
3748 @item bsondump
3749 Display BSON files in a human-readable format
3750 @item mongoimport
3751 Convert data from JSON, TSV or CSV and insert them into a collection
3752 @item mongoexport
3753 Write an existing collection to CSV or JSON format
3754 @item mongodump/mongorestore
3755 Dump MongoDB backups to disk in the BSON format
3756 @item mongorestore
3757 Read MongoDB backups in the BSON format, and restore them to a live database
3758 @item mongostat
3759 Monitor live MongoDB servers, replica sets, or sharded clusters
3760 @item mongofiles
3761 Read, write, delete, or update files in GridFS
3762 @item mongooplog
3763 Replay oplog entries between MongoDB servers
3764 @item mongotop
3765 Monitor read/write activity on a mongo server
3766 @end table")
3767 (license license:asl2.0)))
3768
3769 ;; There are many wrappers for this in other languages. When touching, please
3770 ;; be sure to ensure all dependencies continue to build.
3771 (define-public apache-arrow
3772 (package
3773 (name "apache-arrow")
3774 (version "0.17.1")
3775 (source
3776 (origin
3777 (method git-fetch)
3778 (uri (git-reference
3779 (url "https://github.com/apache/arrow")
3780 (commit (string-append "apache-arrow-" version))))
3781 (file-name (git-file-name name version))
3782 (sha256
3783 (base32
3784 "02r6yx3yhywzikd3b0vfkjgddhfiriyx2vpm3jf5880wq59x798a"))))
3785 (build-system cmake-build-system)
3786 (arguments
3787 `(#:tests? #f
3788 #:phases
3789 (modify-phases %standard-phases
3790 (add-before 'configure 'enter-source-directory
3791 (lambda _ (chdir "cpp") #t))
3792 (add-after 'unpack 'set-env
3793 (lambda _
3794 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
3795 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
3796 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
3797 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
3798 #t)))
3799 #:build-type "Release"
3800 #:configure-flags
3801 (list "-DARROW_PYTHON=ON"
3802 "-DARROW_GLOG=ON"
3803 ;; Parquet options
3804 "-DARROW_PARQUET=ON"
3805 "-DPARQUET_BUILD_EXECUTABLES=ON"
3806 ;; The maintainers disallow using system versions of
3807 ;; jemalloc:
3808 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
3809 ;; is unfortunate because jemalloc increases performance:
3810 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
3811 "-DARROW_JEMALLOC=OFF"
3812
3813 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
3814 ;; option that instructs the build system how to resolve
3815 ;; each dependency. SYSTEM = Finding the dependency in
3816 ;; system paths using CMake's built-in find_package
3817 ;; function, or using pkg-config for packages that do not
3818 ;; have this feature
3819 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
3820
3821 ;; Split output into its component packages.
3822 (string-append "-DCMAKE_INSTALL_PREFIX="
3823 (assoc-ref %outputs "lib"))
3824 (string-append "-DCMAKE_INSTALL_RPATH="
3825 (assoc-ref %outputs "lib")
3826 "/lib")
3827 (string-append "-DCMAKE_INSTALL_BINDIR="
3828 (assoc-ref %outputs "out")
3829 "/bin")
3830 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
3831 (assoc-ref %outputs "include")
3832 "/share/include")
3833
3834
3835 "-DARROW_WITH_SNAPPY=ON"
3836 "-DARROW_WITH_ZLIB=ON"
3837 "-DARROW_WITH_ZSTD=ON"
3838 "-DARROW_WITH_LZ4=ON"
3839 "-DARROW_COMPUTE=ON"
3840 "-DARROW_CSV=ON"
3841 "-DARROW_DATASET=ON"
3842 "-DARROW_FILESYSTEM=ON"
3843 "-DARROW_HDFS=ON"
3844 "-DARROW_JSON=ON"
3845 ;; Arrow Python C++ integration library (required for
3846 ;; building pyarrow). This library must be built against
3847 ;; the same Python version for which you are building
3848 ;; pyarrow. NumPy must also be installed. Enabling this
3849 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
3850 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
3851 ;; ARROW_JSON.
3852 "-DARROW_PYTHON=ON"
3853
3854 ;; Building the tests forces on all the
3855 ;; optional features and the use of static
3856 ;; libraries.
3857 "-DARROW_BUILD_TESTS=OFF"
3858 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
3859 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
3860 "-DARROW_BUILD_STATIC=OFF")))
3861 (inputs
3862 `(("boost" ,boost)
3863 ("brotli" ,google-brotli)
3864 ("double-conversion" ,double-conversion)
3865 ("snappy" ,snappy)
3866 ("gflags" ,gflags)
3867 ("glog" ,glog)
3868 ("apache-thrift" ,apache-thrift "lib")
3869 ("protobuf" ,protobuf)
3870 ("rapidjson" ,rapidjson)
3871 ("zlib" ,zlib)
3872 ("bzip2" ,bzip2)
3873 ("lz4" ,lz4)
3874 ("zstd" ,zstd "lib")
3875 ("re2" ,re2)
3876 ("grpc" ,grpc)
3877 ("python-3" ,python)
3878 ("python-numpy" ,python-numpy)))
3879 (native-inputs
3880 `(("pkg-config" ,pkg-config)))
3881 (outputs '("out" "lib" "include"))
3882 (home-page "https://arrow.apache.org/")
3883 (synopsis "Columnar in-memory analytics")
3884 (description "Apache Arrow is a columnar in-memory analytics layer
3885 designed to accelerate big data. It houses a set of canonical in-memory
3886 representations of flat and hierarchical data along with multiple
3887 language-bindings for structure manipulation. It also provides IPC and common
3888 algorithm implementations.")
3889 (license license:asl2.0)))
3890
3891 (define-public python-pyarrow
3892 (package
3893 (inherit apache-arrow)
3894 (name "python-pyarrow")
3895 (build-system python-build-system)
3896 (arguments
3897 '(#:tests? #f ; XXX There are no tests in the "python" directory
3898 #:phases
3899 (modify-phases %standard-phases
3900 (delete 'build) ; XXX the build is performed again during the install phase
3901 (add-after 'unpack 'enter-source-directory
3902 (lambda _ (chdir "python") #t))
3903 (add-after 'unpack 'make-git-checkout-writable
3904 (lambda _
3905 (for-each make-file-writable (find-files "."))
3906 #t)))))
3907 (propagated-inputs
3908 `(("apache-arrow" ,apache-arrow "lib")
3909 ("python-numpy" ,python-numpy)
3910 ("python-pandas" ,python-pandas)
3911 ("python-six" ,python-six)))
3912 (native-inputs
3913 `(("cmake" ,cmake-minimal)
3914 ("pkg-config" ,pkg-config)
3915 ("python-cython" ,python-cython)
3916 ("python-pytest" ,python-pytest)
3917 ("python-pytest-runner" ,python-pytest-runner)
3918 ("python-setuptools-scm" ,python-setuptools-scm)))
3919 (outputs '("out"))
3920 (home-page "https://arrow.apache.org/docs/python/")
3921 (synopsis "Python bindings for Apache Arrow")
3922 (description
3923 "This library provides a Pythonic API wrapper for the reference Arrow C++
3924 implementation, along with tools for interoperability with pandas, NumPy, and
3925 other traditional Python scientific computing packages.")
3926 (license license:asl2.0)))
3927
3928 (define-public python-crate
3929 (package
3930 (name "python-crate")
3931 (version "0.23.2")
3932 (source (origin
3933 (method url-fetch)
3934 (uri (pypi-uri "crate" version))
3935 (sha256
3936 (base32
3937 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx"))))
3938 (build-system python-build-system)
3939 (propagated-inputs
3940 `(("python-urllib3" ,python-urllib3)))
3941 (home-page "https://github.com/crate/crate-python")
3942 (synopsis "CrateDB Python client")
3943 (description
3944 "This package provides a Python client library for CrateDB.
3945 It implements the Python DB API 2.0 specification and includes support for
3946 SQLAlchemy.")
3947 (license license:asl2.0)))
3948
3949 (define-public libdbi
3950 (package
3951 (name "libdbi")
3952 (version "0.9.0")
3953 (source (origin
3954 (method url-fetch)
3955 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
3956 version "/libdbi-" version ".tar.gz"))
3957 (sha256
3958 (base32
3959 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
3960 (build-system gnu-build-system)
3961 (synopsis "Database independent abstraction layer in C")
3962 (description
3963 "This library implements a database independent abstraction layer in C,
3964 similar to the DBI/DBD layer in Perl. Writing one generic set of code,
3965 programmers can leverage the power of multiple databases and multiple
3966 simultaneous database connections by using this framework.")
3967 (home-page "http://libdbi.sourceforge.net/")
3968 (license license:lgpl2.1+)))
3969
3970 (define-public libdbi-drivers
3971 (package
3972 (name "libdbi-drivers")
3973 (version "0.9.0")
3974 (source (origin
3975 (method url-fetch)
3976 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
3977 "libdbi-drivers/libdbi-drivers-" version
3978 "/libdbi-drivers-" version ".tar.gz"))
3979 (sha256
3980 (base32
3981 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
3982 (build-system gnu-build-system)
3983 (native-inputs
3984 `(;; For tests.
3985 ("inetutils" ,inetutils)
3986 ("glibc-locales" ,glibc-locales)
3987 ("mariadb" ,mariadb)))
3988 (inputs
3989 `(("libdbi" ,libdbi)
3990 ("mariadb:dev" ,mariadb "dev")
3991 ("mariadb:lib" ,mariadb "lib")
3992 ("postgresql" ,postgresql)
3993 ("sqlite" ,sqlite)))
3994 (arguments
3995 `(#:configure-flags
3996 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
3997 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
3998 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
3999 (postgresql (assoc-ref %build-inputs "postgresql"))
4000 (sqlite (assoc-ref %build-inputs "sqlite")))
4001 (list "--disable-docs"
4002 (string-append "--with-dbi-incdir=" libdbi "/include")
4003 (string-append "--with-dbi-libdir=" libdbi "/lib")
4004 "--with-mysql"
4005 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
4006 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
4007 "--with-pgsql"
4008 (string-append "--with-pgsql-incdir=" postgresql "/include")
4009 (string-append "--with-pgsql-libdir=" postgresql "/lib")
4010 "--with-sqlite3"
4011 (string-append "--with-sqlite-incdir=" sqlite "/include")
4012 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
4013 #:phases
4014 (modify-phases %standard-phases
4015 (add-after 'unpack 'fix-tests
4016 (lambda* (#:key inputs #:allow-other-keys)
4017 (substitute* "tests/test_mysql.sh"
4018 (("^MYMYSQLD=.*")
4019 (string-append "MYMYSQLD="
4020 (assoc-ref inputs "mariadb")
4021 "/bin/mysqld")))
4022 #t))
4023 (add-after 'install 'remove-empty-directories
4024 (lambda* (#:key outputs #:allow-other-keys)
4025 (let ((var (string-append (assoc-ref outputs "out") "/var")))
4026 (delete-file-recursively var))
4027 #t)))))
4028 (synopsis "Database drivers for the libdbi framework")
4029 (description
4030 "The @code{libdbi-drivers} library provides the database specific drivers
4031 for the @code{libdbi} framework.
4032
4033 The drivers officially supported by @code{libdbi} are:
4034 @itemize
4035 @item MySQL,
4036 @item PostgreSQL,
4037 @item SQLite.
4038 @end itemize")
4039 (home-page "http://libdbi-drivers.sourceforge.net/")
4040 (license license:lgpl2.1+)))
4041
4042 (define-public soci
4043 (package
4044 (name "soci")
4045 (version "4.0.1")
4046 (source (origin
4047 (method git-fetch)
4048 (uri (git-reference
4049 (url "https://github.com/SOCI/soci/")
4050 (commit version)))
4051 (file-name (git-file-name name version))
4052 (sha256
4053 (base32
4054 "14x2gjblkgpflv75wl144cyjp1sis5rbxnr9r2gj3yw16v2av0bp"))))
4055 (build-system cmake-build-system)
4056 (inputs
4057 `(("firebird" ,firebird)
4058 ("postgresql" ,postgresql)
4059 ("sqlite" ,sqlite)
4060 ("odbc" ,unixodbc)
4061 ("boost" ,boost)
4062 ("mariadb:dev" ,mariadb "dev")))
4063 (arguments
4064 `(#:configure-flags
4065 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it.
4066 (list "-DCMAKE_CXX_STANDARD=17"
4067 "-DSOCI_LIBDIR=lib")
4068 #:tests? #f)) ; may require running database management systems
4069 (synopsis "C++ Database Access Library")
4070 (description
4071 "SOCI is an abstraction layer for several database backends, including
4072 PostreSQL, SQLite, ODBC and MySQL.")
4073 (home-page "http://soci.sourceforge.net/")
4074 (license license:boost1.0)))
4075
4076 (define-public freetds
4077 (package
4078 (name "freetds")
4079 (version "1.2.18")
4080 (source
4081 (origin
4082 (method url-fetch)
4083 (uri (string-append "https://www.freetds.org/files/stable/"
4084 "freetds-" version ".tar.gz"))
4085 (sha256
4086 (base32 "1hspvwxwdd1apadsy2b40dpjik8kfwcvdamvhpg3lnm15n02fb50"))))
4087 (build-system gnu-build-system)
4088 (arguments
4089 ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection,
4090 ;; disabled for now.
4091 `(#:tests? #f))
4092 (home-page "https://www.freetds.org/")
4093 (synopsis "Client libraries for MS SQL and Sybase servers")
4094 (description
4095 "FreeTDS is an implementation of the Tabular DataStream protocol, used for
4096 connecting to MS SQL and Sybase servers over TCP/IP.")
4097 (license license:lgpl2.0+)))