projects/guix·blob ruby-team · refs

6589 lines · 260.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2016, 2018, 2022 Ludovic Courtès <[email protected]>
3;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2025 Andreas Enge <[email protected]>
4;;; Copyright © 2013, 2017 Cyril Roelandt <[email protected]>
5;;; Copyright © 2014, 2016 David Thompson <[email protected]>
6;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <[email protected]>
7;;; Copyright © 2014, 2015 Eric Bavier <[email protected]>
8;;; Copyright © 2015, 2016 Sou Bunnbu <[email protected]>
9;;; Copyright © 2015 Leo Famulari <[email protected]>
10;;; Copyright © 2015 Eric Dvorsak <[email protected]>
11;;; Copyright © 2016, 2022 Hartmut Goebel <[email protected]>
12;;; Copyright © 2016 Christine Lemmer-Webber <[email protected]>
13;;; Copyright © 2015-2024 Efraim Flashner <[email protected]>
14;;; Copyright © 2016, 2017 Nikita <[email protected]>
15;;; Copyright © 2016, 2017, 2018 Roel Janssen <[email protected]>
16;;; Copyright © 2016 David Craven <[email protected]>
17;;; Copyright © 2016, 2024, 2025 Janneke Nieuwenhuizen <[email protected]>
18;;; Copyright © 2016 Andy Patterson <[email protected]>
19;;; Copyright © 2016 Danny Milosavljevic <[email protected]>
20;;; Copyright © 2016-2022 Marius Bakke <[email protected]>
21;;; Copyright © 2017, 2018 Julien Lepiller <[email protected]>
22;;; Copyright © 2017, 2020 Thomas Danckaert <[email protected]>
23;;; Copyright © 2017 Jelle Licht <[email protected]>
24;;; Copyright © 2017 Adriano Peluso <[email protected]>
25;;; Copyright © 2017, 2021 Arun Isaac <[email protected]>
26;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <[email protected]>
27;;; Copyright © 2017, 2018 Alex Vong <[email protected]>
28;;; Copyright © 2017, 2018 Ben Woodcroft <[email protected]>
29;;; Copyright © 2017 Rutger Helling <[email protected]>
30;;; Copyright © 2017, 2018, 2019 Pierre Langlois <[email protected]>
31;;; Copyright © 2015, 2017, 2018, 2019, 2021-2026 Ricardo Wurmus <[email protected]>
32;;; Copyright © 2017 Kristofer Buffington <[email protected]>
33;;; Copyright © 2018 Amirouche Boubekki <[email protected]>
34;;; Copyright © 2018 Joshua Sierles, Nextjournal <[email protected]>
35;;; Copyright © 2018, 2021-2023, 2026 Maxim Cournoyer <[email protected]>
36;;; Copyright © 2019 Jack Hill <[email protected]>
37;;; Copyright © 2019 Alex Griffin <[email protected]>
38;;; Copyright © 2019 Gábor Boskovits <[email protected]>
39;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <[email protected]>
40;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
41;;; Copyright © 2020, 2021 Nicolò Balzarotti <[email protected]>
42;;; Copyright © 2020 Tanguy Le Carrour <[email protected]>
43;;; Copyright © 2020 Lars-Dominik Braun <[email protected]>
44;;; Copyright © 2020 Guy Fleury Iteriteka <[email protected]>
45;;; Copyright © 2020 Michael Rohleder <[email protected]>
46;;; Copyright © 2020, 2025 Vinicius Monego <[email protected]>
47;;; Copyright © 2020 Vincent Legoll <[email protected]>
48;;; Copyright © 2021, 2024 Sharlatan Hellseher <[email protected]>
49;;; Copyright © 2021, 2024 Greg Hogan <[email protected]>
50;;; Copyright © 2021 David Larsson <[email protected]>
51;;; Copyright © 2021 Pjotr Prins <[email protected]>
52;;; Copyright © 2021 Bonface Munyoki Kilyungi <[email protected]>
53;;; Copyright © 2021 Simon Streit <[email protected]>
54;;; Copyright © 2021 Alexandre Hannud Abdo <[email protected]>
55;;; Copyright © 2021 Simon Tournier <[email protected]>
56;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
57;;; Copyright © 2022, 2025 Zhu Zihao <[email protected]>
58;;; Copyright © 2021 Brice Waegeneire <[email protected]>
59;;; Copyright © 2022 muradm <[email protected]>
60;;; Copyright © 2022 Thomas Albers Raviola <[email protected]>
61;;; Copyright © 2021, 2022 jgart <[email protected]>
62;;; Copyright © 2023, 2024 Felix Gruber <[email protected]>
63;;; Copyright © 2023 Munyoki Kilyungi <[email protected]>
64;;; Copyright © 2023, 2025 Giacomo Leidi <[email protected]>
65;;; Copyright © 2024 Troy Figiel <[email protected]>
66;;; Copyright © 2024 gemmaro <[email protected]>
67;;; Copyright © 2025 Ashvith Shetty <[email protected]>
68;;; Copyright © 2025 Philippe Swartvagher <[email protected]>
69;;; Copyright © 2025 Simen Endsjø <[email protected]>
70;;; Copyright © 2025-2026 bdunahu <[email protected]>
71;;; Copyright © 2026 Spencer King <[email protected]>
72;;; Copyright © 2026 Peter Polidoro <[email protected]>
73;;; Copyright © 2026 Josep Bigorra <[email protected]>
74;;; Copyright © 2026 Daniel Littlewood <[email protected]>
75;;; Copyright © 2026 Zheng Junjie <[email protected]>
76;;;
77;;; This file is part of GNU Guix.
78;;;
79;;; GNU Guix is free software; you can redistribute it and/or modify it
80;;; under the terms of the GNU General Public License as published by
81;;; the Free Software Foundation; either version 3 of the License, or (at
82;;; your option) any later version.
83;;;
84;;; GNU Guix is distributed in the hope that it will be useful, but
85;;; WITHOUT ANY WARRANTY; without even the implied warranty of
86;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87;;; GNU General Public License for more details.
88;;;
89;;; You should have received a copy of the GNU General Public License
90;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
91
92(define-module (gnu packages databases)
93 #:use-module (gnu packages)
94 #:use-module (gnu packages admin)
95 #:use-module (gnu packages algebra)
96 #:use-module (gnu packages autotools)
97 #:use-module (gnu packages base)
98 #:use-module (gnu packages bash)
99 #:use-module (gnu packages bison)
100 #:use-module (gnu packages boost)
101 #:use-module (gnu packages build-tools)
102 #:use-module (gnu packages dns)
103 #:use-module (gnu packages nss)
104 #:use-module (gnu packages check)
105 #:use-module (gnu packages cmake)
106 #:use-module (gnu packages compression)
107 #:use-module (gnu packages cpp)
108 #:use-module (gnu packages crypto)
109 #:use-module (gnu packages curl)
110 #:use-module (gnu packages cyrus-sasl)
111 #:use-module (gnu packages dbm)
112 #:use-module (gnu packages docbook)
113 #:use-module (gnu packages emacs)
114 #:use-module (gnu packages compiler-tools)
115 #:use-module (gnu packages freedesktop)
116 #:use-module (gnu packages gawk)
117 #:use-module (gnu packages gcc)
118 #:use-module (gnu packages gd)
119 #:use-module (gnu packages gettext)
120 #:use-module (gnu packages glib)
121 #:use-module (gnu packages gnome)
122 #:use-module (gnu packages gnupg)
123 #:use-module (gnu packages golang)
124 #:use-module (gnu packages golang-build)
125 #:use-module (gnu packages golang-check)
126 #:use-module (gnu packages golang-compression)
127 #:use-module (gnu packages golang-crypto)
128 #:use-module (gnu packages golang-web)
129 #:use-module (gnu packages golang-xyz)
130 #:use-module (gnu packages gperf)
131 #:use-module (gnu packages gtk)
132 #:use-module (gnu packages guile)
133 #:use-module (gnu packages guile-xyz)
134 #:use-module (gnu packages icu4c)
135 #:use-module (gnu packages jemalloc)
136 #:use-module (gnu packages kerberos)
137 #:use-module (gnu packages language)
138 #:use-module (gnu packages libedit)
139 #:use-module (gnu packages libevent)
140 #:use-module (gnu packages libffi)
141 #:use-module (gnu packages linux)
142 #:use-module (gnu packages lisp)
143 #:use-module (gnu packages lisp-xyz)
144 #:use-module (gnu packages llvm)
145 #:use-module (gnu packages logging)
146 #:use-module (gnu packages man)
147 #:use-module (gnu packages maths)
148 #:use-module (gnu packages multiprecision)
149 #:use-module (gnu packages ncurses)
150 #:use-module (gnu packages networking)
151 #:use-module (gnu packages node)
152 #:use-module (gnu packages onc-rpc)
153 #:use-module (gnu packages openldap)
154 #:use-module (gnu packages openstack)
155 #:use-module (gnu packages pantheon)
156 #:use-module (gnu packages parallel)
157 #:use-module (gnu packages pcre)
158 #:use-module (gnu packages perl)
159 #:use-module (gnu packages perl-check)
160 #:use-module (gnu packages perl-web)
161 #:use-module (gnu packages pkg-config)
162 #:use-module (gnu packages popt)
163 #:use-module (gnu packages pretty-print)
164 #:use-module (gnu packages prometheus)
165 #:use-module (gnu packages protobuf)
166 #:use-module (gnu packages python)
167 #:use-module (gnu packages python-build)
168 #:use-module (gnu packages python-check)
169 #:use-module (gnu packages python-compression)
170 #:use-module (gnu packages python-crypto)
171 #:use-module (gnu packages python-science)
172 #:use-module (gnu packages python-web)
173 #:use-module (gnu packages python-xyz)
174 #:use-module (gnu packages qt)
175 #:use-module (gnu packages rdf)
176 #:use-module (gnu packages readline)
177 #:use-module (gnu packages regex)
178 #:use-module (gnu packages rpc)
179 #:use-module (gnu packages ruby)
180 #:use-module (gnu packages ruby-check)
181 #:use-module (gnu packages ruby-xyz)
182 #:use-module (gnu packages security-token)
183 #:use-module (gnu packages serialization)
184 #:use-module (gnu packages sphinx)
185 #:use-module (gnu packages ssh)
186 #:use-module (gnu packages sqlite)
187 #:use-module (gnu packages tcl)
188 #:use-module (gnu packages terminals)
189 #:use-module (gnu packages texinfo)
190 #:use-module (gnu packages textutils)
191 #:use-module (gnu packages time)
192 #:use-module (gnu packages tls)
193 #:use-module (gnu packages valgrind)
194 #:use-module (gnu packages web)
195 #:use-module (gnu packages xdisorg)
196 #:use-module (gnu packages xml)
197 #:use-module (guix deprecation)
198 #:use-module (guix gexp)
199 #:use-module ((guix licenses) #:prefix license:)
200 #:use-module (guix packages)
201 #:use-module (guix download)
202 #:use-module (guix bzr-download)
203 #:use-module (guix git-download)
204 #:use-module (guix hg-download)
205 #:use-module (guix build-system copy)
206 #:use-module (guix build-system emacs)
207 #:use-module (guix build-system gnu)
208 #:use-module (guix build-system go)
209 #:use-module (guix build-system guile)
210 #:use-module (guix build-system meson)
211 #:use-module (guix build-system perl)
212 #:use-module (guix build-system pyproject)
213 #:use-module (guix build-system qt)
214 #:use-module (guix build-system ruby)
215 #:use-module (guix build-system cmake)
216 #:use-module (guix utils)
217 #:use-module (srfi srfi-1)
218 #:use-module (srfi srfi-26)
219 #:use-module (ice-9 match))
220
221(define-public ephemeralpg
222 (package
223 (name "ephemeralpg")
224 (version "3.1")
225 (source
226 (origin
227 (method url-fetch)
228 (uri (string-append
229 "https://eradman.com/ephemeralpg/code/ephemeralpg-"
230 version ".tar.gz"))
231 (sha256
232 (base32 "1ap22ki8yz6agd0qybcjgs4b9izw1rwwcgpxn3jah2ccfyax34s6"))))
233 (build-system gnu-build-system)
234 (arguments
235 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
236 (string-append "PREFIX=" %output))
237 #:phases
238 (modify-phases %standard-phases
239 (delete 'configure) ; no configure script
240 (add-after 'install 'wrap
241 (lambda* (#:key inputs outputs #:allow-other-keys)
242 (let ((out (assoc-ref outputs "out")))
243 (wrap-program (string-append out "/bin/pg_tmp")
244 `("PATH" ":" prefix
245 (,(string-append (assoc-ref inputs "util-linux")
246 "/bin")
247 ,(string-append (assoc-ref inputs "postgresql")
248 "/bin")
249 ;; For getsocket.
250 ,(string-append out "/bin"))))))))
251 #:test-target "test"))
252 (inputs
253 (list bash-minimal postgresql util-linux))
254 (native-inputs
255 ;; For tests.
256 (list ruby which))
257 (home-page "https://eradman.com/ephemeralpg/")
258 (synopsis "Run temporary PostgreSQL databases")
259 (description
260 "@code{pg_tmp} creates temporary PostgreSQL databases, suitable for tasks
261like running software test suites. Temporary databases created with
262@code{pg_tmp} have a limited shared memory footprint and are automatically
263garbage-collected after a configurable number of seconds (the default is
26460).")
265 (license license:isc)))
266
267(define-public es-dump-restore
268 (package
269 (name "es-dump-restore")
270 (version "2.1.0")
271 (source
272 (origin
273 (method url-fetch)
274 (uri (rubygems-uri "es_dump_restore" version))
275 (sha256
276 (base32
277 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
278 (build-system ruby-build-system)
279 (arguments
280 '(#:tests? #f)) ;; No testsuite.
281 (propagated-inputs
282 (list ruby-httpclient ruby-multi-json ruby-progress_bar ruby-rubyzip
283 ruby-thor))
284 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
285 (description
286 "This package provides a utility for dumping the contents of an
287ElasticSearch index to a compressed file and restoring the dumpfile back to an
288ElasticSearch server")
289 (home-page "https://github.com/patientslikeme/es_dump_restore")
290 (license license:expat)))
291
292(define-public firebird
293 (package
294 (name "firebird")
295 (version "3.0.13")
296 (source
297 (origin
298 (method git-fetch)
299 (uri (git-reference
300 (url "https://github.com/FirebirdSQL/firebird")
301 (commit (string-append "v" version))))
302 (file-name (git-file-name name version))
303 (sha256
304 (base32 "0h697y53vk7yvlifr35vjl3vkv8m5ny7j05r70qnqcvjy0axqbdn"))
305 (patches (search-patches "firebird-riscv64-support-pt1.patch"
306 "firebird-riscv64-support-pt2.patch"))
307 (modules '((guix build utils)))
308 (snippet
309 `(begin
310 (for-each
311 delete-file-recursively
312 (list "extern/btyacc/test" ; TODO: package and remove entirely
313 "extern/editline"
314 "extern/icu"
315 "extern/libtommath"
316 "extern/zlib"
317 "src/include/firebird/impl/boost"
318
319 ;; Missing licence.
320 "builds/install/arch-specific/solaris"
321 "extern/SfIO"
322 "src/msgs/templates.sql"
323
324 ;; Generated files missing sources.
325 "doc/README.SecureRemotePassword.html"))))))
326 (build-system gnu-build-system)
327 (outputs (list "debug" "out"))
328 (arguments
329 `(#:configure-flags
330 (let ((out (assoc-ref %outputs "out")))
331 (list (string-append "--with-fbsbin=" out "/sbin")
332 (string-append "--with-fbdoc=" out "/share/doc/"
333 ,name "-" ,version)
334 (string-append "--with-fbconf=" out "/lib/firebird")
335 (string-append "--with-fbintl=" out "/lib/firebird/intl")
336 (string-append "--with-fbmisc=" out "/lib/firebird/misc")
337 (string-append "--with-fbmsg=" out "/lib/firebird")
338 (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
339 (string-append "--with-fbudf=" out "/lib/firebird/UDF")
340 "--with-fbglock=/run/firebird"
341 "--with-fblog=/var/log/firebird"
342 "--with-fbhelp=/var/lib/firebird/system"
343 "--with-fbsecure-db=/var/lib/firebird/secure"
344 "--without-fbsample"
345 "--without-fbsample-db"
346 "--with-system-editline"))
347 #:make-flags
348 (list (string-append "CC=" ,(cc-for-target))
349 ;; The plugins/ can't find libfbclient otherwise.
350 (string-append "LDFLAGS=-Wl,-rpath="
351 (assoc-ref %outputs "out") "/lib"))
352 #:tests? #f ; no test suite
353 #:modules ((guix build gnu-build-system)
354 (guix build utils)
355 (srfi srfi-26))
356 #:phases
357 (modify-phases %standard-phases
358 ,@(if (target-riscv64?)
359 `((add-before 'bootstrap 'force-bootstrap
360 (lambda _
361 (delete-file "configure")
362 ;; This file prevents automake from running.
363 (delete-file "autogen.sh"))))
364 '())
365 (add-after 'unpack 'use-system-boost
366 (lambda _
367 (substitute* "src/include/firebird/Message.h"
368 (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
369 "<boost/preprocessor/seq/for_each_i.hpp>")
370 (("FB_BOOST_") "BOOST_"))))
371 (add-after 'unpack 'patch-installation
372 (lambda _
373 (substitute*
374 "builds/install/arch-specific/linux/makeInstallImage.sh.in"
375 (("/bin/sh") (which "bash"))
376 ;; Remove shell script helpers from $PATH.
377 (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
378 ;; Put files where Guix users expect them.
379 (("(License\\.txt.*)@FB_CONFDIR" match)
380 (string-append match "@FB_DOCDIR@"))
381 (("@FB_CONFDIR@(.*License\\.txt.*)" match)
382 (string-append "@FB_DOCDIR@" match))
383 (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
384 (string-append head "@FB_DOCDIR@" tail "\n")))
385 (substitute*
386 (list "builds/install/posix-common/changeServerMode.sh.in"
387 "builds/install/posix-common/install.sh.in")
388 ;; Skip phases that (could) cause problems in Guix.
389 (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
390 ":")
391 ;; Skip phases that are merely pointless on Guix.
392 (("buildUninstallFile|installInitdScript|startFirebird") ":")
393 ;; Omit randomly generated password with bonus timestamp.
394 (("setDBAPassword") ":"))
395
396 ;; These promote proprietary workflows not relevant on Guix.
397 (for-each delete-file-recursively
398 (find-files "doc" "README\\.(build\\.msvc|NT|Win)"))))
399 (add-after 'configure 'delete-init-scripts
400 (lambda _
401 (delete-file-recursively "gen/install/misc")))
402 (add-before 'build 'set-build-environment-variables
403 (lambda _
404 ;; ‘isql’ needs to run & find libfbclient.so during the build.
405 ;; This doubles as a rudimentary test in lieu of a test suite.
406 (setenv "LD_LIBRARY_PATH"
407 (string-append (assoc-ref %build-inputs "icu4c") "/lib"))))
408 (add-before 'install 'keep-embedded-debug-symbols
409 (lambda _
410 ;; Let the gnu-build-system separate & deal with them later.
411 ;; XXX Upstream would use ‘--strip-unneeded’, shaving a whole
412 ;; megabyte off Guix's 7.7M libEngine12.so, for example.
413 (substitute* "gen/Makefile.install"
414 (("readelf") "false"))))
415 (add-after 'install 'prune-undesirable-files
416 (lambda* (#:key outputs #:allow-other-keys)
417 (let ((out (assoc-ref outputs "out")))
418 (with-directory-excursion out
419 ;; Remove example binaries.
420 (for-each delete-file-recursively
421 (find-files "." "example"))
422 ;; Delete (now-)empty directories.
423 (for-each rmdir
424 (list "include/firebird/impl"
425 "lib/firebird/plugins/udr")))))))))
426 (native-inputs
427 (list autoconf automake libtool))
428 (inputs
429 (list boost
430 editline
431 icu4c-77
432 libtommath
433 ncurses
434 zlib))
435 (home-page "https://www.firebirdsql.org")
436 (synopsis "Relational database with many ANSI SQL standard features")
437 (description
438 "Firebird is an SQL @acronym{RDBMS, relational database management system}
439with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}) including
440@acronym{UDFs, user-defined functions} and PSQL stored procedures, cursors, and
441triggers. Transactions provide full ACID-compliant referential integrity.
442
443The database requires very little manual maintenance once set up, making it
444ideal for small business or embedded use.
445
446When installed as a traditional local or remote (network) database server,
447Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
448may be a better choice for such very large environments.
449
450Firebird can also be embedded into stand-alone applications that don't want or
451need a full client & server. Used in this manner, it offers richer SQL support
452than SQLite as well as the option to seamlessly migrate to a client/server
453database later.")
454 (license
455 ;; See doc/license/README.license.usage.txt for rationale & details.
456 (list license:bsd-3 ; src/common/sha2/
457 license:bsd-4 ; src/common/enc.cpp
458 license:gpl2+ ; builds/posix/make.defaults
459 (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
460 "InterBase Public License v1.0")
461 (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
462 "Initial Developer's Public License v1.0")
463 license:lgpl2.1 ; exception for OSI-compatible licences
464 license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
465 license:public-domain)))) ; including files without explicit licence
466
467(define-public go-github-com-cockroachdb-pebble
468 ;; TODO: As inherited package can't be placed in separate module, keeping
469 ;; this Golang source library here.
470 (package
471 (name "go-github-com-cockroachdb-pebble")
472 (version "1.1.5")
473 (source
474 (origin
475 (method git-fetch)
476 (uri (git-reference
477 (url "https://github.com/cockroachdb/pebble")
478 (commit (string-append "v" version))))
479 (file-name (git-file-name name version))
480 (sha256
481 (base32 "15px3m8fid7fwh0xfyia75aak6a5sx5q3r01n79fr6mnyiaix18a"))))
482 (build-system go-build-system)
483 (arguments
484 (list
485 #:build-flags #~(list "-tags" "external_libzstd")
486 #:test-flags #~(list "-tags" "external_libzstd"
487 ;; Skip tests requiring git in PATH.
488 "-skip" "TestLint"
489 "-vet=off")
490 ;; XXX: Maybe run more tests if possible.
491 #:test-subdirs #~(list "internal/...")
492 #:import-path "github.com/cockroachdb/pebble"))
493 (native-inputs
494 (list go-github-com-stretchr-testify
495 go-golang-org-x-perf
496 pkg-config))
497 (inputs
498 (list (list zstd "lib")))
499 (propagated-inputs
500 (list go-github-com-cespare-xxhash-v2
501 go-github-com-cockroachdb-datadriven
502 go-github-com-cockroachdb-errors
503 go-github-com-cockroachdb-fifo
504 go-github-com-cockroachdb-redact
505 go-github-com-cockroachdb-tokenbucket
506 go-github-com-datadog-zstd
507 go-github-com-ghemawat-stream
508 go-github-com-golang-snappy
509 go-github-com-guptarohit-asciigraph
510 go-github-com-hdrhistogram-hdrhistogram-go
511 go-github-com-klauspost-compress
512 go-github-com-kr-pretty
513 go-github-com-pkg-errors
514 go-github-com-pmezard-go-difflib
515 go-github-com-prometheus-client-golang
516 go-github-com-prometheus-client-model
517 go-github-com-spf13-cobra
518 go-golang-org-x-exp
519 go-golang-org-x-perf
520 go-golang-org-x-sync
521 go-golang-org-x-sys))
522 (home-page "https://github.com/cockroachdb/pebble")
523 (synopsis "RocksDB/LevelDB inspired key-value database in Golang")
524 (description
525 "Pebble is a LevelDB/RocksDB inspired key-value store focused on
526performance and internal usage by CockroachDB. Pebble inherits the RocksDB
527file formats and a few extensions such as range deletion tombstones,
528table-level bloom filters, and updates to the MANIFEST format.")
529 (license license:bsd-3)))
530
531(define-public go-github-com-cockroachdb-pebble-v2
532 (package
533 (inherit go-github-com-cockroachdb-pebble)
534 (name "go-github-com-cockroachdb-pebble-v2")
535 (version "2.1.4")
536 (source
537 (origin
538 (method git-fetch)
539 (uri (git-reference
540 (url "https://github.com/cockroachdb/pebble")
541 (commit (string-append "v" version))))
542 (file-name (git-file-name name version))
543 (sha256
544 (base32 "1ca58sy1q3c8czqb69nkygk0hvz8b92xkb2fpj87hnncg0zh9a9p"))))
545 (arguments
546 (substitute-keyword-arguments
547 (package-arguments go-github-com-cockroachdb-pebble)
548 ((#:tests? _ #t) #f) ; TODO: Find out why some tests fails to build
549 ((#:import-path _) "github.com/cockroachdb/pebble/v2")))
550 (propagated-inputs
551 (modify-inputs propagated-inputs
552 (append go-github-com-cockroachdb-crlib
553 go-github-com-cockroachdb-swiss
554 go-github-com-minio-minlz
555 go-github-com-raduberinde-axisds)))))
556
557;; XXX: This repository has been archived by the owner on Sep 21, 2022. It is
558;; now read-only. It's only used by go-github-com-golang-gddo, consider to
559;; remove it when it does no longer require it.
560(define-public go-github-com-garyburd-redigo
561 (package
562 (name "go-github-com-garyburd-redigo")
563 (version "1.6.4")
564 (source
565 (origin
566 (method git-fetch)
567 (uri (git-reference
568 (url "https://github.com/DeprecatedGoModules/redigo")
569 (commit (string-append "v" version))))
570 (file-name (git-file-name name version))
571 (sha256
572 (base32 "0xq1r7149z358g1dra2dwgmdlk8ynk89bkdgf9y4xx9vyddlaw08"))))
573 (build-system go-build-system)
574 (arguments
575 (list
576 #:skip-build? #t
577 #:import-path "github.com/garyburd/redigo"
578 #:test-flags
579 #~(list "-skip" (string-join
580 ;; pubsub_test.go:28: Punsubscribe(p1) =
581 ;; {punsubscribe p2 3}, want {punsubscribe p1 3}
582 ;; pubsub_test.go:28: Punsubscribe() =
583 ;; {punsubscribe p1 2}, want {punsubscribe p2 2}
584 (list "TestPushed"
585 ;; error connection to database, dial tcp
586 ;; :6379: connect: connection refused
587 "TestConnMux"
588 "TestConnMuxClose")
589 "|"))))
590 (native-inputs (list redis))
591 (home-page "https://github.com/garyburd/redigo")
592 (synopsis "Deprecated Redis client for Golang")
593 (description
594 "This package provides a Redis client for Golang. It is deprecated,
595consider using go-github-com-gomodule-redigo instead.")
596 (license license:asl2.0)))
597
598(define-public pebble
599 (package/inherit go-github-com-cockroachdb-pebble
600 (name "pebble")
601 (arguments
602 (substitute-keyword-arguments
603 (package-arguments go-github-com-cockroachdb-pebble)
604 ((#:tests? _ #t) #f)
605 ((#:install-source? _ #t) #f)
606 ((#:import-path _) "github.com/cockroachdb/pebble/cmd/pebble")
607 ((#:unpack-path _ "") "github.com/cockroachdb/pebble")))
608 (native-inputs
609 (append (package-propagated-inputs go-github-com-cockroachdb-pebble)
610 (package-native-inputs go-github-com-cockroachdb-pebble)))
611 (propagated-inputs '())
612 (description
613 (string-append (package-description
614 go-github-com-cockroachdb-pebble)
615 "\nThis package provides command line interface (CLI)."))))
616
617(define-public dicedb
618 (package
619 (name "dicedb")
620 (version "1.0.10")
621 (source
622 (origin
623 (method git-fetch)
624 (uri (git-reference
625 (url "https://github.com/DiceDB/dice")
626 (commit (string-append "v" version))))
627 (file-name (git-file-name name version))
628 (sha256
629 (base32 "1f9qsqmv41ikkrb5pfrh3b7cv3x82yzq7m3p2d3iml9azbmxvkyy"))
630 (patches (search-patches "dicedb-remove-init-from-config-subpkg.patch"))))
631 (build-system go-build-system)
632 (arguments
633 (list
634 #:install-source? #f
635 #:import-path "github.com/dicedb/dice"
636 #:build-flags
637 #~(list (format #f "-ldflags=-X github.com/dicedb/dice/config.DiceDBVersion=v~a"
638 #$version))
639 #:test-subdirs
640 #~(list ;; "internal/auth/..." ; build failed
641 "internal/cmd/..."
642 "internal/comm/..."
643 "internal/common/..."
644 "internal/dencoding/..."
645 "internal/errors/..."
646 ;; "internal/eval/..." ; build failed
647 "internal/id/..."
648 "internal/iomultiplexer/..."
649 "internal/logger/..."
650 "internal/object/..."
651 "internal/observability/..."
652 "internal/ops/..."
653 "internal/regex/..."
654 "internal/server/..."
655 "internal/shard/..."
656 "internal/shardmanager/..."
657 "internal/shardthread/..."
658 "internal/store/..."
659 "internal/types/..."
660 "internal/wal/..."
661 "internal/watchmanager/...")
662 #:phases
663 #~(modify-phases %standard-phases
664 (add-after 'unpack 'remove-example
665 (lambda* (#:key tests? import-path #:allow-other-keys)
666 (with-directory-excursion (string-append "src/" import-path)
667 (delete-file-recursively "examples")))))))
668 (native-inputs
669 (list go-github-com-axiomhq-hyperloglog
670 go-github-com-bytedance-sonic
671 go-github-com-cespare-xxhash-v2
672 go-github-com-dgryski-go-farm
673 go-github-com-dicedb-dicedb-go
674 go-github-com-gobwas-glob
675 go-github-com-google-btree
676 go-github-com-google-go-cmp
677 go-github-com-google-uuid
678 go-github-com-mmcloughlin-geohash
679 go-github-com-ohler55-ojg
680 go-github-com-rs-xid
681 go-github-com-rs-zerolog
682 go-github-com-spf13-cobra
683 go-github-com-spf13-pflag
684 go-github-com-spf13-viper
685 go-github-com-stretchr-testify
686 go-github-com-twmb-murmur3
687 go-github-com-wangjia184-sortedset
688 go-golang-org-x-crypto
689 go-google-golang-org-protobuf
690 go-gotest-tools-v3))
691 (home-page "https://github.com/dicedb/dice")
692 (synopsis "Fast, reactive, in-memory database optimized for modern hardware")
693 (description
694 "@code{dicedb} is a fast, reactive, in-memory database optimized for
695modern hardware. Commonly used as a cache, it offers a familiar interface
696while enabling real-time data updates through query subscriptions. It
697delivers higher throughput and lower median latencies, making it ideal for
698modern workloads.")
699 (license license:bsd-3)))
700
701(define-public dicedb-cli
702 (package
703 (name "dicedb-cli")
704 (version "1.0.8")
705 (source
706 (origin
707 (method git-fetch)
708 (uri (git-reference
709 (url "https://github.com/dicedb/dicedb-cli")
710 (commit (string-append "v" version))))
711 (file-name (git-file-name name version))
712 (sha256
713 (base32 "0hglagah0wpdkzw5fs5b1jx6m972yriwjl4zwg7sjs529v4jf3sw"))))
714 (build-system go-build-system)
715 (arguments
716 (list
717 #:install-source? #f
718 #:import-path "github.com/dicedb/dicedb-cli"
719 #:test-flags
720 ;; XXX: This might be an issue with cobra: parse_args_test.go:90:
721 ;; parseArgs("SET key \"unterminated value") = []string{}; expected
722 ;; []string{"SET", "key", "unterminated value"}
723 #~(list "-skip" "TestParseArgs_EdgeCases/Unterminated_quote.*")))
724 (native-inputs
725 (list go-github-com-chzyer-readline
726 go-github-com-dicedb-dicedb-go
727 go-github-com-fatih-color
728 go-github-com-google-shlex
729 go-github-com-spf13-cobra
730 go-google-golang-org-protobuf))
731 (home-page "https://github.com/DiceDB/dicedb-cli")
732 (synopsis "Command line interface for DiceDB")
733 (description
734 "@command{dicedb-cli} is a command line interface for
735@url{https://dicedb.io, DiceDB}, a Redis-compliant in-memory database.")
736 (license (list license:expat ;MIT in README
737 license:bsd-3)))) ;BSD-3 in LICENSE file
738
739(define-public leveldb
740 (package
741 (name "leveldb")
742 (version "1.23")
743 (source (origin
744 (method git-fetch)
745 (uri (git-reference
746 (url "https://github.com/google/leveldb")
747 (commit version)))
748 (file-name (git-file-name name version))
749 (sha256
750 (base32
751 "1chxkhb6ajdmj4p8535k4472fbmqvcismll6aapkarsr45yrvgs4"))))
752 (build-system cmake-build-system)
753 (arguments
754 (list #:configure-flags
755 #~(list "-DBUILD_SHARED_LIBS=ON"
756 "-DLEVELDB_BUILD_TESTS=ON"
757
758 ;; Don't install(!) the third_party test frameworks below.
759 "-DINSTALL_GTEST=OFF"
760 "-DBENCHMARK_ENABLE_INSTALL=OFF")
761 #:phases
762 #~(modify-phases %standard-phases
763 ;; Ceph uses leveldb and depends on RTTI.
764 (add-after 'unpack 'allow-RTTI
765 (lambda _
766 (substitute* "CMakeLists.txt"
767 (("set\\(CMAKE_CXX_FLAGS \"\\$\\{CMAKE_CXX_FLAGS\\} -fno-rtti\"\\)")
768 ""))))
769 (add-after 'unpack 'unpack-third_party-sources
770 ;; These are only for testing, so copying source is fine.
771 (lambda _
772 (copy-recursively #$(package-source googletest)
773 "third_party/googletest")
774 (copy-recursively #$(package-source googlebenchmark)
775 "third_party/benchmark"))))))
776 (inputs
777 (list snappy))
778 (home-page "https://github.com/google/leveldb")
779 (synopsis "Fast key-value storage library")
780 (description
781 "LevelDB is a fast key-value storage library that provides an ordered
782mapping from string keys to string values.")
783 (license license:bsd-3)))
784
785(define-public memcached
786 (package
787 (name "memcached")
788 (version "1.6.42")
789 (source
790 (origin
791 (method url-fetch)
792 (uri (string-append
793 "https://memcached.org/files/memcached-" version ".tar.gz"))
794 (sha256
795 (base32 "1rsx752qpp11zirrlznv72770p71mpmfj1frm7g3d7agkn3qpw2h"))))
796 (build-system gnu-build-system)
797 (inputs
798 (list libevent cyrus-sasl))
799 (home-page "https://memcached.org/")
800 (synopsis "In-memory caching service")
801 (description "Memcached is an in-memory key-value store. It has a small
802and generic API, and was originally intended for use with dynamic web
803applications.")
804 (license license:bsd-3)))
805
806(define-public python-adbc-driver-manager
807 (package
808 (name "python-adbc-driver-manager")
809 (version "1.1.0")
810 (source
811 (origin
812 (method url-fetch)
813 (uri (pypi-uri "adbc_driver_manager" version))
814 (sha256
815 (base32 "00i3zg6rbzdz767j9w22ajw8rxwbhkrmzwwlmx11q56cvnig0cm3"))))
816 (build-system pyproject-build-system)
817 (arguments
818 (list
819 ;; TODO: Pack arrow-adbc/c/driver/sqlite for tests.
820 #:tests? #f
821 #:build-backend "setuptools.build_meta"))
822 (native-inputs
823 (list python-cython
824 python-setuptools
825 python-wheel))
826 (propagated-inputs
827 (list python-typing-extensions))
828 (home-page "https://arrow.apache.org/adbc/")
829 (synopsis "Generic entrypoint for ADBC drivers in Python")
830 (description
831 "This package contains bindings for the ADBC Driver Manager, as well as a
832@url{https://peps.python.org/pep-0249/,DBAPI 2.0/PEP 249-compatible} interface
833on top. This can be used to load ADBC drivers at runtime and use them from
834Python. Backend-specific packages like @code{adbc_driver_postgresql} wrap
835this package in a more convenient interface, and should be preferred where
836they exist.")
837 (license license:asl2.0)))
838
839;; XXX: This project was archived by the owner on Apr 15, 2025. It is now
840;; read-only.
841(define-public python-prisma
842 (package
843 (name "python-prisma")
844 (version "0.15.0")
845 (source
846 (origin
847 (method url-fetch)
848 (uri (pypi-uri "prisma" version))
849 (sha256
850 (base32 "01x1ki99k2ps2jis73vzzrqw8zsf810205f17zdja9ijm0m41mjw"))))
851 (build-system pyproject-build-system)
852 (arguments
853 (list #:tests? #f)) ;no tests in PyPI
854 (native-inputs
855 (list python-setuptools))
856 (propagated-inputs
857 (list python-click
858 python-dotenv
859 python-httpx
860 python-jinja2
861 python-nodeenv
862 python-pydantic
863 python-tomlkit
864 python-typing-extensions))
865 (home-page "https://github.com/RobertCraigie/prisma-client-py")
866 (synopsis "Fully type-safe database client")
867 (description
868 "Prisma Client Python is an auto-generated and fully type-safe database
869client.")
870 (license license:asl2.0)))
871
872(define-public python-psycopg2cffi
873 (package
874 (name "python-psycopg2cffi")
875 (version "2.9.0")
876 (source
877 (origin
878 (method url-fetch)
879 (uri (pypi-uri "psycopg2cffi" version))
880 (sha256
881 (base32 "0ljwsglgjm0c28dzlqlyvbz1jnn4hpmqa8dn28fkmpipv3f2w9vy"))))
882 (build-system pyproject-build-system)
883 ;; TODO: Fix tests: ImportError: cannot import name 'psycopg2_tests' from
884 ;; partially initialized module 'psycopg2cffi.tests' (most likely due to a
885 ;; circular import)
886 (arguments '(#:tests? #f))
887 (propagated-inputs (list python-cffi
888 python-six)) ;; hard dependency
889 (native-inputs (list python-setuptools postgresql))
890 (home-page "https://github.com/chtd/psycopg2cffi")
891 (synopsis "Port of psycopg2 to CFFI")
892 (description
893 "This package is an implementation of @code{psycopg2} using CFFI.")
894 (license license:lgpl3)))
895
896(define-public litecli
897 (package
898 (name "litecli")
899 (version "1.15.0")
900 (source
901 (origin
902 (method url-fetch)
903 (uri (pypi-uri "litecli" version))
904 (sha256
905 (base32 "0yfdafh21k8fls85rgyfn03xxn6x5hqcnmlq1v3jvmxjaxzrk19j"))))
906 (build-system pyproject-build-system)
907 (arguments
908 (list
909 ;; These tests depend on python-llm (not packaged)
910 #:test-flags #~(list "-k" (string-append
911 "not test_refresh_called_once"
912 " and not test_refresh_called_twice"
913 " and not test_refresh_with_callbacks"
914 " and not test_llm_command_known_subcommand"))
915 #:phases #~(modify-phases %standard-phases
916 (add-after 'unpack 'relax-sqlparse
917 (lambda _
918 (substitute* "pyproject.toml"
919 ;; Currently we have 0.4.3 and it is fine. Remove this
920 ;; line when sqlparse is updated.
921 (("sqlparse>=0.4.4") "sqlparse")
922 ;; Also remove python-pip from sanity-check.
923 (("\"pip\",") "")))))))
924 (propagated-inputs
925 (list python-cli-helpers
926 python-click
927 python-configobj
928 python-prompt-toolkit
929 python-pygments
930 python-sqlparse))
931 (native-inputs
932 (list python-pytest python-setuptools python-wheel))
933 (home-page "https://litecli.com")
934 (synopsis "CLI for SQLite databases")
935 (description
936 "@code{litecli} is a command-line client for SQLite databases that has
937auto-completion and syntax highlighting.")
938 (license license:bsd-3)))
939
940(define-public python-pgspecial
941 (package
942 (name "python-pgspecial")
943 (version "2.2.1")
944 (source
945 (origin
946 (method url-fetch)
947 (uri (pypi-uri "pgspecial" version))
948 (sha256
949 (base32 "17c4qjvi83b3im9fb00cdzzb24v5xis6y1625l9v0yzggg67yv6s"))))
950 (build-system pyproject-build-system)
951 (native-inputs (list python-pytest
952 python-setuptools
953 python-setuptools-scm
954 python-wheel))
955 (propagated-inputs (list python-click
956 python-configobj
957 python-psycopg
958 python-sqlparse
959 python-typing-extensions))
960 (home-page "https://github.com/dbcli/pgspecial")
961 (synopsis
962 "Python implementation of PostgreSQL meta commands (backslash commands)")
963 (description
964 "This Python package provides an API to execute meta-commands (AKA
965\"special\", or \"backslash commands\") on PostgreSQL.")
966 (license license:bsd-3)))
967
968(define-public python-sqlite-anyio
969 (package
970 (name "python-sqlite-anyio")
971 (version "0.2.8")
972 (source
973 (origin
974 (method git-fetch)
975 (uri (git-reference
976 (url "https://github.com/davidbrochart/sqlite-anyio")
977 (commit version)))
978 (file-name (git-file-name name version))
979 (sha256
980 (base32 "075fnrrwzn9xc2clkcsyfycjc870khcwnpdg4g726qwl44pfzy2a"))))
981 (build-system pyproject-build-system)
982 (propagated-inputs (list python-anyio python-typing-extensions))
983 (native-inputs (list python-pytest python-uv-build))
984 (home-page "https://github.com/davidbrochart/sqlite-anyio")
985 (synopsis "Asynchronous client for SQLite using AnyIO")
986 (description "This package provides an asynchronous client for SQLite
987using @code{AnyIO}.")
988 (license license:expat)))
989
990(define-public python-sqlitedict
991 (package
992 (name "python-sqlitedict")
993 (version "2.1.0")
994 (source (origin
995 (method url-fetch)
996 (uri (pypi-uri "sqlitedict" version))
997 (sha256
998 (base32
999 "134y1ya74ah3g1pd3g9iqjlrcjr2y5b2iny2skqrcab0dnwwzn83"))))
1000 (build-system pyproject-build-system)
1001 (arguments
1002 (list
1003 #:test-flags
1004 ;; assert os.system('env PYTHONPATH=. %s tests/autocommit.py' %
1005 ;; sys.executable) == 0
1006 #~(list "--deselect=tests/test_autocommit.py::test")))
1007 (native-inputs (list python-pytest python-setuptools))
1008 (home-page "https://github.com/piskvorky/sqlitedict")
1009 (synopsis "Persistent dict backed up by sqlite3 and pickle")
1010 (description
1011 "This package provides a lightweight wrapper around the sqlite3 database
1012with a simple, Pythonic @code{dict}-like interface and support for
1013multi-thread access.")
1014 (license license:asl2.0)))
1015
1016(define-public pgcli
1017 (package
1018 (name "pgcli")
1019 (version "4.3.0")
1020 (source
1021 (origin
1022 (method url-fetch)
1023 (uri (pypi-uri "pgcli" version))
1024 (sha256
1025 (base32 "1vva1fi5sqrdvmx7jmdjmy8zwly22sbsj5lzy60s822m1iay2nkn"))))
1026 (build-system pyproject-build-system)
1027 (arguments
1028 ;; AttributeError: 'NoneType' object has no attribute 'kwargs'.
1029 (list #:test-flags #~(list "-k" "not test_application_name_in_env")))
1030 (propagated-inputs
1031 (list python-cli-helpers
1032 python-click
1033 python-configobj
1034 python-pgspecial
1035 python-prompt-toolkit
1036 python-psycopg
1037 python-pygments
1038 python-setproctitle
1039 python-sqlparse
1040 python-tzlocal))
1041 (native-inputs
1042 (list python-pytest python-setuptools python-sshtunnel python-wheel))
1043 (home-page "https://www.pgcli.com")
1044 (synopsis "PostgreSQL CLI with autocompletion and syntax highlighting")
1045 (description
1046 "@code{pgcli} is a command line interface for PostgreSQL with
1047autocompletion and syntax highlighting.")
1048 (license license:bsd-3)))
1049
1050(define-public mycli
1051 (package
1052 (name "mycli")
1053 (version "1.37.1")
1054 (source
1055 (origin
1056 (method url-fetch)
1057 (uri (pypi-uri "mycli" version))
1058 (sha256
1059 (base32 "03kvw0n6s3f06whr7prjfwp1arl66mahlxizv27i9dkm5ibv1qrz"))))
1060 (build-system pyproject-build-system)
1061 (arguments
1062 '(#:tests? #f)) ; tests expect a running MySQL
1063 (native-inputs
1064 (list python-setuptools
1065 python-setuptools-scm))
1066 (propagated-inputs
1067 (list python-cli-helpers
1068 python-click-7
1069 python-configobj
1070 python-cryptography
1071 python-prompt-toolkit
1072 python-pyaes
1073 python-pyfzf
1074 python-pygments
1075 python-pymysql
1076 python-pyperclip
1077 python-sqlglot
1078 python-sqlglotrs
1079 python-sqlparse))
1080 (home-page "https://www.mycli.net")
1081 (synopsis
1082 "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
1083 (description
1084 "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
1085auto-completion and syntax highlighting.")
1086 (license license:bsd-3)))
1087
1088(define-public mysql
1089 (package
1090 (name "mysql")
1091 (version "9.7.0")
1092 (source (origin
1093 (method url-fetch)
1094 (uri (list (string-append
1095 "https://cdn.mysql.com/Downloads/MySQL-"
1096 (version-major+minor version) "/"
1097 name "-" version ".tar.gz")))
1098 (sha256
1099 (base32
1100 "0v9hc8yzp0f5pwl4kr1a8k7lwyf62g95klxb6avfrc2npjx79dbl"))
1101 (modules '((guix build utils)
1102 (ice-9 ftw)
1103 (srfi srfi-26)))
1104 (snippet
1105 #~(begin
1106 (define (delete-all-but directory . preserve)
1107 (with-directory-excursion directory
1108 (let* ((pred (negate (cut member <>
1109 (cons* "." ".." preserve))))
1110 (items (scandir "." pred)))
1111 (for-each (cut delete-file-recursively <>) items))))
1112
1113 ;; Delete bundled source libraries.
1114 (delete-all-but "extra"
1115 ;; XXX: The build system doesn't currently
1116 ;; support unbundling these.
1117 "json" ;used by bundled opentelemetry
1118 "libbacktrace"
1119 "libcno"
1120 "opentelemetry-cpp"
1121 "opentelemetry-proto"
1122 "rapidjson"
1123 "unordered_dense"
1124 "xxhash")))))
1125 (build-system cmake-build-system)
1126 (arguments
1127 (list
1128 #:tests? #f ;FIXME: teach build system to use system googletest
1129 #:configure-flags
1130 #~(list "-DBUILD_CONFIG=mysql_release"
1131 "-DWITH_AUTHENTICATION_LDAP=ON"
1132 "-DWITH_AUTHENTICATION_WEBAUTHN=ON"
1133 "-DWITH_BENCHMARK=OFF"
1134 ;; XXX: BUILD_ID is disabled so that the INFO_BIN target is not
1135 ;; run; this target relies on running mysqld before it is
1136 ;; installed, which fails in our case.
1137 "-DWITH_BUILD_ID=OFF"
1138 "-DWITH_FIDO=system"
1139 "-DWITH_SYSTEM_LIBS=ON"
1140 "-DWITH_UNIT_TESTS=OFF" ;avoid bundled googletest
1141 "-DREPRODUCIBLE_BUILD=ON"
1142 "-DMYSQL_DATADIR=/var/lib/mysql"
1143 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
1144 "-DINSTALL_INFODIR=share/info"
1145 "-DINSTALL_MANDIR=share/man"
1146 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
1147 "-DINSTALL_INCLUDEDIR=include/mysql"
1148 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
1149 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
1150 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
1151 "-DINSTALL_MYSQLTESTDIR=OFF"
1152 "-DINSTALL_DOCDIR=share/mysql/docs"
1153 "-DINSTALL_SHAREDIR=share/mysql")
1154 #:phases
1155 #~(modify-phases %standard-phases
1156 (add-before 'configure 'disable-broken-abi-check
1157 (lambda _
1158 ;; The ABI check started failing with MySQL 9.7.0 for unknown
1159 ;; reasons.
1160 (substitute* "cmake/abi_check.cmake"
1161 (("RUN_ABI_CHECK 1")
1162 "RUN_ABI_CHECK 0"))))
1163 (add-after 'install 'remove-extra-binaries
1164 (lambda _
1165 ;; Remove the 3 *_embedded files, which weigh in at
1166 ;; 14 MiB each.
1167 (for-each delete-file
1168 (find-files (string-append #$output "/bin")
1169 "_embedded$"))))
1170 (add-after 'install 'wrap-mysql_helpers
1171 (lambda* (#:key inputs outputs #:allow-other-keys)
1172 (let ((bin (string-append #$output "/bin"))
1173 (gawk (search-input-file inputs "bin/gawk"))
1174 (coreutils (search-input-file inputs "bin/ls"))
1175 (grep (search-input-file inputs "bin/grep"))
1176 (ps (search-input-file inputs "bin/ps"))
1177 (sed (search-input-file inputs "bin/sed")))
1178 (wrap-program (search-input-file outputs "bin/mysql_config")
1179 `("PATH" suffix
1180 ,(list (dirname gawk)
1181 (dirname coreutils)
1182 (dirname sed))))
1183 (wrap-program (search-input-file outputs "bin/mysqld_safe")
1184 `("PATH" suffix
1185 ,(list (dirname gawk)
1186 (dirname coreutils)
1187 (dirname grep)
1188 (dirname ps)
1189 (dirname sed)))))))
1190 (add-after 'install 'fix-permissions
1191 ;; XXX: Otherwise, the guix daemon reports: "suspicious ownership
1192 ;; or permission on `/gnu/store/...-mysql-9.7.0'; rejecting this
1193 ;; build output".
1194 (lambda _
1195 (chmod #$output #o755))))))
1196 (native-inputs
1197 (list bison perl pkg-config))
1198 (inputs
1199 (list bash-minimal
1200 boost
1201 coreutils
1202 curl
1203 cyrus-sasl
1204 gawk
1205 grep
1206 icu4c
1207 libaio
1208 libedit
1209 libfido2
1210 libtirpc
1211 lz4
1212 mit-krb5
1213 ncurses
1214 openldap
1215 openssl
1216 protobuf
1217 procps
1218 rpcsvc-proto ; rpcgen
1219 sed
1220 zlib
1221 `(,zstd "lib")))
1222 (home-page "https://www.mysql.com/")
1223 (synopsis "Fast, easy to use, and popular database")
1224 (description
1225 "MySQL is a fast, reliable, and easy to use relational database
1226management system that supports the standardized Structured Query
1227Language.")
1228 (license license:gpl2))) ;v2 only -- see 'Election of GPLv2' in LICENSE
1229
1230(define-public mysql-connector-python
1231 (package
1232 (name "mysql-connector-python")
1233 (version "9.7.0")
1234 (source
1235 (origin
1236 (method git-fetch)
1237 (uri (git-reference
1238 (url "https://github.com/mysql/mysql-connector-python")
1239 (commit version)))
1240 (file-name (git-file-name name version))
1241 (sha256
1242 (base32 "0zdm35apj1cfraxwlqfmr04pm87qpw73ilb8p88cn08zsa8q11hg"))))
1243 (build-system pyproject-build-system)
1244 (arguments
1245 (list
1246 #:phases
1247 #~(modify-phases %standard-phases
1248 (add-after 'unpack 'chdir
1249 (lambda _
1250 ;; Our protobuf is too old for the mysqlx dev API, so use the
1251 ;; classic one without the C modules.
1252 (chdir "mysql-connector-python")))
1253 (add-before 'check 'regenerate-certificate
1254 (lambda* (#:key inputs outputs #:allow-other-keys)
1255 (with-directory-excursion "tests/data/ssl"
1256 (substitute* "./generate.sh"
1257 (("which openssl")
1258 (search-input-file inputs "bin/openssl"))
1259 (("\\$OPENSSL")
1260 (search-input-file inputs "bin/openssl")))
1261 ;; Use `make-file-executable' from guix/guix!7224 after
1262 ;; core-packages-team is merged.
1263 (chmod "./generate.sh" #o555)
1264 (invoke "./generate.sh"))))
1265 (replace 'check
1266 (lambda* (#:key tests? #:allow-other-keys)
1267 (when tests?
1268 ;; Some of these tests might be failing due to the build
1269 ;; container's restrictions, others are due to the version
1270 ;; mismatch.
1271 (mkdir-p "/tmp/datadir")
1272 (invoke "python3" "unittests.py"
1273 "--verbosity=3"
1274 (string-append "--with-mysql="
1275 #$(this-package-input "mysql"))
1276 "--keep"
1277 "--mysql-topdir=/tmp/datadir"
1278 "--unix-socket=/tmp/datadir")))))))
1279 (native-inputs (list python-setuptools))
1280 (inputs (list mysql openssl zlib `(,zstd "lib")))
1281 (home-page "https://dev.mysql.com/doc/connector-python/en/index.html")
1282 (synopsis "MySQL driver written in Python")
1283 (description "MySQL Connector/Python enables Python programs to access
1284MySQL databases, using an API that is compliant with the Python Database API
1285Specification v2.0 (PEP 249).")
1286 (license license:gpl2)))
1287
1288(define-deprecated-package python-mysql-connector-python
1289 mysql-connector-python)
1290
1291(define-public mariadb
1292 (package
1293 (name "mariadb")
1294 (version "10.11.14")
1295 (source (origin
1296 (method url-fetch)
1297 (uri (string-append "https://downloads.mariadb.com/MariaDB"
1298 "/mariadb-" version "/source/mariadb-"
1299 version ".tar.gz"))
1300 (sha256
1301 (base32
1302 "0bq5gn5yl3c6jnsamam4nb42y10c43ag764f7mkf7m5i9yqiqmwa"))
1303 (modules '((guix build utils)))
1304 (snippet
1305 '(begin
1306 ;; Delete bundled libraries, but preserve CMakeLists.txt.
1307 (for-each (lambda (file)
1308 (unless (string-suffix? "CMakeLists.txt" file)
1309 (delete-file file)))
1310 (append (find-files "extra/wolfssl")
1311 (find-files "zlib")))))))
1312 (build-system cmake-build-system)
1313 (outputs '("out" "lib" "dev"))
1314 (arguments
1315 `(#:configure-flags
1316 (list
1317 "-DBUILD_CONFIG=mysql_release"
1318
1319 ;; Ensure the system libraries are used.
1320 "-DWITH_JEMALLOC=yes"
1321 "-DWITH_LIBFMT=system"
1322 "-DWITH_PCRE=system"
1323 "-DWITH_SSL=system"
1324 "-DWITH_ZLIB=system"
1325
1326 "-DDEFAULT_CHARSET=utf8"
1327 "-DDEFAULT_COLLATION=utf8_general_ci"
1328 "-DMYSQL_DATADIR=/var/lib/mysql"
1329 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
1330
1331 ;; Do not install the benchmark suite.
1332 "-DINSTALL_SQLBENCHDIR=false"
1333
1334 (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib"))
1335 (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib")
1336 "/lib")
1337 (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out")
1338 "/share/mysql/docs")
1339 (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out")
1340 "/share/man")
1341 (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin")
1342 (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin")
1343 "-DCMAKE_INSTALL_LIBDIR=lib"
1344 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
1345 (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev")
1346 "/include/mysql")
1347 (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out")
1348 "/share/mysql/docs")
1349 (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out")
1350 "/share/mysql/docs")
1351 (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out")
1352 "/share/mysql/support-files")
1353 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
1354 "-DINSTALL_SHAREDIR=share")
1355 ;; The test suite has spurious failures (mostly timeouts) if run in
1356 ;; parallel on various machines. Only enable parallel tests on
1357 ;; architectures which are likely to not have this issue.
1358 #:parallel-tests? ,(target-x86-64?)
1359 #:phases
1360 (modify-phases %standard-phases
1361 (add-after 'unpack 'adjust-output-references
1362 (lambda _
1363 ;; The build system invariably prepends $CMAKE_INSTALL_PREFIX
1364 ;; to other variables such as $INSTALL_INCLUDEDIR, which does
1365 ;; not work when the latter uses an absolute file name.
1366 (substitute* "libmariadb/mariadb_config/mariadb_config.c.in"
1367 (("%s/@INSTALL_INCLUDEDIR@")
1368 (string-append "@INSTALL_INCLUDEDIR@"))
1369 ;; As of 10.5.8, the mariadb_config program tries to be
1370 ;; clever and computes the installation directory relative
1371 ;; to /proc/self/exe when running on Linux. Make it fall
1372 ;; back to the old behaviour.
1373 (("defined\\(__linux__\\)")
1374 "0"))
1375 (substitute* "libmariadb/mariadb_config/libmariadb.pc.in"
1376 (("\\$\\{prefix\\}/@INSTALL_INCLUDEDIR@")
1377 "@INSTALL_INCLUDEDIR@"))
1378 (substitute* "support-files/mariadb.pc.in"
1379 (("^(include|bin|script|doc|man)dir=\\$\\{prefix\\}/" _ dir)
1380 (string-append dir "dir=")))
1381 (substitute* "include/CMakeLists.txt"
1382 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_INCLUDEDIR\\}")
1383 "${INSTALL_INCLUDEDIR}"))
1384 (substitute* "cmake/mariadb_connector_c.cmake"
1385 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_BINDIR\\}")
1386 "${INSTALL_BINDIR}"))))
1387 (add-after 'unpack 'adjust-tests
1388 (lambda _
1389 (let ((disabled-tests
1390 '(;; These fail because root@hostname == root@localhost in
1391 ;; the build environment, causing a user count mismatch.
1392 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
1393 "main.explain_non_select"
1394 "main.upgrade_MDEV-19650"
1395 "roles.acl_statistics"
1396 "main.stat_tables_innodb"
1397 "main.stat_tables"
1398 "main.mysql_upgrade"
1399
1400 ;; Probably same as above, test failure reported upstream:
1401 ;; <https://jira.mariadb.org/browse/MDEV-26320>.
1402 "main.selectivity_no_engine"
1403
1404 ;; FIXME: These tests check various table encodings and
1405 ;; fails because Guix defaults to UTF8 instead of the
1406 ;; upstream default latin1_swedish_ci. It's not easily
1407 ;; substitutable because several encodings are tested.
1408 "main.system_mysql_db"
1409 "main.mysqldump-header"
1410
1411 ;; These test sometimes fail.
1412 "main.log_slow"
1413 "main.mysqld--help-aria"
1414 ;; The upstream issue is closed but the issue remains,
1415 ;; as of 10.11.14 (see:
1416 ;; <https://jira.mariadb.org/browse/MDEV-12237>)
1417 "main.analyze_stmt_slow_query_log"
1418
1419 ;; XXX: This test occasionally fails on i686-linux:
1420 ;; <https://jira.mariadb.org/browse/MDEV-24458>
1421 ,@(if (string-prefix? "i686" (%current-system))
1422 '("main.myisampack")
1423 '())))
1424
1425 ;; This file contains a list of known-flaky tests for this
1426 ;; release. Append our own items.
1427 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
1428 (for-each (lambda (test)
1429 (format unstable-tests "~a : ~a\n"
1430 test "Disabled in Guix"))
1431 disabled-tests)
1432 (close-port unstable-tests)
1433
1434 (substitute* "mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test"
1435 (("/bin/bash")
1436 (which "bash")))
1437
1438 (substitute* "mysql-test/mariadb-test-run.pl"
1439 (("/bin/ls") (which "ls"))
1440 (("/bin/sh") (which "sh"))))))
1441 (replace 'check
1442 (lambda* (#:key (tests? #t) parallel-tests? #:allow-other-keys)
1443 (if tests?
1444 (with-directory-excursion "mysql-test"
1445 (invoke "./mariadb-test-run"
1446 "--verbose"
1447 "--retry=3"
1448 "--suite=main"
1449 "--testcase-timeout=40"
1450 "--suite-timeout=600"
1451 "--parallel" (number->string (if parallel-tests?
1452 ;; See guix/guix#5680.
1453 (min 64 (parallel-job-count))
1454 1))
1455 ;; Skip the replication tests: they are very I/O
1456 ;; intensive and frequently causes indeterministic
1457 ;; failures even on powerful hardware.
1458 "--skip-rpl"
1459 "--skip-test-list=unstable-tests"))
1460 (format #t "test suite not run~%"))))
1461 (add-after 'install 'post-install
1462 (lambda* (#:key inputs outputs #:allow-other-keys)
1463 (let ((out (assoc-ref outputs "out"))
1464 (dev (assoc-ref outputs "dev"))
1465 (lib (assoc-ref outputs "lib"))
1466 (openssl (dirname (search-input-file inputs "lib/libssl.so"))))
1467 (substitute* (list (string-append out "/bin/mariadb-install-db")
1468 (string-append out "/bin/mysql_install_db"))
1469 (("basedir=\"\"")
1470 (string-append "basedir=\"" out "\""))
1471 (("\\$basedir/share/mysql")
1472 (string-append lib "/share/mysql"))
1473 (("bindir=\"\\$basedir//") "bindir=\"/"))
1474
1475 (with-directory-excursion lib
1476 ;; Remove tests.
1477 (delete-file-recursively "mysql-test")
1478 ;; Remove static libraries.
1479 (for-each delete-file (find-files "lib" "\\.a$")))
1480
1481 (with-directory-excursion out
1482 (delete-file "share/man/man1/mysql-test-run.pl.1")
1483 ;; Delete huge and unnecessary executables.
1484 (for-each delete-file (find-files "bin" "test$")))
1485 (mkdir-p (string-append dev "/share"))
1486 (mkdir-p (string-append dev "/bin"))
1487 (rename-file (string-append lib "/bin/mariadbd")
1488 (string-append out "/bin/mariadbd"))
1489 (rename-file (string-append lib "/bin/mysqld")
1490 (string-append out "/bin/mysqld"))
1491 (mkdir-p (string-append dev "/lib"))
1492 (rename-file (string-append lib "/lib/pkgconfig")
1493 (string-append dev "/lib/pkgconfig"))
1494 (rename-file (string-append out "/bin/mariadb_config")
1495 (string-append dev "/bin/mariadb_config"))
1496 (rename-file (string-append out "/bin/mysql_config")
1497 (string-append dev "/bin/mysql_config"))
1498
1499 ;; Embed an absolute reference to OpenSSL in mysql_config
1500 ;; and the pkg-config file to avoid propagation.
1501 ;; XXX: how to do this for mariadb_config.c.in?
1502 (substitute* (list (string-append dev "/bin/mysql_config")
1503 (string-append dev "/lib/pkgconfig/mariadb.pc"))
1504 (("-lssl -lcrypto" all)
1505 (string-append "-L" openssl " " all)))))))))
1506 (native-inputs
1507 `(("bison" ,bison)
1508 ("perl" ,perl)))
1509 (inputs
1510 (list fmt
1511 jemalloc
1512 libaio
1513 libxml2
1514 ncurses
1515 openssl
1516 linux-pam
1517 pcre2
1518 xz
1519 zlib))
1520 ;; The test suite is very resource intensive and can take more than three
1521 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
1522 (properties '((timeout . 64800))) ;18 hours
1523 (home-page "https://mariadb.org/")
1524 (synopsis "SQL database server")
1525 (description
1526 "MariaDB is a multi-user and multi-threaded SQL database server, designed
1527as a drop-in replacement of MySQL.")
1528 (license license:gpl2)))
1529
1530(define-public mariadb-embedded
1531 (package/inherit mariadb
1532 (name "mariadb-embedded")
1533 (arguments
1534 (substitute-keyword-arguments arguments
1535 ((#:configure-flags flags)
1536 #~(append '("-DWITH_EMBEDDED_SERVER=ON") #$flags))))))
1537
1538(define-public mariadb-connector-c
1539 (package
1540 (name "mariadb-connector-c")
1541 (version "3.4.5")
1542 (source
1543 (origin
1544 (method url-fetch)
1545 (uri (string-append
1546 "https://downloads.mariadb.org/rest-api/connector-c/"
1547 version "/mariadb-connector-c-" version "-src.tar.gz"))
1548 (file-name (string-append name "-" version ".tar.gz"))
1549 (sha256
1550 (base32 "18y1x985pnvvirmwfka81ygsvl7isc52mj9c9hvc69fb2qw1jzmi"))))
1551 (inputs
1552 (list openssl))
1553 (build-system cmake-build-system)
1554 (arguments
1555 '(#:tests? #f)) ; no tests
1556 (home-page "https://mariadb.com/kb/en/mariadb-connector-c/")
1557 (synopsis "Client library to connect to MySQL or MariaDB")
1558 (description "The MariaDB Connector/C is used to connect applications
1559developed in C/C++ to MariaDB and MySQL databases.")
1560 (license license:lgpl2.1+)))
1561
1562(define-public galera
1563 (package
1564 (name "galera")
1565 (version "26.4.18")
1566 (source (origin
1567 (method git-fetch)
1568 (uri (git-reference
1569 (url "https://github.com/codership/galera")
1570 (commit (string-append "release_" version))
1571 (recursive? #t)))
1572 (file-name (git-file-name name version))
1573 (sha256
1574 (base32 "1agw763qx9778krcpmgvwcps73ipyjwl0niwsykcxldvzzs314r5"))))
1575 (build-system cmake-build-system)
1576 (inputs
1577 (list boost openssl))
1578 (native-inputs
1579 (list check))
1580 (home-page "https://github.com/codership/galera/")
1581 (synopsis "Extension to the MariaDB database server")
1582 (description
1583 "Galera is a wsrep-provider that is used with MariaDB for load-balancing
1584and high-availability (HA).")
1585 (license license:gpl2))) ;'COPYING' says "version 2" only
1586
1587;; Don't forget to update the other postgresql packages when upgrading this one.
1588(define-public postgresql-17
1589 (package
1590 (name "postgresql")
1591 (version "17.10")
1592 (source (origin
1593 (method url-fetch)
1594 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1595 version "/postgresql-" version ".tar.bz2"))
1596 (sha256
1597 (base32
1598 "144cb40gn1lasvz0jvz4i72mda8k7pm1bx6azq2vggfddm8h72h7"))
1599 (patches (search-patches
1600 "postgresql-disable-normalize_exec_path.patch"))))
1601 (build-system gnu-build-system)
1602 (arguments
1603 (list
1604 #:configure-flags
1605 #~(list "--with-uuid=e2fs" "--with-openssl"
1606 (string-append "--mandir=" #$output "/share/man")
1607 ;; PostgreSQL installs its own Makefile (should it?).
1608 ;; Prevent it from retaining needless references to
1609 ;; the build tools in order to save size.
1610 "MKDIR_P=mkdir -p" "INSTALL_BIN=install -c"
1611 "LD=ld" "TAR=tar")
1612 #:phases
1613 #~(modify-phases %standard-phases
1614 (add-before 'configure 'patch-/bin/sh
1615 (lambda _
1616 ;; Refer to the actual shell.
1617 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
1618 "src/bin/psql/command.c")
1619 (("/bin/sh") (which "sh")))))
1620 (add-before 'configure 'set-socket-dir
1621 (lambda _
1622 (substitute* '("src/include/pg_config_manual.h")
1623 (("DEFAULT_PGSOCKET_DIR[^\n]*")
1624 "DEFAULT_PGSOCKET_DIR \"/var/run/postgresql\""))))
1625 (add-after 'build 'build-contrib
1626 (lambda _
1627 (invoke "make" "-C" "contrib")))
1628 ;; FIXME: Install manpages too.
1629 ;; The 'install-mangpages phase in postgresql-16 fails silently here.
1630 (add-after 'install 'install-contrib
1631 (lambda _
1632 (invoke "make" "-C" "contrib" "install"))))))
1633 (native-inputs
1634 (list bison
1635 docbook-xml-4.5
1636 docbook-xsl
1637 docbook2x
1638 flex
1639 libxml2
1640 libxslt
1641 perl
1642 pkg-config
1643 texinfo))
1644 (inputs
1645 (list icu4c readline `(,util-linux "lib") openssl zlib))
1646 (home-page "https://www.postgresql.org/")
1647 (synopsis "Powerful object-relational database system")
1648 (description
1649 "PostgreSQL is a powerful object-relational database system. It is fully
1650ACID compliant, has full support for foreign keys, joins, views, triggers, and
1651stored procedures (in multiple languages). It includes most SQL:2008 data
1652types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
1653TIMESTAMP. It also supports storage of binary large objects, including
1654pictures, sounds, or video.")
1655 (license (license:x11-style "file://COPYRIGHT"))))
1656
1657(define-public postgresql-16
1658 (package
1659 (inherit postgresql-17)
1660 (name "postgresql")
1661 (version "16.14")
1662 (source (origin
1663 (method url-fetch)
1664 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1665 version "/postgresql-" version ".tar.bz2"))
1666 (sha256
1667 (base32
1668 "0w9lgsn03m4k0v3m622v7fk3gqbfbjvwv34mrrc0i4ip4wa7gl7n"))
1669 (patches (search-patches
1670 "postgresql-disable-normalize_exec_path.patch"))))
1671 (arguments
1672 (substitute-keyword-arguments (package-arguments postgresql-17)
1673 ((#:phases phases #~%standard-phases)
1674 #~(modify-phases #$phases
1675 (add-after 'install 'install-manuals
1676 (lambda _
1677 (with-directory-excursion "doc/src/sgml"
1678 (invoke "make" "install-man")
1679 (invoke "make" "postgres.info")
1680 (install-file "postgres.info"
1681 (string-append #$output "/share/info")))))))))
1682 (native-inputs (modify-inputs (package-native-inputs postgresql-17)
1683 (delete "bison")
1684 (delete "docbook-xsl")
1685 (delete "flex")
1686 (delete "libxslt")))))
1687
1688(define-public postgresql-15
1689 (package
1690 (inherit postgresql-16)
1691 (name "postgresql")
1692 (version "15.18")
1693 (source (origin
1694 (method url-fetch)
1695 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1696 version "/postgresql-" version ".tar.bz2"))
1697 (sha256
1698 (base32
1699 "1d13qckpslfqamdmp23q3rbzxlp1rqwszylilyllpsp3gzwhvpqi"))
1700 (patches (search-patches
1701 "postgresql-disable-resolve_symlinks.patch"))))
1702 (native-inputs (modify-inputs native-inputs
1703 (delete "pkg-config")))
1704 (inputs (modify-inputs inputs
1705 (delete "icu4c")))))
1706
1707(define-public postgresql-14
1708 (package
1709 (inherit postgresql-15)
1710 (name "postgresql")
1711 (version "14.20")
1712 (replacement postgresql-14.23)
1713 (source (origin
1714 (inherit (package-source postgresql-15))
1715 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1716 version "/postgresql-" version ".tar.bz2"))
1717 (sha256
1718 (base32
1719 "0sv45dsmyplfys6dfdjdwmrczl46s82x35xdh311nxj02q7z29vm"))))))
1720
1721(define-public postgresql-14.23
1722 (package
1723 (inherit postgresql-14)
1724 (name "postgresql")
1725 (version "14.23")
1726 (source (origin
1727 (inherit (package-source postgresql-14))
1728 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1729 version "/postgresql-" version ".tar.bz2"))
1730 (sha256
1731 (base32
1732 "19clihp73ak2p5di90jhg50lqjkkr0iy349gkki30qsl5f11cwnc"))))))
1733
1734(define-deprecated/public postgresql-13 #f
1735 (package
1736 (inherit postgresql-14)
1737 (version "13.23")
1738 (source (origin
1739 (inherit (package-source postgresql-14))
1740 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1741 version "/postgresql-" version ".tar.bz2"))
1742 (sha256
1743 (base32
1744 "1mhz0h7b3dmc0nnxz1wp46j95jhyi3girykkr3gbg4mg4qkwihvf"))))))
1745
1746(define-public postgresql postgresql-14)
1747
1748(define-public libpg-query-17
1749 (package
1750 (name "libpg-query")
1751 (version "17-6.0.0")
1752 (source (origin
1753 (method git-fetch)
1754 (uri (git-reference
1755 (url "https://github.com/pganalyze/libpg_query.git")
1756 (commit version)))
1757 (file-name (git-file-name name version))
1758 (sha256
1759 (base32
1760 "1y4594pf2wl88m66z9xhxzmm675408dbw7bkg4snfcifij97f0c7"))))
1761 (build-system gnu-build-system)
1762 (arguments
1763 (list #:tests? #f ; tests run as part of build
1764 #:make-flags
1765 #~(list (string-append "prefix=" #$output))
1766 #:phases
1767 #~(modify-phases %standard-phases
1768 (replace 'configure
1769 (lambda _
1770 (setenv "CC" #$(cc-for-target)))))))
1771 (native-inputs
1772 (list which))
1773 (synopsis "Postgres SQL parser")
1774 (description "This package provides a Postgres SQL parser as a library.")
1775 (home-page "https://github.com/pganalyze/libpg_query")
1776 (license license:bsd-3)))
1777
1778(define-public libpg-query libpg-query-17)
1779
1780(define-public timescaledb
1781 (package
1782 (name "timescaledb")
1783 (version "2.26.1")
1784 (source (origin
1785 (method git-fetch)
1786 (uri (git-reference
1787 (url "https://github.com/timescale/timescaledb")
1788 (commit version)))
1789 (file-name (git-file-name name version))
1790 (sha256
1791 (base32
1792 "0zfm224jyz874pk4r9qlz5c2mn1xjvairhxh6widlbh3mn62m3j8"))
1793 (modules '((guix build utils)))
1794 (snippet
1795 ;; Remove files carrying the proprietary TIMESCALE license.
1796 '(begin
1797 (delete-file-recursively "tsl")
1798 (for-each delete-file
1799 '("scripts/c_license_header-timescale.h"
1800 "scripts/license_tsl.spec"
1801 "scripts/sql_license_tsl.sql"
1802 "test/t/001_replication_telemetry.pl"
1803 "test/perl/TimescaleNode.pm"))))))
1804 (build-system cmake-build-system)
1805 (arguments
1806 (list #:imported-modules `((guix build union)
1807 ,@%cmake-build-system-modules)
1808 #:modules `(,@%cmake-build-system-modules
1809 ((guix build gnu-build-system) #:prefix gnu:)
1810 (guix build utils)
1811 (guix build union)
1812 (ice-9 match))
1813 #:configure-flags #~(list "-DAPACHE_ONLY=ON"
1814 "-DSEND_TELEMETRY_DEFAULT=OFF")
1815 #:phases
1816 #~(modify-phases (@ (guix build cmake-build-system) %standard-phases)
1817 (add-after 'unpack 'patch-install-location
1818 (lambda _
1819 ;; Install extension to the output instead of the
1820 ;; PostgreSQL store directory.
1821 (substitute* '("CMakeLists.txt"
1822 "cmake/GenerateScripts.cmake"
1823 "sql/CMakeLists.txt")
1824 (("\\$\\{PG_SHAREDIR\\}/extension")
1825 (string-append #$output "/share/extension")))
1826 ;; Likewise for the library.
1827 (substitute* '("src/CMakeLists.txt"
1828 "src/loader/CMakeLists.txt")
1829 (("\\$\\{PG_PKGLIBDIR\\}")
1830 (string-append #$output "/lib")))))
1831 (add-after 'unpack 'remove-kernel-version
1832 ;; Do not embed the running kernel version for reproducible
1833 ;; builds
1834 (lambda _
1835 (substitute* "src/config.h.in"
1836 (("BUILD_OS_VERSION ..CMAKE_SYSTEM_VERSION.")
1837 "BUILD_OS_VERSION \""))))
1838 ;; Run the tests after install to make it easier to create the
1839 ;; required PostgreSQL+TimescaleDB filesystem union.
1840 (delete 'check)
1841 (add-after 'install 'prepare-tests
1842 (lambda* (#:key inputs #:allow-other-keys)
1843 (let ((pg-data (string-append (getcwd) "/../pg-data"))
1844 (pg-union (string-append (getcwd) "/../pg-union")))
1845 (match inputs
1846 (((names . directories) ...)
1847 (union-build pg-union (cons #$output directories))))
1848 (setenv "PATH" (string-append pg-union "/bin:"
1849 (getenv "PATH")))
1850 (invoke "initdb" "-D" pg-data)
1851 (copy-file "test/postgresql.conf"
1852 (string-append pg-data "/postgresql.conf"))
1853
1854 (invoke "pg_ctl" "-D" pg-data
1855 "-o" (string-append "-k " pg-data)
1856 "-l" (string-append pg-data "/db.log")
1857 "start"))))
1858 #$@(cond
1859 ((string=? "x86-64-linux" (%current-system))
1860 #~())
1861 ((member (%current-system)
1862 (list "aarch64-linux" "i686-linux"))
1863 #~((add-after 'unpack 'skip-failing-tests
1864 (lambda _
1865 (substitute* "test/sql/CMakeLists.txt"
1866 (((string-append
1867 "("
1868 (string-join
1869 '(" append\\.sql\\.in"
1870 " chunk_adaptative\\.sql"
1871 " histogram_test\\.sql\\.in")
1872 "|")
1873 ")")
1874 all)
1875 (string-append "#" all)))))))
1876 (else
1877 #~((add-after 'unpack 'skip-failing-tests
1878 (lambda _
1879 (substitute* "test/sql/CMakeLists.txt"
1880 (("histogram_test\\.sql\\.in")
1881 "#histogram_test.sql.in")))))))
1882 (add-after 'prepare-tests 'check
1883 (lambda* (#:rest args)
1884 (apply (assoc-ref gnu:%standard-phases 'check)
1885 #:test-target "regresschecklocal" args))))))
1886 (inputs (list openssl postgresql-17))
1887 (home-page "https://www.timescale.com/")
1888 (synopsis "Time-series extension for PostgreSQL")
1889 (description
1890 "TimescaleDB is a database designed to make SQL scalable for
1891time-series data. It is engineered up from PostgreSQL and packaged as a
1892PostgreSQL extension, providing automatic partitioning across time and space
1893(partitioning key), as well as full SQL support.")
1894 (license license:asl2.0)))
1895
1896(define-public pgvector
1897 (package
1898 (name "pgvector")
1899 (version "0.6.0")
1900 (source (origin
1901 (method git-fetch)
1902 (uri (git-reference
1903 (url "https://github.com/pgvector/pgvector")
1904 (commit (string-append "v" version))))
1905 (file-name (git-file-name name version))
1906 (sha256
1907 (base32
1908 "19zcjrlmyj7gfbn8prh014yq50iy4dg97pirsm7idxsr829vwyc5"))))
1909 (build-system gnu-build-system)
1910 (arguments
1911 (list
1912 ;; Do not use -march=native
1913 #:make-flags
1914 '(list "OPTFLAGS=")
1915 #:phases
1916 #~(modify-phases %standard-phases
1917 (delete 'configure)
1918 (replace 'install
1919 (lambda _
1920 (let ((extension (string-append #$output "/share/extension"))
1921 (lib (string-append #$output "/lib"))
1922 (headers (string-append #$output "/include/server/extension/vector")))
1923 (for-each mkdir-p (list extension lib headers))
1924 (install-file "vector.so" lib)
1925 (chmod (string-append lib "/vector.so") #o755)
1926 (install-file "vector.control" extension)
1927 (for-each (lambda (file)
1928 (install-file file extension))
1929 (find-files "sql" "\\.sql$"))
1930 (install-file "src/vector.h" headers)))))))
1931 (inputs (list postgresql))
1932 (home-page "https://github.com/pgvector/pgvector")
1933 (synopsis "Vector similarity search for Postgres")
1934 (description
1935 "This package provides a vector similarity search extension for Postgres.
1936Store your vectors with the rest of your data. It supports:
1937
1938@itemize
1939@item exact and approximate nearest neighbor search;
1940@item L2 distance, inner product, and cosine distance;
1941@item any language with a Postgres client.
1942@end itemize
1943")
1944 (license (license:x11-style "file://COPYRIGHT"))))
1945
1946(define-public pgloader
1947 (package
1948 (name "pgloader")
1949 (version "3.6.9")
1950 (source
1951 (origin
1952 (method git-fetch)
1953 (uri (git-reference
1954 (url "https://github.com/dimitri/pgloader")
1955 (commit (string-append "v" version))))
1956 (sha256
1957 (base32 "03kp3ms2sjz4gwb94xs404mi63fnv1bq00hyqxyvc9csmicxzawn"))
1958 (file-name (git-file-name name version))))
1959 (build-system gnu-build-system)
1960 (arguments
1961 ;; NOTE: (Sharlatan-20210119T211511+0000) Tests are disabled due to being
1962 ;; dependent on Quicklisp, main build target is `pgloader-standalone' which
1963 ;; does not require Quicklisp workarounds. There is no `install' target
1964 ;; configured in Makefile.
1965 (list #:tests? #f
1966 #:strip-binaries? #f
1967 #:make-flags
1968 #~(list "pgloader-standalone" "BUILDAPP_SBCL=buildapp")
1969 #:phases
1970 #~(modify-phases %standard-phases
1971 (delete 'configure)
1972 (add-after 'unpack 'set-home
1973 (lambda _
1974 (setenv "HOME" "/tmp")))
1975 (add-after 'unpack 'patch-Makefile
1976 (lambda _
1977 (substitute* "Makefile"
1978 (("--sbcl.*") "--sbcl $(CL) --asdf-path . \\\n"))))
1979 (replace 'install
1980 (lambda* (#:key outputs #:allow-other-keys)
1981 (let ((bin (string-append #$output "/bin")))
1982 (mkdir-p bin)
1983 (install-file "build/bin/pgloader" bin)))))))
1984 (native-inputs
1985 (list buildapp sbcl))
1986 (inputs
1987 (list sbcl-alexandria
1988 sbcl-cl-abnf
1989 sbcl-cl-base64
1990 sbcl-cl-csv
1991 sbcl-cl-fad
1992 sbcl-cl-log
1993 sbcl-cl-markdown
1994 sbcl-cl-mustache
1995 sbcl-cl-ppcre
1996 sbcl-cl-sqlite
1997 sbcl-closer-mop
1998 sbcl-command-line-arguments
1999 sbcl-db3
2000 sbcl-drakma
2001 sbcl-esrap
2002 sbcl-flexi-streams
2003 sbcl-ixf
2004 sbcl-local-time
2005 sbcl-lparallel
2006 sbcl-metabang-bind
2007 sbcl-mssql
2008 sbcl-postmodern
2009 sbcl-py-configparser
2010 sbcl-qmynd
2011 sbcl-quri
2012 sbcl-split-sequence
2013 sbcl-trivial-backtrace
2014 sbcl-usocket
2015 sbcl-uuid
2016 sbcl-yason
2017 sbcl-zs3))
2018 (home-page "https://pgloader.io/")
2019 (synopsis "Tool to migrate data to PostgreSQL")
2020 (description
2021 "@code{pgloader} is a program that can load data or migrate databases from
2022CSV, DB3, iXF, SQLite, MS-SQL or MySQL to PostgreSQL.")
2023 (license (license:x11-style "file://LICENSE"))))
2024
2025(define-public postgresql-backup-scripts
2026 (package
2027 (name "postgresql-backup-scripts")
2028 (version "0.0.1")
2029 (source
2030 (origin
2031 (method git-fetch)
2032 (uri (git-reference
2033 (url (string-append "https://codeberg.org/fishinthecalculator/"
2034 "postgresql-backup-scripts"))
2035 (commit version)))
2036 (file-name (git-file-name name version))
2037 (sha256
2038 (base32 "0ig19345p9h2z56k07i6g94pls2b4fhxacf1i8f0hxvk2p4x730k"))))
2039 (build-system copy-build-system)
2040 (arguments
2041 (list
2042 #:install-plan #~'(("./src/" "/bin")
2043 ("./examples" "/share/examples"))
2044 #:phases
2045 #~(modify-phases %standard-phases
2046 (add-after 'install 'chmod
2047 (lambda _
2048 (for-each
2049 (lambda (file) (chmod file #o755))
2050 (find-files (string-append #$output "/bin")))))
2051 (add-after 'chmod 'wrap
2052 (lambda _
2053 (let* ((bin (string-append #$output "/bin"))
2054 (inputs
2055 (list
2056 #$@(map cadr
2057 (package-inputs this-package))))
2058 (lib-directories (search-path-as-list '("lib") inputs))
2059 (bin-directories
2060 (search-path-as-list
2061 '("bin" "sbin" "libexec")
2062 inputs)))
2063 (for-each
2064 (lambda (exe)
2065 (wrap-program exe
2066 `("PATH" ":" prefix
2067 (,(string-join bin-directories ":")))
2068 `("LD_LIBRARY_PATH" ":" prefix
2069 (,(string-join lib-directories ":")))))
2070 (find-files bin))))))))
2071 (inputs
2072 (list coreutils
2073 bash-minimal
2074 findutils
2075 postgresql))
2076 (home-page "https://codeberg.org/fishinthecalculator/postgresql-backup-scripts")
2077 (synopsis "Utility scripts for PostgreSQL backups")
2078 (description
2079 "This package provides two scripts that will backup PostgreSQL databases in
2080a cluster. They are supposed to be run in scheduled jobs. @code{pg_backup.sh}
2081runs regular backups, @code{pg_backup_rotated.sh} runs rotated backups.")
2082 (license
2083 (license:x11-style "file://LICENSE"))))
2084
2085(define-public python-pymysql
2086 (package
2087 (name "python-pymysql")
2088 (version "1.1.1")
2089 (source
2090 (origin
2091 (method url-fetch)
2092 (uri (pypi-uri "pymysql" version))
2093 (sha256
2094 (base32 "1l2cj0ps96g3bblvhdszgyjv9bi405bxrx0bqq1p8h9bmwd629z1"))))
2095 (build-system pyproject-build-system)
2096 (native-inputs
2097 (list python-setuptools python-wheel))
2098 (propagated-inputs
2099 (list python-cryptography python-pynacl))
2100 (arguments
2101 `(#:tests? #f)) ; tests expect a running MySQL
2102 (home-page "https://github.com/PyMySQL/PyMySQL/")
2103 (synopsis "Pure-Python MySQL driver")
2104 (description
2105 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
2106Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
2107 (license license:expat)))
2108
2109(define-public qdbm
2110 (package
2111 (name "qdbm")
2112 (version "1.8.78")
2113 (source
2114 (origin
2115 (method url-fetch)
2116 (uri (string-append "http://fallabs.com/" name "/"
2117 name "-" version ".tar.gz"))
2118 (sha256
2119 (base32
2120 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
2121 (build-system gnu-build-system)
2122 (arguments
2123 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2124 (assoc-ref %outputs "out")
2125 "/lib"))
2126 #:make-flags (list "CFLAGS=-fPIC")))
2127 (home-page "https://fallabs.com/qdbm/")
2128 (synopsis "Key-value database")
2129 (description "QDBM is a library of routines for managing a
2130database. The database is a simple data file containing key-value
2131pairs. Every key and value is serial bytes with variable length.
2132Binary data as well as character strings can be used as a key or a
2133value. There is no concept of data tables or data types. Records are
2134organized in a hash table or B+ tree.")
2135 (license license:lgpl2.1+)))
2136
2137(define-public rayforce
2138 ;; No release commit, version from include/rayforce.h
2139 (let ((revision "1")
2140 (commit "a4a4d059c0b990670462cf1b61c1d2afb1bd7b04"))
2141 (package
2142 (name "rayforce")
2143 (version (git-version "2.1.0" revision commit))
2144 (source (origin
2145 (method git-fetch)
2146 (uri (git-reference
2147 (url "https://github.com/RayforceDB/rayforce")
2148 (commit commit)))
2149 (file-name (git-file-name name version))
2150 (sha256
2151 (base32
2152 "0i2acqag83wkq2a0mbig5fq2nwas7qx3kn9bf5x9awp87hhg7n8c"))))
2153 (build-system gnu-build-system)
2154 (arguments
2155 (list #:make-flags
2156 #~(list (string-append "CC=" #$(cc-for-target))
2157 (string-append "GIT_HASH=" #$commit)
2158 "BUILD_DATE=unknown"
2159 "CFLAGS=-fPIC $(WARNS) -std=$(STD) -g -O2 \
2160 -fsanitize=address,undefined -fno-omit-frame-pointer")
2161 #:test-target "test"
2162 #:phases
2163 #~(modify-phases %standard-phases
2164 (delete 'bootstrap)
2165 (delete 'configure)
2166 (add-after 'build 'build-library
2167 (lambda* (#:key make-flags #:allow-other-keys)
2168 (apply invoke "make" "lib" make-flags)
2169 (invoke #$(cc-for-target) "-shared" "-o" "librayforce.so"
2170 "librayforce.a")))
2171 (add-before 'check 'delete-failing-tests
2172 (lambda _
2173 (with-directory-excursion "test/rfl/system"
2174 (for-each delete-file
2175 (list "ipc_diff.rfl"
2176 "log_journal.rfl"
2177 "log_journal_advanced.rfl")))))
2178 (replace 'install
2179 (lambda _
2180 (install-file "rayforce"
2181 (string-append #$output "/bin"))
2182 (install-file "librayforce.a"
2183 (string-append #$output "/lib"))
2184 (install-file "librayforce.so"
2185 (string-append #$output "/lib"))
2186 (install-file "include/rayforce.h"
2187 (string-append #$output "/include")))))))
2188 (native-inputs (list gawk grep python))
2189 (home-page "https://rayforcedb.com")
2190 (synopsis "Column analytics and graph traversal engine")
2191 (description "Rayforce is a combined engine for performing computations
2192on tables and graphs. It features a Lisp-like language for performing queries
2193and operations.")
2194 (license license:expat))))
2195
2196(define-public recutils
2197 (package
2198 (name "recutils")
2199 (version "1.9")
2200 (source (origin
2201 (method url-fetch)
2202 (uri (string-append "mirror://gnu/recutils/recutils-"
2203 version ".tar.gz"))
2204 (sha256
2205 (base32
2206 "03kf91f20brn2ffljfjzirxh5xj99m1mvvspcx2lph9000mmj0b3"))))
2207 (build-system gnu-build-system)
2208 (arguments
2209 (list #:configure-flags
2210 #~(list "--disable-static"
2211 (string-append "--with-bash-headers="
2212 (search-input-directory %build-inputs
2213 "include/bash"))
2214 ;; Add CFLAGS to relax gcc-14's strictness.
2215 (string-append "CFLAGS=-g -O2"
2216 " -Wno-error=implicit-function-declaration"
2217 " -Wno-error=incompatible-pointer-types"))
2218 #:phases
2219 #~(modify-phases %standard-phases
2220 (add-after 'install 'symlink-bash-loadables
2221 (lambda* (#:key outputs #:allow-other-keys)
2222 (with-directory-excursion (string-append
2223 (assoc-ref outputs "out")
2224 "/lib")
2225 (mkdir "bash")
2226 (for-each
2227 (compose symlink
2228 (lambda (loadable)
2229 (values
2230 (string-append (getcwd) "/" loadable ".so")
2231 (string-append "bash/" loadable))))
2232 '("readrec" "testrec"))))))))
2233 (native-inputs
2234 (list bc check-0.14 pkg-config))
2235 (inputs
2236 ;; TODO: Add more optional inputs.
2237 (list bash ; /bin/bash for native compilation
2238 `(,bash "include")
2239 curl
2240 libgcrypt
2241 `(,util-linux "lib")))
2242 (synopsis "Manipulate plain text files as databases")
2243 (description
2244 "GNU Recutils is a set of tools and libraries for creating and
2245manipulating text-based, human-editable databases. Despite being text-based,
2246databases created with Recutils carry all of the expected features such as
2247unique fields, primary keys, time stamps and more. Many different field
2248types are supported, as is encryption.")
2249 (license license:gpl3+)
2250 (home-page "https://www.gnu.org/software/recutils/")))
2251
2252(define-public emacs-rec-mode
2253 (package
2254 (name "emacs-rec-mode")
2255 (version "1.9.4")
2256 (source (origin
2257 (method url-fetch)
2258 (uri (string-append "https://elpa.gnu.org/packages/"
2259 "rec-mode-" version ".tar"))
2260 (sha256
2261 (base32
2262 "0pi483g5qgz6gvyi13a4ldfbkaad3xkad08aqfcnmsdylvc9zzma"))
2263 (snippet #~(begin (delete-file "rec-mode.info")))))
2264 (build-system emacs-build-system)
2265 (arguments
2266 (list
2267 #:phases
2268 #~(modify-phases %standard-phases
2269 (add-after 'unpack 'patch-program-paths
2270 (lambda* (#:key inputs #:allow-other-keys)
2271 (emacs-substitute-variables "rec-mode.el"
2272 ("rec-recfix" (search-input-file inputs "bin/recfix"))
2273 ("rec-recinf" (search-input-file inputs "bin/recinf"))
2274 ("rec-recsel" (search-input-file inputs "bin/recsel")))))
2275 (add-before 'install 'make-info
2276 (lambda _
2277 (invoke "makeinfo" "--no-split"
2278 "-o" "rec-mode.info" "rec-mode.texi"))))))
2279 (inputs (list recutils))
2280 (native-inputs (list texinfo))
2281 (home-page "https://www.gnu.org/software/recutils/")
2282 (synopsis "Emacs mode for working with recutils database files")
2283 (description "This package provides an Emacs major mode @code{rec-mode}
2284for working with GNU Recutils text-based, human-editable databases. It
2285supports editing, navigation, and querying of recutils database files
2286including field and record folding.")
2287 (license license:gpl3+)))
2288
2289(define-public rocksdb
2290 (package
2291 (name "rocksdb")
2292 (version "10.4.2")
2293 (source (origin
2294 (method git-fetch)
2295 (uri (git-reference
2296 (url "https://github.com/facebook/rocksdb")
2297 (commit (string-append "v" version))))
2298 (file-name (git-file-name name version))
2299 (sha256
2300 (base32
2301 "1cgr33qv639fyx067sg8nsy8mnfac9xgmmw2qwi2bcmir777ma4q"))
2302 (modules '((guix build utils)))
2303 (snippet
2304 '(begin
2305 ;; TODO: unbundle gtest.
2306 (delete-file "build_tools/gnu_parallel")
2307 (substitute* "Makefile"
2308 (("build_tools/gnu_parallel") "parallel"))))))
2309 (build-system cmake-build-system)
2310 (arguments
2311 `(#:configure-flags
2312 (list "-DROCKSDB_BUILD_SHARED=1"
2313 ;; Ceph requires that RTTI is enabled.
2314 "-DUSE_RTTI=1"
2315 ;; Prevent the build from passing '-march=native' to the compiler.
2316 "-DPORTABLE=1"
2317 "-DWITH_SNAPPY=1")
2318
2319 ;; Many tests fail on 32-bit platforms. There are multiple
2320 ;; reports about this upstream, but it's not going to be
2321 ;; supported any time soon. What's worse: Release builds don't
2322 ;; include tests, and overriding the build system to build
2323 ;; tests anyway fails with missing TEST_ symbols.
2324 #:tests? #false
2325 #:phases
2326 (modify-phases %standard-phases
2327 (add-after 'unpack 'patch-CMakeLists.txt
2328 (lambda _
2329 (substitute* "CMakeLists.txt"
2330 ;; build reproducibly
2331 (("set\\(BUILD_DATE \"\\$\\{TS\\}\"")
2332 "set(BUILD_DATE \"1970-01-01\""))))
2333 (add-after 'unpack 'build-generically
2334 (lambda _
2335 (substitute* "CMakeLists.txt"
2336 (("if\\(HAVE_SSE42\\)") "if(FALSE)")))))))
2337 (native-inputs
2338 (list parallel perl procps python which))
2339 (inputs
2340 (list bzip2
2341 gflags
2342 jemalloc
2343 lz4
2344 zlib))
2345 ;; RocksDBConfig.cmake references snappy.
2346 (propagated-inputs (list snappy))
2347 (home-page "https://rocksdb.org/")
2348 (synopsis "Persistent key-value store for fast storage")
2349 (description
2350 "RocksDB is a library that forms the core building block for a fast
2351key-value server, especially suited for storing data on flash drives. It
2352has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
2353between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
2354(RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
2355compactions, making it specially suitable for storing multiple terabytes of
2356data in a single database. RocksDB is partially based on @code{LevelDB}.")
2357 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
2358 ;; files carry the 3-clause BSD license.
2359 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
2360
2361(define-public rocksdb-for-ceph
2362 (let ((commit "9fa4990159853479a222244574ca41202e4c95c1")
2363 (revision "0"))
2364 (package
2365 (inherit rocksdb)
2366 (name "rocksdb-for-ceph")
2367 (version (git-version "7.9.2" revision commit))
2368 (source (origin
2369 (inherit (package-source rocksdb))
2370 (uri (git-reference
2371 (url "https://github.com/ceph/rocksdb")
2372 (commit commit)))
2373 (file-name (git-file-name name version))
2374 (sha256
2375 (base32
2376 "0pdy461m9a48x4i829sirpypdlzf3q79p8iw3dng9wd4r4vyv594"))))
2377 (arguments (substitute-keyword-arguments arguments
2378 ((#:configure-flags flags ''())
2379 #~(cons "-DCMAKE_CXX_FLAGS=-Wno-error=maybe-uninitialized"
2380 #$flags)))))))
2381
2382(define-public sparql-query
2383 (package
2384 (name "sparql-query")
2385 (version "1.1")
2386 (source (origin
2387 (method git-fetch)
2388 (uri (git-reference
2389 (url "https://github.com/tialaramex/sparql-query")
2390 (commit version)))
2391 (sha256
2392 (base32 "0a84a89idpjhj9w2y3fmvzv7ldps1cva1kxvfmh897k02kaniwxk"))
2393 (file-name (git-file-name name version))))
2394 (build-system gnu-build-system)
2395 (inputs
2396 (list curl glib libxml2 ncurses readline))
2397 (native-inputs
2398 (list pkg-config))
2399 (arguments
2400 `(#:make-flags '("CC=gcc")
2401 #:phases
2402 (modify-phases %standard-phases
2403 (delete 'configure)
2404 ;; The Makefile uses git to obtain versioning information. This phase
2405 ;; substitutes the git invocation with the package version.
2406 (add-after 'unpack 'remove-git-dependency
2407 (lambda _
2408 (substitute* "Makefile"
2409 (("^gitrev :=.*$")
2410 (string-append "gitrev = \"v" ,version "\"")))
2411 #t))
2412 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
2413 ;; This replacement does the same thing, except for using $PREFIX/bin
2414 ;; instead.
2415 (replace 'install
2416 (lambda* (#:key outputs #:allow-other-keys)
2417 (let* ((out (assoc-ref outputs "out"))
2418 (bin (string-append out "/bin")))
2419 (install-file "sparql-query" bin)
2420 (symlink (string-append bin "/sparql-query")
2421 (string-append bin "/sparql-update")))
2422 #t))
2423 (replace 'check
2424 (lambda* (#:key make-flags #:allow-other-keys)
2425 (apply invoke "make" `(,@make-flags "scan-test"))
2426 (invoke "./scan-test"))))))
2427 (home-page "https://github.com/tialaramex/sparql-query/")
2428 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
2429 (description "Sparql-query is a command-line tool for accessing SPARQL
2430endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
2431tools for interrogating SQL databases. For example, you can enter a query over
2432several lines, using a semi-colon at the end of a line to indicate the end of
2433your query. It also supports readline so that you can more easily recall and
2434edit previous queries, even across sessions. It can be used non-interactively,
2435for example from a shell script.")
2436 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
2437 ;; others (like sparql-query.c) contain a GPLv2+ license header.
2438 (license (list license:gpl3+))))
2439
2440(define-public sqitch
2441 (package
2442 (name "sqitch")
2443 (version "1.1.0")
2444 (source
2445 (origin
2446 (method url-fetch)
2447 (uri (string-append
2448 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
2449 version ".tar.gz"))
2450 (sha256
2451 (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
2452 (build-system perl-build-system)
2453 (arguments
2454 '(#:phases
2455 (modify-phases %standard-phases
2456 (add-before 'check 'set-check-environment
2457 (lambda _
2458 (setenv "TZ" "UTC")
2459 (setenv "HOME" "/tmp")))
2460 (add-after 'install 'wrap-program
2461 (lambda* (#:key outputs #:allow-other-keys)
2462 (let* ((out (assoc-ref outputs "out"))
2463 (path (getenv "PERL5LIB")))
2464 (wrap-program (string-append out "/bin/sqitch")
2465 `("PERL5LIB" ":" prefix
2466 (,(string-append out "/lib/perl5/site_perl"
2467 ":"
2468 path))))))))))
2469 (native-inputs
2470 (list perl-capture-tiny
2471 perl-io-pager
2472 perl-module-build
2473 perl-module-runtime
2474 perl-path-class
2475 perl-test-deep
2476 perl-test-dir
2477 perl-test-exception
2478 perl-test-file
2479 perl-test-file-contents
2480 perl-test-mockmodule
2481 perl-test-mockobject
2482 perl-test-nowarnings
2483 perl-test-warn))
2484 (inputs
2485 (list bash-minimal
2486 perl-class-xsaccessor
2487 perl-clone
2488 perl-config-gitlike
2489 perl-datetime
2490 perl-datetime-timezone
2491 perl-dbd-mysql
2492 perl-dbd-pg
2493 perl-dbd-sqlite
2494 perl-dbi
2495 perl-devel-stacktrace
2496 perl-encode-locale
2497 perl-hash-merge
2498 perl-ipc-run3
2499 perl-ipc-system-simple
2500 perl-libintl-perl
2501 perl-list-moreutils
2502 perl-moo
2503 perl-mysql-config
2504 perl-namespace-autoclean
2505 perl-path-class
2506 perl-perlio-utf8_strict
2507 perl-string-formatter
2508 perl-string-shellquote
2509 perl-sub-exporter
2510 perl-template-tiny
2511 perl-template-toolkit
2512 perl-throwable
2513 perl-try-tiny
2514 perl-type-tiny
2515 perl-type-tiny-xs
2516 perl-uri
2517 perl-uri-db))
2518 (home-page "https://sqitch.org/")
2519 (synopsis "Database change management tool")
2520 (description
2521 "Sqitch is a standalone change management system for database schemas,
2522which uses SQL to describe changes.")
2523 (license license:x11)))
2524
2525(define-public tdb
2526 (package
2527 (name "tdb")
2528 (version "1.4.12")
2529 (source (origin
2530 (method url-fetch)
2531 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
2532 version ".tar.gz"))
2533 (sha256
2534 (base32
2535 "0yndhh829ai2p3n4i63h1rhl22dcvzba0rffgqihjbc1k1sb5r3c"))))
2536 (build-system gnu-build-system)
2537 (arguments
2538 '(#:phases
2539 (modify-phases %standard-phases
2540 (replace 'configure
2541 (lambda* (#:key outputs #:allow-other-keys)
2542 (let ((out (assoc-ref outputs "out")))
2543 ;; The 'configure' script is a wrapper for Waf and
2544 ;; doesn't recognize things like '--enable-fast-install'.
2545 (invoke "./configure"
2546 (string-append "--prefix=" out))))))))
2547 (native-inputs
2548 (list docbook-xsl
2549 libxcrypt
2550 libxslt
2551 python ;for the Waf build system
2552 which))
2553 (home-page "https://tdb.samba.org/")
2554 (synopsis "Trivial database")
2555 (description
2556 "TDB is a Trivial Database. In concept, it is very much like GDBM,
2557and BSD's DB except that it allows multiple simultaneous writers and uses
2558locking internally to keep writers from trampling on each other. TDB is also
2559extremely small.")
2560 (license license:lgpl3+)))
2561
2562(define-public perl-dbi
2563 (package
2564 (name "perl-dbi")
2565 (version "1.643")
2566 (source (origin
2567 (method url-fetch)
2568 (uri (string-append
2569 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
2570 version ".tar.gz"))
2571 (sha256
2572 (base32
2573 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa"))))
2574 (build-system perl-build-system)
2575 (synopsis "Database independent interface for Perl")
2576 (description "This package provides a database interface for Perl.")
2577 (home-page "https://metacpan.org/release/DBI")
2578 (license license:perl-license)))
2579
2580(define-public perl-dbix-class
2581 (package
2582 (name "perl-dbix-class")
2583 (version "0.082843")
2584 (source
2585 (origin
2586 (method url-fetch)
2587 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
2588 "DBIx-Class-" version ".tar.gz"))
2589 (sha256
2590 (base32 "0lgjw7z4y2inf3yyfph1ljdp4f5zdmy9vh56fj8w9n19rdp0n7il"))))
2591 (build-system perl-build-system)
2592 (native-inputs
2593 (list perl-dbd-sqlite
2594 perl-module-install
2595 perl-package-stash
2596 perl-test-deep
2597 perl-test-exception
2598 perl-test-warn))
2599 (propagated-inputs
2600 (list perl-class-accessor-grouped
2601 perl-class-c3-componentised
2602 perl-class-inspector
2603 perl-config-any
2604 perl-context-preserve
2605 perl-data-dumper-concise
2606 perl-data-page
2607 perl-dbi
2608 perl-devel-globaldestruction
2609 perl-hash-merge
2610 perl-module-find
2611 perl-moo-2
2612 perl-mro-compat
2613 perl-namespace-clean
2614 perl-path-class
2615 perl-scope-guard
2616 perl-sql-abstract-classic
2617 perl-sub-name
2618 perl-try-tiny))
2619 (home-page "https://metacpan.org/release/DBIx-Class")
2620 (synopsis "Extensible and flexible object <-> relational mapper")
2621 (description "An SQL to OO mapper with an object API inspired by
2622Class::DBI (with a compatibility layer as a springboard for porting) and a
2623resultset API that allows abstract encapsulation of database operations. It
2624aims to make representing queries in your code as perl-ish as possible while
2625still providing access to as many of the capabilities of the database as
2626possible, including retrieving related records from multiple tables in a
2627single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
2628\"ORDER BY\" and \"HAVING\" support.")
2629 (properties
2630 ;; This is needed for perl-catalyst-authentication-store-dbix-class
2631 `((updater-extra-propagated-inputs . ("perl-data-page"))))
2632 (license license:perl-license)))
2633
2634(define-public perl-dbix-class-cursor-cached
2635 (package
2636 (name "perl-dbix-class-cursor-cached")
2637 (version "1.001004")
2638 (source
2639 (origin
2640 (method url-fetch)
2641 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
2642 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
2643 (sha256
2644 (base32
2645 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
2646 (build-system perl-build-system)
2647 (native-inputs
2648 (list perl-cache-cache perl-dbd-sqlite perl-module-install))
2649 (propagated-inputs
2650 (list perl-carp-clan perl-dbix-class))
2651 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
2652 (synopsis "Cursor with built-in caching support")
2653 (description "DBIx::Class::Cursor::Cached provides a cursor class with
2654built-in caching support.")
2655 (license license:perl-license)))
2656
2657(define-public perl-dbix-class-introspectablem2m
2658 (package
2659 (name "perl-dbix-class-introspectablem2m")
2660 (version "0.001002")
2661 (source
2662 (origin
2663 (method url-fetch)
2664 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
2665 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
2666 (sha256
2667 (base32
2668 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
2669 (build-system perl-build-system)
2670 (native-inputs
2671 (list perl-module-install))
2672 (propagated-inputs
2673 (list perl-dbix-class))
2674 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
2675 (synopsis "Introspect many-to-many relationships")
2676 (description "Because the many-to-many relationships are not real
2677relationships, they can not be introspected with DBIx::Class. Many-to-many
2678relationships are actually just a collection of convenience methods installed
2679to bridge two relationships. This DBIx::Class component can be used to store
2680all relevant information about these non-relationships so they can later be
2681introspected and examined.")
2682 (license license:perl-license)))
2683
2684(define-public perl-dbix-class-schema-loader
2685 (package
2686 (name "perl-dbix-class-schema-loader")
2687 (version "0.07049")
2688 (source
2689 (origin
2690 (method url-fetch)
2691 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
2692 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
2693 (sha256
2694 (base32
2695 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
2696 (build-system perl-build-system)
2697 (native-inputs
2698 (list perl-config-any
2699 perl-config-general
2700 perl-dbd-sqlite
2701 perl-dbix-class-introspectablem2m
2702 perl-module-install
2703 perl-moose
2704 perl-moosex-markasmethods
2705 perl-moosex-nonmoose
2706 perl-namespace-autoclean
2707 perl-test-deep
2708 perl-test-differences
2709 perl-test-exception
2710 perl-test-pod
2711 perl-test-warn))
2712 (propagated-inputs
2713 (list perl-class-unload
2714 perl-class-inspector
2715 perl-class-accessor-grouped
2716 perl-class-c3-componentised
2717 perl-carp-clan
2718 perl-data-dump
2719 perl-dbix-class
2720 perl-hash-merge
2721 perl-list-moreutils
2722 perl-lingua-en-inflect-phrase
2723 perl-lingua-en-inflect-number
2724 perl-lingua-en-tagger
2725 perl-namespace-clean
2726 perl-mro-compat
2727 perl-scope-guard
2728 perl-string-camelcase
2729 perl-string-toidentifier-en
2730 perl-sub-name
2731 perl-try-tiny))
2732 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
2733 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
2734 (synopsis "Create a DBIx::Class::Schema based on a database")
2735 (description "DBIx::Class::Schema::Loader automates the definition of a
2736DBIx::Class::Schema by scanning database table definitions and setting up the
2737columns, primary keys, unique constraints and relationships.")
2738 (license license:perl-license)))
2739
2740(define-public perl-dbix-class-deploymenthandler
2741 (package
2742 (name "perl-dbix-class-deploymenthandler")
2743 (version "0.002233")
2744 (source (origin
2745 (method url-fetch)
2746 (uri (string-append
2747 "mirror://cpan/authors/id/M/MM/MMCCLIMON/DBIx-Class-DeploymentHandler-"
2748 version ".tar.gz"))
2749 (sha256
2750 (base32
2751 "1bikp1q3pm1xphfdr8kmsqvzzpk06an3112mhb6gl8vlpg81ch4m"))))
2752 (build-system perl-build-system)
2753 (native-inputs (list perl-aliased
2754 perl-dbd-sqlite
2755 perl-dbix-class-schema-loader
2756 perl-test-fatal
2757 perl-test-most
2758 perl-test-requires))
2759 (propagated-inputs (list perl-carp-clan
2760 perl-context-preserve
2761 perl-dbix-class
2762 perl-log-contextual
2763 perl-module-runtime
2764 perl-moose
2765 perl-moosex-role-parameterized
2766 perl-namespace-autoclean
2767 perl-path-class
2768 perl-sql-splitstatement
2769 perl-sql-translator
2770 perl-sub-exporter-progressive
2771 perl-sub-quote
2772 perl-text-brew
2773 perl-try-tiny
2774 perl-yaml))
2775 (home-page "https://metacpan.org/release/DBIx-Class-DeploymentHandler")
2776 (synopsis "Extensible DBIx::Class deployment")
2777 (description
2778 "@code{DBIx::Class::DeploymentHandler} is a tool for deploying and
2779upgrading databases with @code{DBIx::Class}. It is designed to be much more
2780flexible than @code{DBIx::Class::Schema::Versioned}, hence the use of Moose
2781and lots of roles.")
2782 (license license:perl-license)))
2783
2784(define-public perl-dbix-simple
2785 (package
2786 (name "perl-dbix-simple")
2787 (version "1.37")
2788 (source (origin
2789 (method url-fetch)
2790 (uri (string-append
2791 "mirror://cpan/authors/id/J/JU/JUERD/DBIx-Simple-" version
2792 ".tar.gz"))
2793 (sha256
2794 (base32
2795 "1qyaj01zb6xplzcp7pj0b9609fvd89c9c4an3i00g2g05jm13ls6"))))
2796 (build-system perl-build-system)
2797 (propagated-inputs (list perl-dbi))
2798 (home-page "https://metacpan.org/release/DBIx-Simple")
2799 (synopsis "Object-oriented interface to DBI")
2800 (description
2801 "DBIx::Simple provides a simplified interface to DBI, Perl's powerful
2802database module. This module is aimed at rapid development and easy
2803maintenance. Query preparation and execution are combined in a single method,
2804the result object (which is a wrapper around the statement handle) provides
2805easy row-by-row and slurping methods.")
2806 ;; The POD info says: "Pick your favorite OSI-approved license"
2807 ;; Use unlicense because it has the least restrictions.
2808 (license license:unlicense)))
2809
2810(define-public perl-dbicx-testdatabase
2811 (package
2812 (name "perl-dbicx-testdatabase")
2813 (version "0.05")
2814 (source (origin
2815 (method url-fetch)
2816 (uri (string-append
2817 "mirror://cpan/authors/id/J/JR/JROCKWAY/DBICx-TestDatabase-"
2818 version ".tar.gz"))
2819 (sha256
2820 (base32
2821 "1kqaiygxiarrqkgqbq1s3xilx77msbdsqrdaqf4628811d9w4fwf"))))
2822 (build-system perl-build-system)
2823 (native-inputs (list perl-dbix-class perl-module-install))
2824 (propagated-inputs (list perl-dbd-sqlite
2825 perl-sql-translator))
2826 (home-page "https://metacpan.org/release/DBICx-TestDatabase")
2827 (synopsis "Create a temporary database from a DBIx::Class::Schema")
2828 (description
2829 "This module creates a temporary SQLite database, deploys a DBIC schema,
2830and then connects to it. This lets you easily test DBIC schema. Since you have
2831a fresh database for every test, you don't have to worry about cleaning up
2832after your tests, ordering of tests affecting failure, etc.")
2833 (license license:perl-license)))
2834
2835(define-public perl-dbix-class-dynamicdefault
2836 (package
2837 (name "perl-dbix-class-dynamicdefault")
2838 (version "0.04")
2839 (source (origin
2840 (method url-fetch)
2841 (uri (string-append
2842 "mirror://cpan/authors/id/M/MS/MSTROUT/DBIx-Class-DynamicDefault-"
2843 version ".tar.gz"))
2844 (sha256
2845 (base32
2846 "1yssda00988hn9v96jl95apbzib74vgbcgf69m5mhhj64amm33r2"))))
2847 (build-system perl-build-system)
2848 (native-inputs (list perl-dbicx-testdatabase perl-module-install))
2849 (propagated-inputs (list perl-dbix-class))
2850 (home-page "https://metacpan.org/release/DBIx-Class-DynamicDefault")
2851 (synopsis "Automatically set and update fields")
2852 (description
2853 "Automatically set and update fields with values calculated at runtime.
2854Ipdate or create actions will set the specified columns to the value returned
2855by the callback you specified as a method name or code reference.")
2856 (license license:perl-license)))
2857
2858(define-public perl-dbix-class-timestamp
2859 (package
2860 (name "perl-dbix-class-timestamp")
2861 (version "0.14")
2862 (source (origin
2863 (method url-fetch)
2864 (uri (string-append
2865 "mirror://cpan/authors/id/R/RI/RIBASUSHI/DBIx-Class-TimeStamp-"
2866 version ".tar.gz"))
2867 (sha256
2868 (base32
2869 "1zhr4r5ffihqsh2imap7zmps2y0h71piqqhg2nqhcwkjhvlxb958"))))
2870 (build-system perl-build-system)
2871 (native-inputs (list perl-class-accessor-grouped
2872 perl-datetime-format-mysql
2873 perl-datetime-format-sqlite
2874 perl-dbd-sqlite
2875 perl-module-install
2876 perl-test-pod
2877 perl-time-warp))
2878 (propagated-inputs (list perl-datetime
2879 perl-dbix-class
2880 perl-dbix-class-dynamicdefault))
2881 (home-page "https://metacpan.org/release/DBIx-Class-TimeStamp")
2882 (synopsis
2883 "DBIx::Class extension to update and create date and time based fields")
2884 (description
2885 "This package works in conjunction with @code{InflateColumn::DateTime} to
2886automatically set update and create date and time based fields in a table.")
2887 (license license:perl-license)))
2888
2889(define-public perl-dbd-pg
2890 (package
2891 (name "perl-dbd-pg")
2892 (version "3.15.1")
2893 (source
2894 (origin
2895 (method url-fetch)
2896 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
2897 "DBD-Pg-" version ".tar.gz"))
2898 (sha256
2899 (base32
2900 "0zn17xb6bmixkmv53p576igzw1jd43cwql35r19m56jwahxm9iqk"))))
2901 (build-system perl-build-system)
2902 (native-inputs
2903 (list perl-dbi))
2904 (propagated-inputs
2905 (list perl-dbi postgresql))
2906 (home-page "https://metacpan.org/release/DBD-Pg")
2907 (synopsis "DBI PostgreSQL interface")
2908 (description "This package provides a PostgreSQL driver for the Perl5
2909@dfn{Database Interface} (DBI).")
2910 (license license:perl-license)))
2911
2912(define-public perl-dbd-mysql
2913 (package
2914 (name "perl-dbd-mysql")
2915 (version "4.050")
2916 (source
2917 (origin
2918 (method url-fetch)
2919 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
2920 "DBD-mysql-" version ".tar.gz"))
2921 (sha256
2922 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
2923 (build-system perl-build-system)
2924 (arguments
2925 (list
2926 ;; Tests require running MySQL server.
2927 #:tests? #f
2928 #:phases
2929 #~(modify-phases %standard-phases
2930 (add-after 'configure 'add-cflags
2931 (lambda _
2932 (substitute* "Makefile"
2933 (("OPTIMIZE = -O2")
2934 (string-append "OPTIMIZE = -O2 "
2935 "-Wno-error=incompatible-pointer-types "
2936 "-Wno-error=implicit-function-declaration")))))
2937 (add-before 'configure 'skip-library-detection
2938 ;; Avoid dependencies on perl-devel-checklib, openssl, and zlib. They
2939 ;; are really only needed for the test suite; their absence does not
2940 ;; affect the build or the end result.
2941 (lambda _
2942 (substitute* "Makefile.PL"
2943 (("use Devel::CheckLib;" match)
2944 (string-append "# " match))
2945 (("assert_lib")
2946 "print")))))))
2947 (propagated-inputs
2948 `(("perl-dbi" ,perl-dbi)
2949 ("mysql" ,mariadb "lib")
2950 ("mysql-dev" ,mariadb "dev")))
2951 (home-page "https://metacpan.org/release/DBD-mysql")
2952 (synopsis "DBI MySQL interface")
2953 (description "This package provides a MySQL driver for the Perl5
2954@dfn{Database Interface} (DBI).")
2955 (license license:perl-license)))
2956
2957(define-public perl-dbd-sqlite
2958 (package
2959 (name "perl-dbd-sqlite")
2960 (version "1.66")
2961 (source (origin
2962 (method url-fetch)
2963 (uri (string-append
2964 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
2965 version ".tar.gz"))
2966 (sha256
2967 (base32
2968 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
2969 (build-system perl-build-system)
2970 (inputs (list sqlite))
2971 (propagated-inputs (list perl-dbi))
2972 (synopsis "SQlite interface for Perl")
2973 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
2974the entire thing in the distribution. So in order to get a fast transaction
2975capable RDBMS working for your Perl project you simply have to install this
2976module, and nothing else.")
2977 (license license:perl-license)
2978 (home-page "https://metacpan.org/release/DBD-SQLite")))
2979
2980(define-public perl-mysql-config
2981 (package
2982 (name "perl-mysql-config")
2983 (version "1.04")
2984 (source
2985 (origin
2986 (method url-fetch)
2987 (uri (string-append
2988 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
2989 version
2990 ".tar.gz"))
2991 (sha256
2992 (base32
2993 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
2994 (build-system perl-build-system)
2995 (home-page "https://metacpan.org/release/MySQL-Config")
2996 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
2997 (description
2998 "@code{MySQL::Config} emulates the @code{load_defaults} function from
2999libmysqlclient. It will fill an array with long options, ready to be parsed by
3000@code{Getopt::Long}.")
3001 (license license:perl-license)))
3002
3003(define-public perl-sql-abstract
3004 (package
3005 (name "perl-sql-abstract")
3006 (version "1.87")
3007 (source
3008 (origin
3009 (method url-fetch)
3010 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
3011 "SQL-Abstract-" version ".tar.gz"))
3012 (sha256
3013 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9"))))
3014 (build-system perl-build-system)
3015 (native-inputs
3016 (list perl-module-install perl-test-deep perl-test-exception
3017 perl-test-warn))
3018 (propagated-inputs
3019 (list perl-hash-merge perl-moo perl-mro-compat perl-text-balanced))
3020 (home-page "https://metacpan.org/release/SQL-Abstract")
3021 (synopsis "Generate SQL from Perl data structures")
3022 (description "This module was inspired by the excellent DBIx::Abstract.
3023While based on the concepts used by DBIx::Abstract, the concepts used have
3024been modified to make the SQL easier to generate from Perl data structures.
3025The underlying idea is for this module to do what you mean, based on the data
3026structures you provide it, so that you don't have to modify your code every
3027time your data changes.")
3028 (license license:perl-license)))
3029
3030(define-public perl-sql-abstract-classic
3031 (package
3032 (name "perl-sql-abstract-classic")
3033 (version "1.91")
3034 (source
3035 (origin
3036 (method url-fetch)
3037 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
3038 "SQL-Abstract-Classic-" version ".tar.gz"))
3039 (sha256
3040 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
3041 (build-system perl-build-system)
3042 (native-inputs
3043 (list perl-test-deep perl-test-exception perl-test-warn))
3044 (propagated-inputs
3045 (list perl-mro-compat perl-sql-abstract))
3046 (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
3047 (synopsis "Generate SQL from Perl data structures")
3048 (description
3049 "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
3050to preserve the ability of users to opt into the new way of doing things in
3051later versions according to their own schedules.
3052
3053It is an abstract SQL generation module based on the concepts used by
3054@code{DBIx::Abstract}, with several important differences, especially when it
3055comes to @code{WHERE} clauses. These concepts were modified to make the SQL
3056easier to generate from Perl data structures.
3057
3058The underlying idea is for this module to do what you mean, based on the data
3059structures you provide it. You shouldn't have to modify your code every time
3060your data changes, as this module figures it out.")
3061 (license license:perl-license)))
3062
3063(define-public perl-sql-splitstatement
3064 (package
3065 (name "perl-sql-splitstatement")
3066 (version "1.00023")
3067 (source
3068 (origin
3069 (method url-fetch)
3070 (uri (string-append "mirror://cpan/authors/id/V/VE/VEESH/"
3071 "SQL-SplitStatement-" version ".tar.gz"))
3072 (sha256
3073 (base32 "0ppkx46nydzlnsxf9a8pkyb74wggfrdiiwafab143lrarlh88x0s"))))
3074 (build-system perl-build-system)
3075 (native-inputs
3076 (list perl-test-differences perl-test-exception perl-test-script))
3077 (propagated-inputs
3078 (list perl-class-accessor perl-list-moreutils perl-regexp-common
3079 perl-sql-tokenizer))
3080 (home-page "https://metacpan.org/release/SQL-SplitStatement")
3081 (synopsis "Split SQL code into atomic statements")
3082 (description "This module tries to split any SQL code, even including
3083non-standard extensions, into the atomic statements it is composed of.")
3084 (license license:perl-license)))
3085
3086(define-public perl-sql-tokenizer
3087 (package
3088 (name "perl-sql-tokenizer")
3089 (version "0.24")
3090 (source
3091 (origin
3092 (method url-fetch)
3093 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
3094 "SQL-Tokenizer-" version ".tar.gz"))
3095 (sha256
3096 (base32
3097 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
3098 (build-system perl-build-system)
3099 (home-page "https://metacpan.org/release/SQL-Tokenizer")
3100 (synopsis "SQL tokenizer")
3101 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
3102claim to be a parser or query verifier. It just creates sane tokens from a
3103valid SQL query.")
3104 (license license:perl-license)))
3105
3106(define-public perl-sql-translator
3107 (package
3108 (name "perl-sql-translator")
3109 (version "1.63")
3110 (source (origin
3111 (method url-fetch)
3112 (uri (string-append
3113 "mirror://cpan/authors/id/V/VE/VEESH/SQL-Translator-"
3114 version ".tar.gz"))
3115 (sha256
3116 (base32
3117 "0cric118ms3dcnb3m2a1jdhdxmai8wwp5jbx34mf72s9jd6b11aq"))))
3118 (build-system perl-build-system)
3119 (native-inputs (list perl-file-sharedir-install
3120 perl-json-maybexs
3121 perl-test-differences
3122 perl-test-exception
3123 perl-test-most
3124 perl-xml-writer
3125 perl-yaml))
3126 (propagated-inputs (list perl-carp-clan
3127 perl-dbi
3128 perl-file-sharedir
3129 perl-gd
3130 perl-graph
3131 perl-graphviz
3132 perl-moo
3133 perl-package-variant
3134 perl-parse-recdescent
3135 perl-spreadsheet-parseexcel
3136 perl-strictures-2
3137 perl-sub-quote
3138 perl-template-toolkit
3139 perl-text-recordparser
3140 perl-try-tiny
3141 perl-xml-libxml))
3142 (home-page "https://metacpan.org/release/SQL-Translator")
3143 (synopsis "Manipulate structured data definitions (SQL and more)")
3144 (description
3145 "@code{SQL::Translator} is a group of Perl modules that converts
3146vendor-specific SQL table definitions into other formats, such as other
3147vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and
3148@code{Class::DBI} classes. The main focus is SQL, but parsers exist for other
3149structured data formats, including Excel spreadsheets and arbitrarily
3150delimited text files. Through the separation of the code into parsers and
3151producers with an object model in between, it's possible to combine any parser
3152with any producer, to plug in custom parsers or producers, or to manipulate
3153the parsed data via the built-in object model. Presently only the definition
3154parts of SQL are handled (CREATE, ALTER), not the manipulation of
3155data (INSERT, UPDATE, DELETE).")
3156 (license license:perl-license)))
3157
3158(define-public perl-test-postgresql
3159 (package
3160 (name "perl-test-postgresql")
3161 (version "1.29")
3162 (source (origin
3163 (method url-fetch)
3164 (uri (string-append
3165 "mirror://cpan/authors/id/T/TJ/TJC/Test-PostgreSQL-" version
3166 ".tar.gz"))
3167 (sha256
3168 (base32
3169 "17jgiqdyprb8q4855anica2kr0lxdi9rnq27vsfclk6ai7jzgb0q"))))
3170 (build-system perl-build-system)
3171 (arguments
3172 (list #:tests? #f)) ;2/41 fail, require running Postgres server
3173 (native-inputs (list perl-module-build-tiny
3174 perl-test-sharedfork))
3175 (propagated-inputs (list perl-dbd-pg
3176 perl-dbi
3177 perl-file-which
3178 perl-function-parameters
3179 perl-moo
3180 perl-tie-hash-method
3181 perl-try-tiny
3182 perl-type-tiny))
3183 (home-page "https://metacpan.org/release/Test-PostgreSQL")
3184 (synopsis "PostgreSQL runner for tests")
3185 (description
3186 "@code{Test::PostgreSQL} automatically setups a PostgreSQL instance in a
3187temporary directory, and destroys it when the perl script exits.")
3188 (license license:artistic2.0)))
3189
3190(define-public pg-prove
3191 (package
3192 (name "pg-prove")
3193 (version "3.37")
3194 (source
3195 (origin
3196 (method url-fetch)
3197 (uri (string-append
3198 "mirror://cpan/authors/id/D/DW/DWHEELER/TAP-Parser-SourceHandler-pgTAP-"
3199 version ".tar.gz"))
3200 (sha256
3201 (base32 "0zarga5pvl6wdc3jv3brvzfgids4zzsdddgp65qnh7ia8j0qb4kf"))))
3202 (build-system perl-build-system)
3203 (native-inputs (list perl-module-build))
3204 (home-page "https://pgtap.org/pg_prove.html")
3205 (synopsis "Run and harness pgTAP tests")
3206 (description
3207 "@command{pg_prove} is a command-line application to run one or more
3208pgTAP tests in a PostgreSQL database. The output of the tests is harvested
3209and processed by TAP::Harness in order to summarize the results of the test.")
3210 (license license:perl-license)))
3211
3212(define-public unixodbc
3213 (package
3214 (name "unixodbc")
3215 (version "2.3.14")
3216 (source (origin
3217 (method url-fetch)
3218 (uri
3219 (string-append
3220 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
3221 version ".tar.gz"))
3222 (sha256
3223 (base32 "0wa7a82h5dsba23155gfhh1sp4dsbaxq6pppp6q31z017vg18a2f"))))
3224 (build-system gnu-build-system)
3225 (synopsis "Data source abstraction library")
3226 (description "Unixodbc is a library providing an API with which to access
3227data sources. Data sources include SQL Servers and any software with an ODBC
3228Driver.")
3229 (license license:lgpl2.1+)
3230 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
3231 (home-page "https://www.unixodbc.org")))
3232
3233(define-public sqliteodbc
3234 (package
3235 (name "sqliteodbc")
3236 (version "0.99991")
3237 (source (origin
3238 (method url-fetch)
3239 (uri (string-append "http://www.ch-werner.de/sqliteodbc/"
3240 name "-" version ".tar.gz"))
3241 (sha256
3242 (base32
3243 "0p4avhqxnd2l49g3vpzwrmdi8wxyqzy0vswalaagmqfdsfwav52d"))))
3244 (build-system gnu-build-system)
3245 (arguments
3246 (list
3247 #:tests? #f ; no check target
3248 #:configure-flags
3249 #~(list "--disable-static"
3250 (string-append "--with-sqlite3=" #$(this-package-input "sqlite"))
3251 (string-append "--with-odbc=" #$(this-package-input "unixodbc")))
3252 #:phases
3253 #~(modify-phases %standard-phases
3254 (add-before 'install 'create-lib-directory
3255 (lambda _
3256 (mkdir-p (string-append #$output "/lib"))))
3257 (add-after 'install 'remove-extra-sqlite-extensions
3258 (lambda _
3259 ;; Keep this package focused on the ODBC driver itself.
3260 (for-each delete-file
3261 (find-files (string-append #$output "/lib")
3262 "^libsqlite3_mod_.*\\.(la|so)$"))))
3263 (add-after 'install 'install-odbcinst.ini
3264 (lambda _
3265 (let ((dir (string-append #$output "/share/sqliteodbc")))
3266 (mkdir-p dir)
3267 (call-with-output-file (string-append dir "/odbcinst.ini")
3268 (lambda (port)
3269 (display
3270 (string-append
3271 "[SQLite3]\n"
3272 "Description = SQLite3 ODBC Driver\n"
3273 "Driver = " #$output "/lib/libsqlite3odbc.so\n"
3274 "Setup = " #$output "/lib/libsqlite3odbc.so\n"
3275 "Threading = 2\n")
3276 port)))))))))
3277 (native-search-paths
3278 (list (search-path-specification
3279 (variable "ODBCSYSINI")
3280 (files '("share/sqliteodbc"))
3281 (separator #f))))
3282 (inputs (list sqlite unixodbc))
3283 (home-page "http://www.ch-werner.de/sqliteodbc/")
3284 (synopsis "ODBC driver for SQLite")
3285 (description
3286 "SQLiteODBC provides an ODBC driver for SQLite 3 databases. It installs
3287the shared library and a driver registration file so applications using
3288unixODBC can resolve the @code{SQLite3} driver name from a Guix profile.")
3289 (license license:tcl/tk)))
3290
3291(define-public nanodbc
3292 (package
3293 (name "nanodbc")
3294 (version "2.14.0")
3295 (source (origin
3296 (method git-fetch)
3297 (uri
3298 (git-reference
3299 (url "https://github.com/nanodbc/nanodbc")
3300 (commit (string-append "v" version))))
3301 (file-name (git-file-name name version))
3302 (sha256
3303 (base32
3304 "1253bnrmchga3ra99jqkd2p29bc5h2ip79xd8afblz6b1v00wmbm"))))
3305 (build-system cmake-build-system)
3306 (arguments
3307 `(#:configure-flags
3308 ;; The tests require ODBC backends to be installed.
3309 (list "-DNANODBC_DISABLE_TESTS=ON"
3310 "-DBUILD_SHARED_LIBS=ON")
3311 #:tests? #false))
3312 (inputs
3313 (list unixodbc))
3314 (home-page "https://nanodbc.io/")
3315 (synopsis "C++ wrapper for the native C ODBC API")
3316 (description "The goal for nanodbc is to make developers happy by providing
3317a simpler and less verbose API for working with ODBC. Common tasks should be
3318easy, requiring concise and simple code.")
3319 (license license:expat)))
3320
3321(define-public unqlite
3322 (package
3323 (name "unqlite")
3324 (version "1.1.6")
3325 (source (origin
3326 (method url-fetch)
3327 ;; Contains bug fixes against the official release, and has an
3328 ;; autotooled build system.
3329 (uri (string-append "https://github.com/aidin36/tocc/releases/"
3330 "download/v1.0.0/"
3331 "unqlite-unofficial-" version ".tar.gz"))
3332 (sha256
3333 (base32
3334 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
3335 (build-system gnu-build-system)
3336 (arguments `(#:tests? #f)) ;No check target
3337 (home-page "https://www.unqlite.org")
3338 (synopsis "In-memory key/value and document store")
3339 (description
3340 "UnQLite is an in-process software library which implements a
3341self-contained, serverless, zero-configuration, transactional NoSQL
3342database engine. UnQLite is a document store database similar to
3343Redis, CouchDB, etc., as well as a standard key/value store
3344similar to BerkeleyDB, LevelDB, etc.")
3345 (license license:bsd-2)))
3346
3347;; NOTE: When upgrading redis, make sure that redis is still released
3348;; under a Free Software license.
3349(define-public redis
3350 (package
3351 (name "redis")
3352 (version "7.2.6")
3353 (source (origin
3354 (method url-fetch)
3355 (uri (string-append "https://download.redis.io/releases/redis-"
3356 version".tar.gz"))
3357 (sha256
3358 (base32
3359 "03ixkzdc43lr4q3my0yax1f1gqz6sr6hch5qdipmbd725xxdc47v"))
3360 (modules '((guix build utils)))
3361 (snippet
3362 ;; Delete bundled jemalloc, as the package will use the libc one
3363 '(begin (delete-file-recursively "deps/jemalloc")))))
3364 (build-system gnu-build-system)
3365 (arguments
3366 (list
3367 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
3368 "MALLOC=libc"
3369 "LDFLAGS=-ldl"
3370 (string-append "PREFIX=" #$output))
3371 #:phases
3372 #~(modify-phases %standard-phases
3373 (delete 'configure)
3374 (add-after 'unpack 'patch-paths
3375 (lambda _
3376 (substitute* "runtest"
3377 (("^TCLSH=.*")
3378 (string-append "TCLSH=" (which "tclsh"))))
3379 (substitute* "tests/support/server.tcl"
3380 (("/usr/bin/env")
3381 (which "env")))))
3382 (add-after 'unpack 'adjust-tests
3383 (lambda _
3384 ;; Disable failing tests.
3385 (substitute* "tests/test_helper.tcl"
3386 ;; The AOF tests cause the test suite to hang waiting for a
3387 ;; "background AOF rewrite to finish", perhaps because dead
3388 ;; processes persist as zombies in the build environment.
3389 (("unit/aofrw") "")
3390 (("integration/aof([^-]|-multi-part)") "")
3391 ;; The OOM score tests try to raise the current OOM score, but
3392 ;; our build environment already sets it for all children to
3393 ;; the highest possible one (1000). We can't lower it because
3394 ;; we don't have CAP_SYS_RESOURCE.
3395 (("unit/oom-score-adj") "")
3396 (("integration/failover") "")
3397 (("integration/replication[^-]") "")))))))
3398 (native-inputs (list pkg-config procps tcl which))
3399 (synopsis "Key-value cache and store")
3400 (description "Redis is an advanced key-value cache and store. Redis
3401supports many data structures including strings, hashes, lists, sets, sorted
3402sets, bitmaps and hyperloglogs.")
3403 (home-page "https://redis.io/")
3404 ;; These two CVEs have long been fixed.
3405 (properties `((lint-hidden-cve . ("CVE-2022-3647" "CVE-2022-33105"))))
3406 (license license:bsd-3)))
3407
3408(define-public valkey-7
3409 (package
3410 (name "valkey")
3411 ;; For compatibility, keep in sync with redis version.
3412 (version "7.2.11")
3413 (source
3414 (origin
3415 (method git-fetch)
3416 (uri (git-reference
3417 (url "https://github.com/valkey-io/valkey")
3418 (commit version)))
3419 (file-name (git-file-name name version))
3420 (sha256
3421 (base32 "099523fqbya1xc87spwdxi5nld48r1di31q6zpn252nny0xbrdcb"))
3422 (modules '((guix build utils)))
3423 (snippet
3424 ;; Delete bundled jemalloc, as the package will use the libc one
3425 #~(begin (delete-file-recursively "deps/jemalloc")))))
3426 (build-system gnu-build-system)
3427 (arguments
3428 (list #:make-flags
3429 #~(list (string-append "CC=" #$(cc-for-target))
3430 "MALLOC=libc"
3431 (string-append "PREFIX=" #$output))
3432 #:phases
3433 #~(modify-phases %standard-phases
3434 (delete 'configure)
3435 (add-after 'unpack 'patch-paths
3436 (lambda _
3437 (substitute* "runtest"
3438 (("^TCLSH=.*")
3439 (string-append "TCLSH=" (which "tclsh"))))
3440 (substitute* "tests/support/server.tcl"
3441 (("/usr/bin/env")
3442 (which "env")))))
3443 (add-after 'unpack 'adjust-tests
3444 (lambda _
3445 ;; Disable failing tests.
3446 (substitute* "tests/test_helper.tcl"
3447 ;; The AOF tests cause the test suite to hang waiting for a
3448 ;; "background AOF rewrite to finish", perhaps because dead
3449 ;; processes persist as zombies in the build environment.
3450 (("unit/aofrw") "")
3451 (("integration/aof([^-]|-multi-part)") "")
3452 ;; The OOM score tests try to raise the current OOM score,
3453 ;; but our build environment already sets it for all
3454 ;; children to the highest possible one (1000). We can't
3455 ;; lower it because we don't have CAP_SYS_RESOURCE.
3456 (("unit/oom-score-adj") "")
3457
3458 (("integration/failover") "")
3459 (("integration/replication[^-]") "")))))))
3460 (native-inputs (list pkg-config procps tcl which))
3461 (home-page "https://valkey.io/")
3462 (synopsis "High-performance key-value datastore")
3463 (description
3464 "Valkey is a high-performance key-value datastore that supports a variety
3465of workloads such as caching, message queues, and can act as a primary
3466database.")
3467 (license license:bsd-3)))
3468
3469(define-public valkey-8
3470 (package
3471 (inherit valkey-7)
3472 (name "valkey")
3473 (version "8.1.4")
3474 (source
3475 (origin
3476 (inherit (package-source valkey-7))
3477 (method git-fetch)
3478 (uri (git-reference
3479 (url "https://github.com/valkey-io/valkey")
3480 (commit version)))
3481 (file-name (git-file-name name version))
3482 (sha256
3483 (base32 "1p7jr5048syd9ln0bsh2n5ba6fd7x9wfa1x67b7wychv7a46dfx1"))))
3484 (arguments
3485 (substitute-keyword-arguments arguments
3486 ((#:phases phases '%standard-phases)
3487 #~(modify-phases #$phases
3488 (replace 'adjust-tests
3489 (lambda _
3490 ;; Disable failing tests.
3491 ;; Valkey search test directories for tests.
3492 (with-directory-excursion "tests"
3493 ;; The AOF tests cause the test suite to hang waiting for a
3494 ;; "background AOF rewrite to finish", perhaps because dead
3495 ;; processes persist as zombies in the build environment.
3496 (delete-file "unit/aofrw.tcl")
3497 (delete-file "integration/aof-multi-part.tcl")
3498
3499 ;; The OOM score tests try to raise the current OOM score, but
3500 ;; our build environment already sets it for all children to
3501 ;; the highest possible one (1000). We can't lower it because
3502 ;; we don't have CAP_SYS_RESOURCE.
3503 (delete-file "unit/oom-score-adj.tcl")
3504
3505 (for-each delete-file
3506 (find-files "integration"
3507 (string-join
3508 '("^failover\\.tcl$"
3509 "^replication"
3510 "replication\\.tcl$")
3511 "|"))))))))))))
3512
3513(define-public hiredis
3514 (package
3515 (name "hiredis")
3516 (version "1.1.0")
3517 (source
3518 (origin
3519 (method git-fetch)
3520 (uri (git-reference
3521 (url "https://github.com/redis/hiredis")
3522 (commit (string-append "v" version))))
3523 (file-name (git-file-name name version))
3524 (sha256
3525 (base32 "1zld30j3kpzqr9w3vkpd6mm3f1b1yk3dlgp9lp6gpsybjjfr2i6h"))))
3526 (build-system cmake-build-system)
3527 (native-inputs
3528 ;; needed for testing
3529 (list redis))
3530 (synopsis "Minimalistic C client library for the Redis database")
3531 (description "This package provides a library for sending commands and
3532receiving replies to and from a Redis server. It comes with a synchronous
3533API, asynchronous API and reply parsing API. Only the binary-safe Redis
3534protocol is supported.")
3535 (home-page "https://github.com/redis/hiredis")
3536 (license license:bsd-3)))
3537
3538(define-public ruby-hiredis
3539 (package
3540 (name "ruby-hiredis")
3541 (version "0.6.3")
3542 (source (origin
3543 (method git-fetch)
3544 (uri (git-reference
3545 (url "https://github.com/redis/hiredis-rb")
3546 (commit (string-append "v" version))))
3547 (file-name (git-file-name name version))
3548 (sha256
3549 (base32
3550 "05y4g7frhym59m9x208zpvg2qvqvfjlgqmygxj8sqgl07n0ww1ks"))
3551 (patches (search-patches
3552 "ruby-hiredis-use-system-hiredis.patch"))))
3553 (build-system ruby-build-system)
3554 (arguments
3555 (list
3556 #:tests? #f ;require native extension
3557 #:phases
3558 #~(modify-phases %standard-phases
3559 (add-after 'unpack 'patch-hiredis-include-directory
3560 (lambda* (#:key inputs #:allow-other-keys)
3561 (substitute* "ext/hiredis_ext/extconf.rb"
3562 ;; Adjust the hiredis include directory.
3563 (("\\$CFLAGS << \" -I/usr/include/hiredis\"")
3564 (format #f "$CFLAGS << \" -I~a\""
3565 (search-input-directory inputs "include/hiredis"))))))
3566 (add-after 'unpack 'disable-building-c-extension
3567 (lambda _
3568 ;; FIXME: The produced native extension appears to segfault when
3569 ;; run; disable building it until a solution is found (see:
3570 ;; https://github.com/redis/hiredis-rb/issues/93).
3571 (substitute* "ext/hiredis_ext/extconf.rb"
3572 (("build_hiredis = true")
3573 "build_hiredis = false"))))
3574 ;; FIXME: Un-comment phase after the extension can be made to run
3575 ;; without crashing (see above).
3576 ;; (add-after 'build 'build-ext
3577 ;; (lambda _
3578 ;; (setenv "CC" #$(cc-for-target))
3579 ;; (invoke "rake" "compile")))
3580 (add-before 'check 'start-redis
3581 (lambda _
3582 (invoke "redis-server" "--daemonize" "yes")))
3583 (add-after 'install 'delete-mkmf.log
3584 (lambda _
3585 ;; This build log captures non-deterministic file names (see:
3586 ;; https://github.com/rubygems/rubygems/issues/6259).
3587 (for-each delete-file (find-files #$output "^mkmf\\.log$")))))))
3588 (native-inputs (list redis ruby-rake-compiler))
3589 (inputs (list hiredis))
3590 (synopsis "Ruby wrapper for hiredis")
3591 (description "@code{hiredis-rb} is a Ruby extension that wraps
3592@code{hiredis}, a minimalist C client for Redis. Both the synchronous
3593connection API and a separate protocol reader are supported. It is primarily
3594intended to speed up parsing multi bulk replies.")
3595 (home-page "https://github.com/redis/hiredis-rb")
3596 (license license:bsd-3)))
3597
3598(define-public ruby-redis
3599 (package
3600 (name "ruby-redis")
3601 (version "4.2.5")
3602 (source
3603 (origin
3604 (method url-fetch)
3605 (uri (rubygems-uri "redis" version))
3606 (sha256
3607 (base32
3608 "15x2sr6h094rjbvg8pkq6m3lcd5abpyx93aifvfdz3wv6x55xa48"))))
3609 (build-system ruby-build-system)
3610 (arguments
3611 `(#:tests? #f)) ; Tests require a running redis server.
3612 (synopsis "Ruby client for Redis' API")
3613 (description
3614 "This package provides a Ruby client that tries to match Redis' API
3615one-to-one, while still providing an idiomatic interface.")
3616 (home-page "https://github.com/redis/redis-rb")
3617 (license license:expat)))
3618
3619(define-public go-github-com-cupcake-rdb
3620 (package
3621 (name "go-github-com-cupcake-rdb")
3622 (version "0.0.0-20161107195141-43ba34106c76")
3623 (source
3624 (origin
3625 (method git-fetch)
3626 (uri (git-reference
3627 (url "https://github.com/tent/rdb")
3628 (commit (go-version->git-ref version))))
3629 (file-name (git-file-name name version))
3630 (sha256
3631 (base32 "1l4bsn5yj8r875crz1rsk6dlvhv0bd8mgazsch5vl4c19v0fs2ib"))))
3632 (build-system go-build-system)
3633 (arguments '(#:import-path "github.com/cupcake/rdb"))
3634 (native-inputs
3635 (list go-gopkg-in-check-v1))
3636 (home-page "https://github.com/tent/rdb")
3637 (synopsis "Redis RDB parser for Go")
3638 (description
3639 "Package rdb implements parsing and encoding of the Redis RDB file format.")
3640 (license license:expat)))
3641
3642(define-public kyotocabinet
3643 (package
3644 (name "kyotocabinet")
3645 (version "1.2.79")
3646 (source (origin
3647 (method url-fetch)
3648 (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
3649 "kyotocabinet-" version ".tar.gz"))
3650 (sha256
3651 (base32
3652 "079ymsahlrijswgwfr2la9yw5h57l752cprhp5dz31iamsj1vyv7"))))
3653 (build-system gnu-build-system)
3654 (arguments
3655 `(#:configure-flags
3656 (list
3657 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
3658 (string-append "LDFLAGS=-Wl,-rpath="
3659 (assoc-ref %outputs "out") "/lib"))))
3660 (inputs (list zlib))
3661 (home-page "https://fallabs.com/kyotocabinet/")
3662 (synopsis
3663 "Kyoto Cabinet is a modern implementation of the DBM database")
3664 (description
3665 "Kyoto Cabinet is a standalone file-based database that supports Hash
3666and B+ Tree data storage models. It is a fast key-value lightweight
3667database and supports many programming languages. It is a NoSQL database.")
3668 (license license:gpl3+)))
3669
3670(define-public tokyocabinet
3671 (package
3672 (name "tokyocabinet")
3673 (version "1.4.48")
3674 (source
3675 (origin
3676 (method url-fetch)
3677 (uri (string-append "http://fallabs.com/tokyocabinet/"
3678 name "-" version ".tar.gz"))
3679 (sha256
3680 (base32
3681 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
3682 (build-system gnu-build-system)
3683 (arguments
3684 `(#:configure-flags
3685 (list "--enable-pthread" "--enable-off64"
3686 ,@(if (target-x86?)
3687 ;; Enables x86 specific cflags.
3688 '("--enable-fastest")
3689 '())
3690 (string-append "LDFLAGS=-Wl,-rpath="
3691 (assoc-ref %outputs "out") "/lib"))))
3692 (inputs
3693 (list zlib))
3694 (home-page "http://fallabs.com/tokyocabinet/")
3695 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
3696 (description
3697 "Tokyo Cabinet is a library of routines for managing a database.
3698The database is a simple data file containing records, each is a pair of a
3699key and a value. Every key and value is serial bytes with variable length.
3700Both binary data and character string can be used as a key and a value.
3701There is neither concept of data tables nor data types. Records are
3702organized in hash table, B+ tree, or fixed-length array.")
3703 (license license:lgpl2.1+)))
3704
3705(define-public wiredtiger
3706 (package
3707 (name "wiredtiger")
3708 (version "2.9.1")
3709 (source (origin
3710 (method url-fetch)
3711 (uri (string-append
3712 "http://source.wiredtiger.com/releases/wiredtiger-"
3713 version ".tar.bz2"))
3714 (sha256
3715 (base32
3716 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
3717 (build-system gnu-build-system)
3718 (arguments
3719 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
3720 #:phases
3721 (modify-phases %standard-phases
3722 (add-before 'check 'disable-test/fops
3723 (lambda _
3724 ;; XXX: timed out after 3600 seconds of silence
3725 (substitute* "Makefile"
3726 (("test/fops") ""))
3727 #t)))))
3728 (inputs
3729 (list lz4 zlib snappy))
3730 (home-page "https://source.wiredtiger.com/")
3731 (synopsis "NoSQL data engine")
3732 (description
3733 "WiredTiger is an extensible platform for data management. It supports
3734row-oriented storage (where all columns of a row are stored together),
3735column-oriented storage (where columns are stored in groups, allowing for
3736more efficient access and storage of column subsets) and log-structured merge
3737trees (LSM), for sustained throughput under random insert workloads.")
3738 (license license:gpl3) ; or GPL-2
3739 ;; configure.ac: WiredTiger requires a 64-bit build.
3740 (supported-systems (delete "riscv64-linux" %64bit-supported-systems))))
3741
3742(define-public wiredtiger-3
3743 (package
3744 (inherit wiredtiger)
3745 (name "wiredtiger")
3746 (version "3.1.0")
3747 (source (origin
3748 (method url-fetch)
3749 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
3750 version ".tar.bz2"))
3751 (sha256
3752 (base32
3753 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
3754
3755(define-public guile-wiredtiger
3756 (package
3757 (name "guile-wiredtiger")
3758 (version "0.7.0")
3759 (source (origin
3760 (method git-fetch)
3761 (uri (git-reference
3762 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
3763 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
3764 (file-name (string-append name "-" version "-checkout"))
3765 (sha256
3766 (base32
3767 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
3768 (build-system gnu-build-system)
3769 (arguments
3770 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
3771 #:configure-flags
3772 (list (string-append "--with-libwiredtiger-prefix="
3773 (assoc-ref %build-inputs "wiredtiger")))
3774 #:make-flags '("GUILE_AUTO_COMPILE=0")))
3775 (native-inputs
3776 (list autoconf automake pkg-config))
3777 (inputs
3778 (list wiredtiger-3 guile-2.2))
3779 (propagated-inputs
3780 (list guile2.2-bytestructures))
3781 (synopsis "WiredTiger bindings for GNU Guile")
3782 (description
3783 "This package provides Guile bindings to the WiredTiger ``NoSQL''
3784database.")
3785 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
3786 (license license:gpl3+)))
3787
3788(define-public perl-db-file
3789 (package
3790 (name "perl-db-file")
3791 (version "1.858")
3792 (source
3793 (origin
3794 (method url-fetch)
3795 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
3796 version ".tar.gz"))
3797 (sha256
3798 (base32 "1xm7s2ag15498kp7g8r20gxk22ncz3b3hz4b3srqf7ypif3a5dyf"))))
3799 (build-system perl-build-system)
3800 (arguments
3801 (list
3802 #:phases
3803 #~(modify-phases %standard-phases
3804 (add-before 'configure 'modify-config.in
3805 (lambda _
3806 (substitute* "config.in"
3807 (("/usr/local/BerkeleyDB")
3808 #$(this-package-input "bdb"))))))))
3809 (inputs (list bdb))
3810 (native-inputs (list perl-test-pod))
3811 (home-page "https://metacpan.org/release/DB_File")
3812 (synopsis "Perl5 access to Berkeley DB version 1.x")
3813 (description
3814 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
3815 (license license:perl-license)))
3816
3817(define-public lmdb
3818 (package
3819 (name "lmdb")
3820 (version "0.9.29")
3821 (source
3822 (origin
3823 (method git-fetch)
3824 (uri (git-reference
3825 (url "https://git.openldap.org/openldap/openldap.git")
3826 (commit (string-append "LMDB_" version))))
3827 (file-name (git-file-name name version))
3828 (sha256
3829 (base32 "0airps4cd0d91nbgy7hgvifa801snxwxzwxyr6pdv61plsi7h8l3"))))
3830 (build-system gnu-build-system)
3831 (arguments
3832 `(#:test-target "test"
3833 ;; TODO: Make this unconditional on core-updates.
3834 ,@(if (%current-target-system)
3835 `(#:make-flags `(,(string-append "CC=" ,(cc-for-target))
3836 ,(string-append "AR=" ,(ar-for-target))))
3837 '())
3838 #:phases
3839 (modify-phases %standard-phases
3840 (replace 'configure
3841 (lambda* (#:key outputs #:allow-other-keys)
3842 (chdir "libraries/liblmdb")
3843 (substitute* "Makefile"
3844 (("/usr/local") (assoc-ref outputs "out")))
3845 #t))
3846 (add-after 'install 'create-pkg-config-file
3847 (lambda* (#:key outputs #:allow-other-keys)
3848 (let ((out (assoc-ref outputs "out")))
3849 (mkdir-p (string-append out "/lib/pkgconfig"))
3850 (with-output-to-file (string-append out "/lib/pkgconfig/liblmdb.pc")
3851 (lambda _
3852 (format #t "prefix=~a~@
3853 exec_prefix=~a~@
3854 libdir=~a/lib~@
3855 includedir=~a/include~@
3856 ~@
3857 Name: liblmdb~@
3858 Version: ~a~@
3859 Description: Lightning Memory-Mapped Database library~@
3860 Libs: -L${libdir} -llmdb~@
3861 Cflags: -I${includedir}~%"
3862 out out out out ,version)))
3863 #t))))))
3864 (home-page "https://symas.com/lmdb/")
3865 (synopsis "Lightning Memory-Mapped Database library")
3866 (description
3867 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
3868transactional database. Unlike more complex relational databases, LMDB handles
3869only key-value pairs (stored as arbitrary byte arrays) and relies on the
3870underlying operating system for caching and locking, keeping the code small and
3871simple.
3872The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
3873disk-based databases with high read performance that scales linearly over
3874multiple cores. The size of each database is limited only by the size of the
3875virtual address space — not physical RAM.")
3876 (license license:openldap2.8)))
3877
3878(define-public lmdbxx
3879 (package
3880 (name "lmdbxx")
3881 (version "1.0.0")
3882 (source
3883 (origin
3884 (method git-fetch)
3885 (uri (git-reference
3886 (url "https://github.com/hoytech/lmdbxx")
3887 (commit version)))
3888 (file-name (git-file-name name version))
3889 (sha256
3890 (base32 "12k5rz74d1l0skcks9apry1svkl96g9lf5dcgylgjmh7v1jm0b7c"))))
3891 (arguments
3892 `(#:make-flags
3893 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3894 #:phases
3895 (modify-phases %standard-phases
3896 (delete 'configure))))
3897 (build-system gnu-build-system)
3898 (inputs (list lmdb))
3899 (home-page "https://github.com/hoytech/lmdbxx")
3900 (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library")
3901 (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the
3902@code{LMDB} embedded database library, offering both an error-checked
3903procedural interface and an object-oriented resource interface with RAII
3904semantics.")
3905 (license license:unlicense)))
3906
3907(define-public libpqxx
3908 (package
3909 (name "libpqxx")
3910 (version "7.10.1")
3911 (source (origin
3912 (method git-fetch)
3913 (uri (git-reference
3914 (url "https://github.com/jtv/libpqxx")
3915 (commit version)))
3916 (file-name (git-file-name name version))
3917 (sha256
3918 (base32
3919 "0x81igwfk7nwc8vvggsnlz806kfzvc7bz0yrqadki01rj348hn85"))))
3920 (build-system gnu-build-system)
3921 (native-inputs (list python-wrapper))
3922 (inputs (list postgresql))
3923 (arguments '(#:tests? #f)) ;tests require a running PostgreSQL server
3924 (synopsis "C++ connector for PostgreSQL")
3925 (description
3926 "Libpqxx is a C++ library to enable user programs to communicate with the
3927PostgreSQL database back-end. The database back-end can be local or it may be
3928on another machine, accessed via TCP/IP.")
3929 (home-page "https://pqxx.org/")
3930 (license license:bsd-3)))
3931
3932(define-public python-peewee
3933 (package
3934 (name "python-peewee")
3935 (version "3.18.2")
3936 (source
3937 (origin
3938 (method git-fetch)
3939 (uri (git-reference
3940 (url "https://github.com/coleifer/peewee")
3941 (commit version)))
3942 (file-name (git-file-name name version))
3943 (sha256
3944 (base32 "1qd57cd33mf48q0xfmnld58xn5jpbgqrj1bnqlkjmk87y3g9i0q4"))))
3945 (build-system pyproject-build-system)
3946 (arguments
3947 (list
3948 #:test-backend #~'custom
3949 #:test-flags #~(list "runtests.py")))
3950 (inputs
3951 (list sqlite))
3952 (native-inputs
3953 (list python-setuptools))
3954 (home-page "https://github.com/coleifer/peewee/")
3955 (synopsis "Small object-relational mapping utility")
3956 (description
3957 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
3958handles converting between pythonic values and those used by databases, so you
3959can use Python types in your code without having to worry. It has built-in
3960support for sqlite, mysql and postgresql. If you already have a database, you
3961can autogenerate peewee models using @code{pwiz}, a model generator.")
3962 (license license:expat)))
3963
3964(define-public python-pypika-tortoise
3965 (package
3966 (name "python-pypika-tortoise")
3967 (version "0.6.3")
3968 (source
3969 (origin
3970 (method git-fetch)
3971 (uri (git-reference
3972 (url "https://github.com/tortoise/pypika-tortoise")
3973 (commit (string-append "v" version))))
3974 (file-name (git-file-name name version))
3975 (sha256
3976 (base32 "0czxc4im7iik9igqzwvxfjbyn66avmr8a1bcvcsxpzd22ywiycis"))))
3977 (build-system pyproject-build-system)
3978 (arguments
3979 (list
3980 ;; tests: 904 passed, 1 deselected
3981 #:test-flags
3982 ;; FileNotFoundError: [Errno 2] No such file or directory: 'uvx'
3983 #~(list "--deselect=tests/test_poetry_add.py::test_added_by_poetry_v2")))
3984 (native-inputs
3985 (list python-pdm-backend
3986 python-pytest))
3987 (home-page "https://github.com/tortoise/pypika-tortoise")
3988 (synopsis "Pypika fork for tortoise-orm")
3989 (description "Pypika-tortoise is a fork of pypika which has been
3990streamlined for its use in the context of tortoise-orm. It removes support
3991for many database kinds that tortoise-orm doesn't need, for example.")
3992 (license license:asl2.0)))
3993
3994(define-public python-asyncpg
3995 (package
3996 (name "python-asyncpg")
3997 ;; asyncpg 0.31.0 requires Cython(>=3.2.1,<4.0.0), got Cython==3.1.2
3998 (version "0.30.0")
3999 (source
4000 (origin
4001 ;; git-fetch leads to errors like
4002 ;; ValueError: 'asyncpg/pgproto/pgproto.pyx' doesn't match any files
4003 (method url-fetch)
4004 (uri (pypi-uri "asyncpg" version))
4005 (sha256
4006 (base32 "0lf8xbrsb2ycpqx1vzlb05p48g5sh9zq24a8yh17cw5nia9fjlf5"))))
4007 (build-system pyproject-build-system)
4008 (arguments
4009 (list
4010 #:test-flags
4011 ;; raises ValueError("Invalid IPv6 URL") ; Maybe due to urllib?
4012 #~(list "-k" "not TestConnectParams")))
4013 (native-inputs
4014 (list postgresql
4015 python-cython
4016 python-pytest
4017 python-uvloop
4018 python-distro
4019 python-setuptools))
4020 (home-page "https://github.com/MagicStack/asyncpg")
4021 (synopsis "Fast PostgreSQL database client library for Python")
4022 (description "@code{asyncpg} is a database interface library designed
4023specifically for PostgreSQL and Python/asyncio. @code{asyncpg} is an
4024efficient, clean implementation of PostgreSQL server binary protocol for use
4025with Python's asyncio framework.")
4026 (license license:asl2.0)))
4027
4028(define-public python-asyncmy
4029 (package
4030 (name "python-asyncmy")
4031 (version "0.2.10")
4032 (source
4033 (origin
4034 (method git-fetch)
4035 (uri (git-reference
4036 (url "https://github.com/long2ice/asyncmy")
4037 (commit (string-append "v" version))))
4038 (file-name (git-file-name name version))
4039 (sha256
4040 (base32 "10sqihiwx7vsdaavgl418hhk7d5rl6d1i60y5bjr76mdfny18q55"))))
4041 (build-system pyproject-build-system)
4042 (arguments
4043 (list
4044 ;; XXX: Most tests fail, probably because
4045 ;; of pytest-asyncio version mismatch.
4046 #:tests? #f
4047 #:phases
4048 #~(modify-phases %standard-phases
4049 (add-after 'install 'cleanup
4050 (lambda* (#:key inputs outputs #:allow-other-keys)
4051 (for-each delete-file
4052 (find-files (site-packages inputs outputs)
4053 "\\.(c|pyx)$"))))
4054
4055 (replace 'check
4056 (lambda* (#:key tests? #:allow-other-keys #:rest rest)
4057 (when tests?
4058 ;; XXX: Else pytest picks up the wrong __init__.py
4059 (delete-file-recursively "asyncmy")
4060 ;; The tests rely on a MySQL or MariaDB test server
4061 ;; being available.
4062 (let ((datadir "/tmp/mysql")
4063 (socket "/tmp/mysql/mysqld.sock")
4064 (username "root")
4065 (password "123456")) ;default in conftest.py
4066 (invoke "mysqld" "--initialize-insecure"
4067 (string-append "--datadir=" datadir))
4068 (spawn "mysqld"
4069 (list
4070 "mysqld"
4071 ;; Respect '--datadir'.
4072 "--no-defaults"
4073 (string-append "--datadir=" datadir)
4074 (string-append "--socket=" socket)))
4075 (sleep 1)
4076 (invoke "mysql"
4077 (string-append "--socket=" socket)
4078 "-u" "root"
4079 "-e" (string-append
4080 "ALTER USER 'root'@'localhost' IDENTIFIED BY '"
4081 password "';"))
4082 (apply (assoc-ref %standard-phases 'check)
4083 `(#:tests? ,tests? ,@rest)))))))))
4084 (native-inputs
4085 (list mysql
4086 python-cython
4087 python-poetry-core
4088 python-pytest
4089 python-pytest-asyncio
4090 python-setuptools))
4091 (home-page "https://github.com/long2ice/asyncmy")
4092 (synopsis "Fast MySQL driver for Python")
4093 (description "@code{asyncmy} is a fast @code{asyncio} MySQL driver, which
4094reuses most of @code{pymysql} and @code{aiomysql} but rewrites the core
4095protocol with Cython for performance.")
4096 (license license:asl2.0)))
4097
4098(define-public python-asyncodbc
4099 (package
4100 (name "python-asyncodbc")
4101 (version "0.1.1")
4102 (source
4103 (origin
4104 (method git-fetch)
4105 (uri (git-reference
4106 (url "https://github.com/tortoise/asyncodbc")
4107 (commit (string-append "v" version))))
4108 (file-name (git-file-name name version))
4109 (sha256
4110 (base32 "0fdcvx2r09vsxx3zw8zvj7ww6wyby8sk3r2a3174nfngiajbi6g1"))))
4111 (build-system pyproject-build-system)
4112 (arguments
4113 (list #:tests? #f)) ;tests fail similarly to python-pyodbc
4114 (native-inputs
4115 (list python-poetry-core
4116 unixodbc))
4117 (propagated-inputs
4118 (list python-pyodbc))
4119 (home-page "https://github.com/tortoise/asyncodbc")
4120 (synopsis "Access ODBC databases with asyncio")
4121 (description "This package provides an improved fork of
4122@code{python-aioodbc}, and makes it possible to Access ODBC databases with
4123@code{python-asyncio}.")
4124 (license license:asl2.0)))
4125
4126(define-public python-aiomysql
4127 (package
4128 (name "python-aiomysql")
4129 (version "0.1.1")
4130 (source
4131 (origin
4132 (method url-fetch)
4133 (uri (pypi-uri "aiomysql" version))
4134 (sha256
4135 (base32 "0zhhisf2bz2hv0vcklw45k54yr0f7gx61gnq4lc7vdp6v97nqs0d"))))
4136 (build-system pyproject-build-system)
4137 (arguments '(#:tests? #f)) ;test suite requires docker
4138 (propagated-inputs (list python-pymysql))
4139 (native-inputs (list python-setuptools python-wheel))
4140 (home-page "https://github.com/aio-libs/aiomysql")
4141 (synopsis "MySQL driver for Python")
4142 (description "@code{aiomysql} is a driver for accessing a MySQL database
4143from the @code{asyncio} Python framework. It depends on and reuses most parts
4144of PyMySQL. @code{aiomysql} tries to preserve the same API as the
4145@code{aiopg} library.")
4146 (license license:expat)))
4147
4148(define-public python-tortoise-orm
4149 (package
4150 (name "python-tortoise-orm")
4151 (version "0.25.3")
4152 (source
4153 (origin
4154 (method git-fetch)
4155 (uri (git-reference
4156 (url "https://github.com/tortoise/tortoise-orm")
4157 (commit version)))
4158 (file-name (git-file-name name version))
4159 (sha256
4160 (base32 "1b1a20cnhaj7rcdp5l1r5nvd6x1amybgynwpd3cnskpvzqjinsyl"))))
4161 (build-system pyproject-build-system)
4162 (arguments
4163 (list
4164 ;; tests: 1280 passed, 104 skipped, 4 xfailed, 9 warnings
4165 #:test-flags
4166 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
4167 "--ignore=tests/benchmarks/"
4168 ;; FileNotFoundError: [Errno 2] No such file or directory: 'uvx'
4169 "--deselect=tests/test_version.py::test_added_by_poetry_v2")))
4170 (native-inputs
4171 (list python-cython
4172 python-fastapi
4173 python-pdm-backend
4174 python-pydantic
4175 python-pytest
4176 python-pytest-xdist))
4177 (propagated-inputs
4178 (list python-aiosqlite
4179 python-anyio
4180 python-iso8601
4181 python-pypika-tortoise
4182 python-pytz
4183 ;; [optional]
4184 python-aiomysql ;tortoise/backends/mysql/client.py
4185 python-asyncodbc ;tortoise/backends/odbc/client.py
4186 python-asyncpg ;tortoise/backends/asyncpg/client.py
4187 python-ciso8601
4188 python-orjson
4189 python-psycopg ;tortoise/backends/psycopg/client.py
4190 python-psycopg-pool ;
4191 python-pyodbc ;tortoise/backends/oracle/client.py
4192 python-uvloop))
4193 (home-page "https://github.com/tortoise/tortoise-orm")
4194 (synopsis "Asynchronous Object Relational Mapper (ORM) for Python")
4195 (description "Tortoise ORM is an easy-to-use asyncio ORM (Object
4196Relational Mapper) inspired by Django. Tortoise ORM was built with relations
4197in mind and admiration for the excellent and popular Django ORM. It's
4198engraved in its design that you are working not with just tables, you work
4199with relational data.")
4200 (license license:asl2.0)))
4201
4202(define-public python-tortoise-vector
4203 (package
4204 (name "python-tortoise-vector")
4205 (version "0.2.0")
4206 (source
4207 (origin
4208 (method url-fetch)
4209 (uri (pypi-uri "tortoise_vector" version))
4210 (sha256
4211 (base32 "09607748biibqs5d7q186x09jcpm0126qmvzqnd80yfmiif2ls97"))))
4212 (build-system pyproject-build-system)
4213 (arguments
4214 (list #:tests? #f)) ;no tests
4215 (native-inputs
4216 (list python-poetry-core
4217 python-poetry-dynamic-versioning))
4218 (propagated-inputs
4219 (list python-tortoise-orm))
4220 (home-page "https://github.com/Chr0nos/tortoise_vector")
4221 (synopsis "Tortoise-ORM pgvector implementation")
4222 (description
4223 "This package adds the support of @code{pgvector} vectors to
4224Tortoise-ORM as a new type of fields, it helps to filter/order by cosine
4225similarity distances for scementic search using embeddings.")
4226 (license license:expat)))
4227
4228(define-public python-piccolo
4229 (package
4230 (name "python-piccolo")
4231 (version "1.34.0")
4232 (source
4233 (origin
4234 (method git-fetch)
4235 (uri (git-reference
4236 (url "https://github.com/piccolo-orm/piccolo/")
4237 (commit version)))
4238 (file-name (git-file-name name version))
4239 (sha256
4240 (base32 "03wnwj6gk39c6i1hymwy80ncafby9xy4phg1nw1jzzcmzpf8zps8"))))
4241 (build-system pyproject-build-system)
4242 (arguments
4243 ;; A local database must be running with credentials explained in
4244 ;; https://github.com/piccolo-orm/piccolo/tree/master/tests
4245 (list #:tests? #f))
4246 (native-inputs
4247 (list python-setuptools))
4248 (propagated-inputs
4249 (list python-black ;this is listed in requirements.txt
4250 python-colorama
4251 python-email-validator
4252 python-inflection
4253 python-jinja2
4254 python-pydantic
4255 python-targ
4256 python-typing-extensions))
4257 (home-page "https://github.com/piccolo-orm/piccolo")
4258 (synopsis "ORM and query builder which supports asyncio")
4259 (description
4260 "Piccolo is a fast, user friendly @acronym{Object–relational mapping,
4261ORM} and query builder which supports asyncio and is fully type-annotated.")
4262 (license license:expat)))
4263
4264(define-public aerich
4265 (package
4266 (name "aerich")
4267 (version "0.9.2")
4268 (source
4269 (origin
4270 (method git-fetch)
4271 (uri (git-reference
4272 (url "https://github.com/tortoise/aerich")
4273 (commit (string-append "v" version))))
4274 (file-name (git-file-name name version))
4275 (sha256
4276 (base32 "07h02lv6r1hf4jjzfsd8g9yxn5df6i5qj8gmrvm2php97x45v84j"))))
4277 (build-system pyproject-build-system)
4278 (arguments
4279 (list
4280 ;; tests: 56 passed, 7 skipped, 1 deselected, 1 warning
4281 #:test-flags
4282 ;; FileNotFoundError: [Errno 2] No such file or directory: 'uvx'
4283 #~(list "--deselect=tests/test_python_m.py::test_poetry_add")))
4284 (native-inputs
4285 (list python-cryptography
4286 python-pdm-backend
4287 python-pydantic
4288 python-pydantic-settings
4289 python-pytest
4290 python-pytest-asyncio
4291 python-pytest-mock
4292 python-tortoise-vector))
4293 (inputs
4294 (list python-anyio
4295 python-asyncclick
4296 python-dictdiffer
4297 python-tortoise-orm
4298 ;; [optional]
4299 python-aiomysql
4300 python-asyncmy
4301 python-asyncpg
4302 python-psycopg
4303 python-tomli-w))
4304 (home-page "https://github.com/tortoise/aerich")
4305 (synopsis "Database migrations tool for Tortoise @acronym{ORM, Object Relational
4306Mapper}")
4307 (description
4308 "This package provides @code{aerich}, a Python database migrations tool
4309for Tortoise @acronym{ORM, Object Relational Mapper}. It can be used both
4310programmatically or as a standalone CLI application.")
4311 (license license:asl2.0)))
4312
4313(define-public sqlcipher
4314 (package
4315 (name "sqlcipher")
4316 (version "3.4.2")
4317 (source
4318 (origin
4319 (method git-fetch)
4320 (uri (git-reference
4321 (url "https://github.com/sqlcipher/sqlcipher")
4322 (commit (string-append "v" version))))
4323 (sha256
4324 (base32 "168wb6fvyap7y8j86fb3xl5rd4wmhiq0dxvx9wxwi5kwm1j4vn1a"))
4325 (file-name (git-file-name name version))))
4326 (build-system gnu-build-system)
4327 (inputs
4328 (list openssl
4329 tcl)) ;for tests
4330 (native-inputs
4331 (list tcl))
4332 (arguments
4333 '(#:configure-flags
4334 '("--enable-tempstore=yes"
4335 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
4336 "LDFLAGS=-lcrypto -ltcl8.6"
4337 "--disable-tcl")
4338 ;; tests cannot be run from the Makefile
4339 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
4340 #:test-target "testfixture"
4341 #:phases
4342 (modify-phases %standard-phases
4343 (add-before 'check 'build-test-runner
4344 (assoc-ref %standard-phases 'check))
4345 (replace 'check
4346 (lambda _
4347 (invoke "./testfixture" "test/crypto.test"))))))
4348 (home-page "https://www.zetetic.net/sqlcipher/")
4349 (synopsis
4350 "Library providing transparent encryption of SQLite database files")
4351 (description "SQLCipher is an implementation of SQLite, extended to
4352provide transparent 256-bit AES encryption of database files. Pages are
4353encrypted before being written to disk and are decrypted when read back. It’s
4354well suited for protecting embedded application databases and for mobile
4355development.")
4356 ;; The source files
4357 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
4358 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
4359 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
4360 ;; source files are in the public domain.
4361 (license (list license:public-domain license:bsd-3))))
4362
4363(define-public python-pyodbc
4364 (package
4365 (name "python-pyodbc")
4366 (version "5.2.0")
4367 (source
4368 (origin
4369 (method url-fetch)
4370 (uri (pypi-uri "pyodbc" version))
4371 (sha256
4372 (base32 "1xd88k6rngm9n8z3klb0g94csa9m8sk7df544vpfxpf816cf72yy"))
4373 (modules '((guix build utils)))
4374 (snippet
4375 ;; Delete precompiled binaries. The corresponding source is included.
4376 #~(for-each delete-file (find-files "." "\\.pyc$")))))
4377 (build-system pyproject-build-system)
4378 (inputs (list unixodbc))
4379 (native-inputs (list python-pytest python-setuptools python-wheel))
4380 (arguments
4381 ;; XXX Tests fail with [unixODBC][Driver Manager]Data source name not
4382 ;; found and no default driver specified (0) (SQLDriverConnect)
4383 (list #:tests? #f))
4384 (home-page "https://github.com/mkleehammer/pyodbc")
4385 (synopsis "Python ODBC Library")
4386 (description "@code{python-pyodbc} provides a Python DB-API driver
4387for ODBC.")
4388 (license (license:x11-style "file:///LICENSE.TXT"))))
4389
4390(define-public mdbtools
4391 (package
4392 (name "mdbtools")
4393 (version "0.7.1")
4394 (source
4395 (origin
4396 (method git-fetch)
4397 (uri (git-reference
4398 (url "https://github.com/brianb/mdbtools")
4399 (commit version)))
4400 (file-name (git-file-name name version))
4401 (sha256
4402 (base32
4403 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
4404 (build-system gnu-build-system)
4405 (inputs
4406 (list glib))
4407 (native-inputs
4408 (list autoconf
4409 automake
4410 libtool
4411 pkg-config
4412 txt2man
4413 which))
4414 (home-page "https://mdbtools.sourceforge.net/")
4415 (synopsis "Read Microsoft Access databases")
4416 (description "MDB Tools is a set of tools and applications to read the
4417proprietary MDB file format used in Microsoft's Access database package. This
4418includes programs to export schema and data from Microsoft's Access database
4419file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
4420etc., and an SQL engine for performing simple SQL queries.")
4421 (license (list license:lgpl2.0
4422 license:gpl2+))))
4423
4424(define-public python-lmdb
4425 (package
4426 (name "python-lmdb")
4427 (version "1.0.0")
4428 (source
4429 (origin
4430 (method url-fetch)
4431 (uri (pypi-uri "lmdb" version))
4432 (sha256
4433 (base32 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
4434 (snippet
4435 ;; Delete bundled lmdb source files.
4436 #~(for-each delete-file
4437 '("lib/lmdb.h" "lib/mdb.c" "lib/midl.c" "lib/midl.h")))))
4438 (build-system pyproject-build-system)
4439 (arguments
4440 (list
4441 #:phases
4442 #~(modify-phases %standard-phases
4443 (add-before 'build 'use-system-lmdb
4444 (lambda* (#:key inputs #:allow-other-keys)
4445 (let ((lmdb (assoc-ref inputs "lmdb")))
4446 (setenv "LMDB_PURE" "set") ;don't apply env-copy-txn.patch
4447 (setenv "LMDB_FORCE_SYSTEM" "set")
4448 (setenv "LMDB_INCLUDEDIR"
4449 (string-append lmdb "/include"))
4450 (setenv "LMDB_LIBDIR"
4451 (string-append lmdb "/lib"))))))))
4452 (native-inputs (list python-pytest python-setuptools python-wheel))
4453 (inputs (list lmdb))
4454 (home-page "https://github.com/dw/py-lmdb")
4455 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
4456 (description
4457 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
4458Memory-Mapped Database} (LMDB), a high-performance key-value store.")
4459 (license (list license:openldap2.8
4460 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
4461 ;; but not actually needed on platforms currently supported by Guix.
4462 license:bsd-3))))
4463
4464(define-public virtuoso-ose
4465 (package
4466 (name "virtuoso-ose")
4467 (version "7.2.15")
4468 (source
4469 (origin
4470 (method url-fetch)
4471 (uri (string-append "mirror://sourceforge/virtuoso/virtuoso/" version "/"
4472 "virtuoso-opensource-" version ".tar.gz"))
4473 (sha256
4474 (base32 "1nz6kddwxz5k79g3skj7y45f0l20m8fh8haw42j313xm177xpdp0"))
4475 (modules '((guix build utils)))
4476 ;; This snippet removes pre-built Java archives.
4477 (snippet
4478 #~(for-each delete-file-recursively
4479 (find-files "." "\\.jar$")))))
4480 (build-system gnu-build-system)
4481 (arguments
4482 (list
4483 #:tests? #f ; tests require a network connection
4484 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
4485 ;; This indicates that the internal zlib code may still be used.
4486 #:configure-flags
4487 #~(list "--without-internal-zlib"
4488 "--with-readline"
4489 "--enable-static=no")
4490 #:phases
4491 #~(modify-phases %standard-phases
4492 (add-after 'unpack 'avoid-embedding-kernel-and-timestamps
4493 ;; For a reproducible build, avoid embedding the kernel version and
4494 ;; timestamps.
4495 (lambda _
4496 (substitute*
4497 (list "bin/makever"
4498 "appsrc/ODS-Polls/make_vad.sh"
4499 "appsrc/ODS-Blog/make_vad.sh"
4500 "appsrc/ODS-Community/make_vad.sh"
4501 "appsrc/ODS-Framework/make_vad.sh"
4502 "appsrc/ODS-Framework/oauth/make_vad.sh"
4503 "appsrc/ODS-WebMail/make_vad.sh"
4504 "appsrc/ODS-Calendar/make_vad.sh"
4505 "appsrc/ODS-Gallery/make_vad.sh"
4506 "appsrc/ODS-Briefcase/make_vad.sh"
4507 "appsrc/ODS-FeedManager/make_vad.sh"
4508 "appsrc/ODS-Bookmark/make_vad.sh"
4509 "appsrc/ODS-Addressbook/make_vad.sh"
4510 "binsrc/samples/demo/make_vad.sh"
4511 "binsrc/samples/demo/mkdoc.sh"
4512 "binsrc/rdf_mappers/make_vad.sh")
4513 (("^UNAME_SYSTEM=.*") "UNAME_SYSTEM=unknown\n")
4514 (("^UNAME_RELEASE=.*") "UNAME_RELEASE=unknown\n")
4515 (("^PACKDATE=.*") "PACKDATE=2012-04-18\n")
4516 (("^DATE=.*") "DATE=2012-04-18\n"))))
4517 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
4518 ;; the build output. The following phase removes it.
4519 (add-after 'install 'remove-static-libs
4520 (lambda _
4521 (for-each
4522 (lambda (file)
4523 (delete-file (string-append #$output "/lib/" file)))
4524 '("libvirtuoso-t.a"
4525 "libvirtuoso-t.la")))))))
4526 (native-inputs
4527 (list autoconf automake bison flex gperf libtool python))
4528 (inputs
4529 (list openssl net-tools readline which zlib))
4530 (home-page "https://vos.openlinksw.com/owiki/wiki/VOS/")
4531 (synopsis "Multi-model database system")
4532 (description "Virtuoso is a scalable cross-platform server that combines
4533relational, graph, and document data management with web application server
4534and web services platform functionality.")
4535 ;; configure: error: ... can only be build on 64bit platforms
4536 (supported-systems %64bit-supported-systems)
4537 (license license:gpl2)))
4538
4539(define-public python-ccm
4540 (package
4541 (name "python-ccm")
4542 (version "3.1.5")
4543 (source
4544 (origin
4545 (method url-fetch)
4546 (uri (pypi-uri "ccm" version))
4547 (sha256
4548 (base32
4549 "0v1jahchm9czcdhynfy76mca52k6jbvngm60jqdwxlhnf6iw0z7h"))))
4550 (build-system pyproject-build-system)
4551 (arguments
4552 ;; TODO: tests require a complex setup, see <.github/workflows/main.yml>.
4553 (list #:tests? #f))
4554 (native-inputs
4555 (list python-pbr))
4556 (propagated-inputs
4557 (list python-pyyaml
4558 python-psutil
4559 python-six)) ;XXX: hard dependency
4560 (home-page "https://github.com/pcmanus/ccm")
4561 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
4562localhost")
4563 (description "Cassandra Cluster Manager is a development tool for testing
4564local Cassandra clusters. It creates, launches and removes Cassandra clusters
4565on localhost.")
4566 (license license:asl2.0)))
4567
4568(define-public python-sqlalchemy
4569 (package
4570 (name "python-sqlalchemy")
4571 (version "1.4.54")
4572 (source
4573 (origin
4574 (method url-fetch)
4575 (uri (pypi-uri "SQLAlchemy" version))
4576 (sha256
4577 (base32 "06n36zs280iahxj34fvq1iwq3zjlmvsalfcanwhdqdcc13nznw24"))))
4578 (build-system pyproject-build-system)
4579 (native-inputs
4580 (list python-cython ; for C extensions
4581 python-pytest python-mock python-pytest-xdist ; for tests
4582 python-setuptools python-wheel))
4583 (propagated-inputs
4584 (list python-greenlet))
4585 (arguments
4586 (list
4587 #:test-flags
4588 '(list ;; The memory usage tests are very expensive and run in sequence;
4589 ;; skip them.
4590 "-k" "not test_memusage.py")))
4591 (home-page "https://www.sqlalchemy.org")
4592 (synopsis "Database abstraction library")
4593 (description
4594 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
4595gives application developers the full power and flexibility of SQL. It
4596provides a full suite of well known enterprise-level persistence patterns,
4597designed for efficient and high-performing database access, adapted into a
4598simple and Pythonic domain language.")
4599 (license license:x11)))
4600
4601(define-public python-sqlalchemy-2
4602 (package
4603 (name "python-sqlalchemy")
4604 (version "2.0.45")
4605 (source
4606 (origin
4607 (method url-fetch)
4608 (uri (pypi-uri "sqlalchemy" version))
4609 (sha256
4610 (base32 "126fxwlk5kd0vwymw3pfmayl29c8il2n6qxdzl1mglnjm2ys8chn"))))
4611 (build-system pyproject-build-system)
4612 (arguments
4613 (list
4614 #:test-flags
4615 ;; Remove expensive tests.
4616 #~(list "--ignore=test/aaa_profiling/test_memusage.py"
4617 "--ignore=test/ext/mypy/test_mypy_plugin_py3k.py"
4618 "--ignore=test/typing/test_mypy.py"
4619 ;; Disable a test that fails randomly.
4620 "-k" "test_recycle_pool_no_race")))
4621 (native-inputs
4622 (list python-cython
4623 python-pytest
4624 python-setuptools))
4625 (propagated-inputs
4626 (list python-greenlet
4627 python-typing-extensions))
4628 (home-page "https://www.sqlalchemy.org")
4629 (synopsis "SQL toolkit and object relational mapper")
4630 (description
4631 "SQLAlchemy is the Python SQL toolkit and @acronym{ORM, Object Relational
4632Mapper} that gives application developers the full power and flexibility of
4633SQL. It provides a full suite of well known enterprise-level persistence
4634patterns, designed for efficient and high-performing database access, adapted
4635into a simple and Pythonic domain language.")
4636 (license license:expat)))
4637
4638(define-public python-sqlalchemy-utils
4639 (package
4640 (name "python-sqlalchemy-utils")
4641 (version "0.42.1")
4642 (source
4643 (origin
4644 (method git-fetch)
4645 (uri (git-reference
4646 (url "https://github.com/kvesteri/sqlalchemy-utils")
4647 (commit version)))
4648 (file-name (git-file-name name version))
4649 (sha256
4650 (base32 "0ny1p352p0dlgrf9fnmzj7ld1rga5zj698qpla1kdaliwwh6xawn"))))
4651 (build-system pyproject-build-system)
4652 (arguments
4653 (list
4654 #:test-flags
4655 ;; XXX: These tests require additional inputs.
4656 #~(list "--deselect=tests/test_views.py::TestMySqlTrivialView"
4657 "--deselect=tests/functions/test_database.py::\
4658TestDatabasePostgresPg8000::test_create_and_drop"
4659 "--deselect=tests/functions/test_database.py::\
4660TestDatabasePostgresPsycoPG2CFFI::test_create_and_drop")
4661 #:phases
4662 #~(modify-phases %standard-phases
4663 (add-before 'check 'start-postgresql
4664 (lambda* (#:key inputs tests? #:allow-other-keys)
4665 (when tests?
4666 (setenv "TZDIR" (search-input-directory inputs
4667 "share/zoneinfo"))
4668 (let ((dbdir (string-append (getcwd) "/../pgdir")))
4669 (setenv "SQLALCHEMY_UTILS_TEST_POSTGRESQL_USER"
4670 "nixbld")
4671 (invoke "initdb" "-D" dbdir)
4672 (invoke "pg_ctl" "-D" dbdir
4673 "-o" (string-append "-k " dbdir)
4674 "-l" (string-append dbdir "/db.log")
4675 "start")
4676 (invoke "psql" "-h" dbdir "-d" "postgres"
4677 "-c" "CREATE DATABASE sqlalchemy_utils_test;"))))))))
4678 (propagated-inputs (list python-six python-sqlalchemy))
4679 (native-inputs
4680 (list postgresql
4681 python-dateutil
4682 python-flexmock
4683 python-psycopg2
4684 python-pytest
4685 python-pytz
4686 python-setuptools
4687 tzdata-for-tests))
4688 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
4689 (synopsis "Various utility functions for SQLAlchemy")
4690 (description
4691 "SQLAlchemy-utils provides various utility functions and custom data types
4692for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
4693
4694You might also want to install the following optional dependencies:
4695@enumerate
4696@item @code{python-passlib}
4697@item @code{python-babel}
4698@item @code{python-cryptography}
4699@item @code{python-pytz}
4700@item @code{python-psycopg2}
4701@item @code{python-furl}
4702@item @code{python-flask-babel}
4703@end enumerate
4704")
4705 (license license:bsd-3)))
4706
4707;; python-alchemy-mock is abandoned, last commit in 2019, no maintained fork.
4708;; Perhaps deprecate and remove with the python-six cleanup.
4709(define-public python-alchemy-mock
4710 (package
4711 (name "python-alchemy-mock")
4712 (version "0.4.3")
4713 (home-page "https://github.com/miki725/alchemy-mock")
4714 (source
4715 (origin
4716 (method git-fetch)
4717 (uri (git-reference
4718 (url "https://github.com/miki725/alchemy-mock")
4719 (commit version)))
4720 (file-name (git-file-name name version))
4721 (sha256
4722 (base32 "053gj8d8ca5kpp7v61wd7lcm9mqp9xqz3d8pp9spdbcjsaqz9nk9"))
4723 (snippet #~(begin
4724 (use-modules (guix build utils))
4725 (substitute* "alchemy_mock/comparison.py"
4726 (("collections\\.Mapping")
4727 "collections.abc.Mapping"))))))
4728 (build-system pyproject-build-system)
4729 (arguments
4730 (list
4731 #:test-flags
4732 #~(list "--doctest-modules" "alchemy_mock")))
4733 (native-inputs (list python-mock python-pytest python-setuptools
4734 python-wheel))
4735 (propagated-inputs (list python-sqlalchemy python-six))
4736 (synopsis "Mock helpers for SQLAlchemy")
4737 (description
4738 "This package provides mock helpers for SQLAlchemy that makes it easy
4739to mock an SQLAlchemy session while preserving the ability to do asserts.
4740
4741Normally Normally SQLAlchemy's expressions cannot be easily compared as
4742comparison on binary expression produces yet another binary expression, but
4743this library provides functions to facilitate such comparisons.")
4744 (license license:expat)))
4745
4746(define-public python-alembic
4747 (package
4748 (name "python-alembic")
4749 (version "1.18.1")
4750 (source
4751 (origin
4752 (method url-fetch)
4753 (uri (pypi-uri "alembic" version))
4754 (sha256
4755 (base32 "0rmq5z30vmv5x5c355mj2whjz1m086c0k4xqndpq35lm6n0npb43"))))
4756 (build-system pyproject-build-system)
4757 (arguments
4758 (list
4759 #:test-flags
4760 #~(list "--ignore=tests/integration")))
4761 (native-inputs
4762 (list python-black ; runs a hook in tests.
4763 python-mock
4764 python-pytest
4765 python-setuptools
4766 python-tzdata))
4767 (propagated-inputs
4768 (list python-mako
4769 python-sqlalchemy-2
4770 python-tomli
4771 python-typing-extensions))
4772 (home-page "https://github.com/sqlalchemy/alembic")
4773 (synopsis "Database migration tool for SQLAlchemy")
4774 (description
4775 "Alembic is a lightweight database migration tool for usage with the
4776SQLAlchemy Database Toolkit for Python.")
4777 (license license:expat)))
4778
4779(define-public python-sqlite-fts4
4780 (package
4781 (name "python-sqlite-fts4")
4782 (version "1.0.3")
4783 (source
4784 (origin
4785 (method git-fetch)
4786 (uri (git-reference
4787 (url "https://github.com/simonw/sqlite-fts4")
4788 (commit version)))
4789 (file-name (git-file-name name version))
4790 (sha256
4791 (base32 "05c69n4nrc9srkbih1q1wxlw6n9mb3dm7ysb47ipqjn3rp1aif11"))))
4792 (build-system pyproject-build-system)
4793 (native-inputs (list python-pytest python-setuptools))
4794 (home-page "https://github.com/simonw/sqlite-fts4")
4795 (synopsis "Python functions for working with SQLite FTS4 search")
4796 (description
4797 "This package provides custom SQLite functions written in Python for
4798ranking documents indexed using the SQLite's FTS4 full text search
4799extension.")
4800 (license license:asl2.0)))
4801
4802(define-public python-sqlite-utils
4803 (package
4804 (name "python-sqlite-utils")
4805 (version "3.38")
4806 (source (origin
4807 (method git-fetch) ;for tests
4808 (uri (git-reference
4809 (url "https://github.com/simonw/sqlite-utils")
4810 (commit version)))
4811 (file-name (git-file-name name version))
4812 (sha256
4813 (base32
4814 "1rai8rbw5drxppypyl3r8j9gr12278h3snkj7l280zkskbxxh7hf"))))
4815 (build-system pyproject-build-system)
4816 (arguments
4817 (list #:phases #~(modify-phases %standard-phases
4818 (add-after 'unpack 'relax-requirements
4819 (lambda _
4820 (substitute* "setup.py"
4821 ;; This is a variant designed to have a binary
4822 ;; wheel made available on PyPI, which is not a
4823 ;; concern to Guix.
4824 (("click-default-group-wheel")
4825 "click-default-group")))))))
4826 (propagated-inputs (list python-click python-click-default-group
4827 python-dateutil python-sqlite-fts4
4828 python-tabulate))
4829 (native-inputs (list python-pytest python-setuptools python-wheel))
4830 (home-page "https://github.com/simonw/sqlite-utils")
4831 (synopsis
4832 "CLI tool and Python utility functions for manipulating SQLite databases")
4833 (description
4834 "This package provides a CLI tool and Python utility functions for
4835manipulating SQLite databases. It's main features are:
4836@itemize
4837@item
4838Pipe JSON (or CSV or TSV) directly into a new SQLite database file,
4839automatically creating a table with the appropriate schema.
4840@item
4841Run in-memory SQL queries, including joins, directly against data in
4842CSV, TSV or JSON files and view the results.
4843@item
4844Configure SQLite full-text search against your database tables and run
4845search queries against them, ordered by relevance.
4846@item
4847Run transformations against your tables to make schema changes that
4848SQLite ALTER TABLE does not directly support, such as changing the type
4849of a column.
4850@item
4851Extract columns into separate tables to better normalize your existing
4852data.
4853@end itemize")
4854 (license license:asl2.0)))
4855
4856(define-public python-pickleshare
4857 (package
4858 (name "python-pickleshare")
4859 (version "0.7.5")
4860 (source
4861 (origin
4862 (method url-fetch)
4863 (uri (pypi-uri "pickleshare" version))
4864 (sha256
4865 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
4866 (build-system pyproject-build-system)
4867 (native-inputs
4868 (list python-pytest
4869 python-setuptools
4870 python-wheel))
4871 (home-page "https://github.com/vivainio/pickleshare")
4872 (synopsis "Tiny key value database with concurrency support")
4873 (description
4874 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
4875Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
4876shelve, many processes can access the database simultaneously. Changing a
4877value in database is immediately visible to other processes accessing the same
4878database. Concurrency is possible because the values are stored in separate
4879files. Hence the “database” is a directory where all files are governed by
4880PickleShare.")
4881 (license license:expat)))
4882
4883(define-public python-apsw
4884 (package
4885 (name "python-apsw")
4886 (version "3.50.4.0")
4887 (source
4888 (origin
4889 (method git-fetch)
4890 (uri (git-reference
4891 (url "https://github.com/rogerbinns/apsw")
4892 (commit version)))
4893 (file-name (git-file-name name version))
4894 (sha256
4895 (base32 "0r9awjgpl9cmqz5xd4zbqrpiv0rv5c36a18jkqnsfky6n6sgr424"))))
4896 (build-system pyproject-build-system)
4897 (arguments
4898 (list #:test-backend #~'custom
4899 #:test-flags #~(list "-m" "apsw.tests")))
4900 (native-inputs
4901 (list python-setuptools))
4902 (inputs
4903 (list sqlite-next)) ;SQLite 3.45.1 required.
4904 (home-page "https://github.com/rogerbinns/apsw/")
4905 (synopsis "Another Python SQLite Wrapper")
4906 (description
4907 "APSW is a Python wrapper for the SQLite embedded relational database
4908engine. In contrast to other wrappers such as pysqlite it focuses on being a
4909minimal layer over SQLite attempting just to translate the complete SQLite API
4910into Python.")
4911 (license license:zlib)))
4912
4913(define-public python-aiosqlite
4914 (package
4915 (name "python-aiosqlite")
4916 (version "0.21.0")
4917 (source
4918 (origin
4919 (method git-fetch)
4920 (uri (git-reference
4921 (url "https://github.com/omnilib/aiosqlite")
4922 (commit (string-append "v" version))))
4923 (file-name (git-file-name name version))
4924 (sha256
4925 (base32 "1njzxi130bbix53wl0gcsvryk1b2cazq0s2701jbkf6nvr3ywpyy"))))
4926 (build-system pyproject-build-system)
4927 (native-inputs (list python-flit-core python-packaging))
4928 (propagated-inputs (list python-typing-extensions))
4929 (home-page "https://github.com/jreese/aiosqlite")
4930 (synopsis "Asyncio bridge for sqlite3")
4931 (description
4932 "The package aiosqlite replicates the standard sqlite3 module, but with
4933async versions of all the standard connection and cursor methods, and context
4934managers for automatically closing connections.")
4935 (license license:expat)))
4936
4937(define-public python-databases
4938 (package
4939 (name "python-databases")
4940 ;; 0.9.0 needs sqlalchemy>=2.0.7
4941 ;; 0.8.0 needs sqlalchemy>=1.4.42,<1.5
4942 (version "0.8.0")
4943 (source
4944 (origin
4945 (method git-fetch)
4946 (uri (git-reference
4947 (url "https://github.com/encode/databases")
4948 (commit version)))
4949 (file-name (git-file-name name version))
4950 (sha256
4951 (base32 "183yawn8w561y1ni117rf5zaxm4gqqbcmi9fp52xd5fx2dj8qy3v"))))
4952 (build-system pyproject-build-system)
4953 (arguments
4954 (list
4955 #:test-flags
4956 ;; These need TEST_DATABASE_URLS set.
4957 ;; TODO: Use "sqlite:///test.db"? See docs/contributing.md.
4958 #~(list "--ignore=tests/test_databases.py"
4959 "--ignore=tests/test_integration.py"
4960 "--ignore=tests/test_connection_options.py")))
4961 (native-inputs
4962 (list python-httpx
4963 python-psycopg
4964 python-pytest
4965 python-setuptools
4966 python-starlette))
4967 (propagated-inputs
4968 (list python-aiosqlite
4969 python-aiopg
4970 python-aiomysql
4971 python-asyncpg
4972 python-asyncmy
4973 python-sqlalchemy))
4974 (home-page "https://github.com/encode/databases")
4975 (synopsis "Asynchronous database abstraction library")
4976 (description "Databases provides a wrapper around asynchronous database
4977libraries with SQLALchemy.")
4978 (license license:bsd-3)))
4979
4980(define-public python-psycopg2
4981 (package
4982 (name "python-psycopg2")
4983 (version "2.9.11")
4984 (source
4985 (origin
4986 (method git-fetch)
4987 (uri (git-reference
4988 (url "https://github.com/psycopg/psycopg2")
4989 (commit version)))
4990 (file-name (git-file-name name version))
4991 (sha256
4992 (base32 "04l2yzbl15nrw1pcjfkqycvqn6h9phcdh1xx9ynfy3dzfscq5ly5"))))
4993 (build-system pyproject-build-system)
4994 (arguments
4995 (list
4996 #:phases
4997 #~(modify-phases %standard-phases
4998 (add-before 'check 'start-postgresql
4999 (lambda* (#:key inputs tests? #:allow-other-keys)
5000 (when tests?
5001 (setenv "TZDIR" (search-input-directory inputs
5002 "share/zoneinfo"))
5003 (let ((dbdir (string-append (getcwd) "/../pgdir")))
5004 (setenv "PSYCOPG2_TESTDB_USER" "nixbld")
5005 (setenv "PSYCOPG2_TESTDB_HOST" dbdir)
5006 (invoke "initdb" "-D" dbdir)
5007 (invoke "pg_ctl" "-D" dbdir
5008 "-o" (string-append "-k " dbdir)
5009 "-l" (string-append dbdir "/db.log")
5010 "start")
5011 (invoke "psql" "-h" dbdir "-d" "postgres"
5012 "-c" "CREATE DATABASE psycopg2_test;"))))))))
5013 (native-inputs
5014 (list postgresql
5015 python-pytest
5016 python-setuptools
5017 tzdata-for-tests))
5018 (inputs
5019 (list postgresql)) ; libpq
5020 (home-page "https://www.psycopg.org/")
5021 (synopsis "Python PostgreSQL adapter")
5022 (description
5023 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
50242.0.")
5025 (license license:lgpl3+)))
5026
5027(define-public python-psycopg-pool
5028 (package
5029 (name "python-psycopg-pool")
5030 ;; The connection pooling code is on a different release cadence
5031 ;; from the driver code, so fetch the latest PyPI release.
5032 (version "3.1.7")
5033 (source (origin
5034 (method url-fetch)
5035 (uri (pypi-uri "psycopg-pool" version))
5036 (sha256
5037 (base32
5038 "1pkx7nj1mhacwpna7ldzqfqxd1xg8826600r0bs9ad1h93f429yh"))))
5039 (build-system pyproject-build-system)
5040 (arguments
5041 (list
5042 #:tests? #f ;run for psycopg below
5043 #:phases
5044 #~(modify-phases %standard-phases
5045 ;; This module requires 'psycopg', however psycopg needs this
5046 ;; for its tests. Disable sanity check to break the cycle.
5047 (delete 'sanity-check))))
5048 (native-inputs (list python-setuptools))
5049 (home-page "https://www.psycopg.org/")
5050 (synopsis "Connection pooler for psycopg")
5051 (description
5052 "This module provides connection pool implementations that can be used
5053with the @code{psycopg} PostgreSQL driver.")
5054 (license license:lgpl3+)))
5055
5056(define-public python-psycopg
5057 (package
5058 (name "python-psycopg")
5059 (version "3.3.4")
5060 (source
5061 (origin
5062 (method git-fetch)
5063 (uri (git-reference
5064 (url "https://github.com/psycopg/psycopg")
5065 (commit version)))
5066 (file-name (git-file-name name version))
5067 (sha256
5068 (base32 "0kp9pig5hv2378zllmb6kmmabydmp98k8qacmm8098cspb0jqy44"))))
5069 (build-system pyproject-build-system)
5070 (arguments
5071 (list
5072 #:test-flags
5073 #~(list "-o" "asyncio_mode=auto"
5074 ;; FIXME: Many of the typing tests are failing,
5075 ;; conveniently tagged as slow...
5076 "-k" "not slow"
5077 ;; Tests are in parent directory due to the chdir.
5078 "..")
5079 #:phases
5080 #~(modify-phases %standard-phases
5081 (add-before 'build 'change-directory
5082 (lambda _ (chdir "psycopg")))
5083 (add-after 'build 'build-c-extensions
5084 (lambda _
5085 (with-directory-excursion "../psycopg_c"
5086 ((assoc-ref %standard-phases 'build)))))
5087 (add-after 'install 'install-c-extensions
5088 (lambda* (#:key inputs outputs #:allow-other-keys)
5089 (with-directory-excursion "../psycopg_c"
5090 ((assoc-ref %standard-phases 'install)
5091 #:inputs inputs #:outputs outputs))))
5092 (add-before 'check 'start-postgresql
5093 (lambda* (#:key inputs tests? #:allow-other-keys)
5094 (when tests?
5095 (setenv "TZDIR" (search-input-directory inputs
5096 "share/zoneinfo"))
5097 (let ((dbdir (string-append (getcwd) "/../pgdir")))
5098 (invoke "initdb" "-D" dbdir)
5099 (invoke "pg_ctl" "-D" dbdir
5100 "-o" (string-append "-k " dbdir)
5101 "-l" (string-append dbdir "/db.log")
5102 "start")
5103 (invoke "psql" "-h" dbdir "-d" "postgres"
5104 "-c" "CREATE DATABASE nixbld;"))))))))
5105 (native-inputs
5106 (list python-cython
5107 python-psycopg-pool
5108 python-pytest
5109 python-pytest-asyncio
5110 python-anyio
5111 python-setuptools
5112 python-tenacity
5113 pproxy
5114 tzdata-for-tests))
5115 (inputs
5116 (list postgresql))
5117 (home-page "https://www.psycopg.org/")
5118 (synopsis "PostgreSQL driver for Python")
5119 (description
5120 "Psycopg 3 is a new implementation of the popular @code{psycopg2}
5121database adapter for Python.")
5122 (license license:lgpl3+)))
5123
5124;; XXX: The latest version is from 2018, source was deleted from
5125;; Bitbucket.org, consider to withdraw if it keeps failing.
5126(define-public python-sadisplay
5127 (package
5128 (name "python-sadisplay")
5129 (version "0.4.9")
5130 (source
5131 (origin
5132 (method url-fetch)
5133 (uri (pypi-uri "sadisplay" version))
5134 (sha256
5135 (base32 "15jxwgla3q4xsp6rw8inqaiy1kdzc8l2cixj8amqcf0ji47icrxg"))))
5136 (build-system pyproject-build-system)
5137 (arguments
5138 (list
5139 #:test-flags
5140 #~(list "--deselect=tests/test_describe.py::test_inherits"
5141 "--deselect=tests/test_describe.py::test_single_mapper")))
5142 (native-inputs
5143 (list python-pytest
5144 python-setuptools
5145 python-wheel))
5146 (propagated-inputs
5147 (list python-sqlalchemy))
5148 (home-page "https://bitbucket.org/estin/sadisplay")
5149 (synopsis "SQLAlchemy schema displayer")
5150 (description
5151 "This package provides a program to build Entity Relationship diagrams
5152from a SQLAlchemy model (or directly from the database).")
5153 (license license:bsd-3)))
5154
5155(define-public yoyo-migrations
5156 (package
5157 (name "yoyo-migrations")
5158 (version "9.0.0")
5159 (source
5160 (origin
5161 (method hg-fetch)
5162 (uri (hg-reference
5163 (url "https://hg.sr.ht/~olly/yoyo")
5164 (changeset (string-append "v" version "-release"))))
5165 (file-name (string-append name "-" version "-checkout"))
5166 (sha256
5167 (base32 "0bn4n043y0n4dh7axwavfims2krap5dcmdaxswbadzmis3a4hxyb"))))
5168 (build-system pyproject-build-system)
5169 (arguments
5170 (list
5171 #:phases
5172 #~(modify-phases %standard-phases
5173 (add-before 'check 'start-postgresql
5174 (lambda* (#:key inputs tests? #:allow-other-keys)
5175 (when tests?
5176 (delete-file "test_databases.ini")
5177 (call-with-output-file "test_databases.ini"
5178 (lambda (port)
5179 (format port "[DEFAULT]
5180postgresql = postgresql://nixbld@/yoyo_test~%")))
5181 (setenv "TZDIR" (search-input-directory inputs
5182 "share/zoneinfo"))
5183 (let ((dbdir (string-append (getcwd) "/../pgdir")))
5184 (setenv "PGHOST" dbdir)
5185 (setenv "PGUSER" "nixbld")
5186 (invoke "initdb" "-D" dbdir)
5187 (invoke "pg_ctl" "-D" dbdir
5188 "-o" (string-append "-k " dbdir)
5189 "-l" (string-append dbdir "/db.log")
5190 "start")
5191 (invoke "psql" "-h" dbdir "-d" "postgres"
5192 "-c" "CREATE DATABASE yoyo_test;"))))))))
5193 (native-inputs
5194 (list postgresql
5195 python-freezegun
5196 python-psycopg2
5197 python-pytest
5198 python-setuptools
5199 tms
5200 tzdata-for-tests))
5201 (propagated-inputs
5202 (list python-sqlparse python-tabulate python-importlib-metadata))
5203 (home-page "https://ollycope.com/software/yoyo/latest/")
5204 (synopsis "Database migrations with SQL")
5205 (description
5206 "Yoyo is a database schema migration tool. Migrations are written as SQL
5207files or Python scripts that define a list of migration steps.")
5208 (license license:asl2.0)))
5209
5210(define-public mutastructura
5211 (package
5212 (name "mutastructura")
5213 (version "0.7.1")
5214 (source
5215 (origin
5216 (method git-fetch)
5217 (uri (git-reference
5218 (url "https://codeberg.org/jjba23/mutastructura")
5219 (commit (string-append "v" version))))
5220 (file-name (git-file-name name version))
5221 (sha256
5222 (base32 "0rzy7clbzc580xp1mk2qwqv29lq2xn8sfr9lv1rdczk5fj55m4d6"))))
5223 (build-system guile-build-system)
5224 (arguments
5225 (list
5226 #:source-directory "src"
5227 #:modules '((guix build guile-build-system)
5228 (guix build utils)
5229 (ice-9 match))
5230 #:phases
5231 #~(modify-phases %standard-phases
5232 (add-before 'build 'install-program-files
5233 (lambda _
5234 (let* ((bin (string-append #$output "/bin"))
5235 (share (string-append #$output "/share")))
5236 (copy-recursively "resources"
5237 (string-append share "/resources"))
5238 (install-file "scripts/mutastructura" bin)
5239 (chmod (string-append bin "/mutastructura") #o755))))
5240 (add-after 'unpack 'fix-paths
5241 (lambda* (#:key inputs #:allow-other-keys)
5242 (for-each (match-lambda
5243 ((pattern program format-string)
5244 (substitute* "scripts/mutastructura"
5245 ((pattern)
5246 (format #f format-string
5247 (search-input-file inputs
5248 (string-append "bin/"
5249 program)))))))
5250 '(("readlink -f " "readlink" "~s -f ")
5251 ("realpath " "realpath" "~s ")
5252 ("dirname " "dirname" "~s ")
5253 ("getopt " "getopt" "~s ")
5254 ("exec guile " "guile" "exec ~s "))))))))
5255 (propagated-inputs (list guile-dbi
5256 guile-dbd-mysql
5257 guile-dbd-sqlite3
5258 guile-dbd-postgresql
5259 guile-gcrypt))
5260 (inputs (list guile-3.0 bash-minimal coreutils util-linux))
5261 (home-page "https://codeberg.org/jjba23/mutastructura")
5262 (synopsis "Relational database schema migrations powered by Guile Scheme")
5263 (description
5264 "Mutastructura provides a familiar, declarative and transactional
5265approach to managing database states. It exposes a user-friendly
5266@acronym{CLI, command-line interface} and has support for PostgreSQL, MySQL, and SQLite.
5267It also exposes library functions and can be imported and used directly from other Guile code.
5268
5269Features include executing migrations transactionally and computing SHA256
5270checksums to track schema evolution in a @code{migrations_history} table.")
5271 (license license:agpl3+)))
5272
5273(define-public python-mysqlclient
5274 (package
5275 (name "python-mysqlclient")
5276 (version "2.2.7")
5277 (source
5278 (origin
5279 (method url-fetch)
5280 (uri (pypi-uri "mysqlclient" version))
5281 (sha256
5282 (base32 "0i9q2vj6rb4w2iggk0mcp9jla2rm91sx7jcrgv7grm8njjsj5bi4"))))
5283 (build-system pyproject-build-system)
5284 (arguments
5285 (list #:test-flags
5286 #~'("tests/test__mysql.py" ;tests not needing a live db
5287 "tests/test_MySQLdb_times.py")))
5288 (native-inputs
5289 (list pkg-config python-pytest python-setuptools python-wheel))
5290 (inputs (list mariadb-connector-c))
5291 (home-page "https://github.com/PyMySQL/mysqlclient")
5292 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
5293 (description "MySQLdb is an interface to the popular MySQL database server
5294for Python. The design goals are:
5295@enumerate
5296@item Compliance with Python database API version 2.0 [PEP-0249],
5297@item Thread-safety,
5298@item Thread-friendliness (threads will not block each other).
5299@end enumerate")
5300 (license license:gpl2)))
5301
5302(define-public python-hiredis
5303 (package
5304 (name "python-hiredis")
5305 (version "3.1.0")
5306 (source (origin
5307 (method git-fetch) ;for tests
5308 (uri (git-reference
5309 (url "https://github.com/redis/hiredis-py")
5310 (commit (string-append "v" version))))
5311 (file-name (git-file-name name version))
5312 (sha256
5313 (base32
5314 "1g9qj37phq9989av0bwkqy40f5wx9q08y19dsmzwd1ssqsxwhfav"))
5315 (patches
5316 (search-patches "python-hiredis-use-system-hiredis.patch"))))
5317 (build-system pyproject-build-system)
5318 (native-inputs (list python-pytest python-setuptools python-wheel))
5319 (inputs (list hiredis))
5320 (home-page "https://github.com/redis/hiredis-py")
5321 (synopsis "Python extension that wraps protocol parsing code in hiredis")
5322 (description "Python-hiredis is a python extension that wraps protocol
5323parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
5324 (license license:bsd-3)))
5325
5326(define-public python-fakeredis
5327 (package
5328 (name "python-fakeredis")
5329 (version "2.33.0")
5330 (source
5331 (origin
5332 (method git-fetch)
5333 (uri (git-reference
5334 (url "https://github.com/cunla/fakeredis-py")
5335 (commit (string-append "v" version))))
5336 (file-name (git-file-name name version))
5337 (sha256
5338 (base32 "02zi7dl4dm90z4aiadq8bba4vjhrpj8ns34ziazqcxlm72pyzxms"))))
5339 (build-system pyproject-build-system)
5340 (arguments
5341 (list
5342 ;; tests: 2652 passed, 319 skipped, 194 deselected, 24 warnings
5343 #:test-flags
5344 #~(list "-m" "not slow"
5345 "-k" (string-join
5346 ;; redis.exceptions.ResponseError: unknown command
5347 ;; 'evalsha', with args beginning with:
5348 (list "not test_async_lock[fake_resp2]"
5349 "test_async_lock[fake_resp3]"
5350 ;; AssertionError: Commands not found in category
5351 ;; b'write'...
5352 "test_acl_cat[StrictRedis2]"
5353 "test_acl_cat[StrictRedis3]")
5354 " and not "))
5355 #:phases
5356 #~(modify-phases %standard-phases
5357 ;; Tests require a running Redis server.
5358 (add-before 'check 'start-redis
5359 (lambda* (#:key tests? #:allow-other-keys)
5360 (when tests?
5361 (invoke "redis-server" "--daemonize" "yes"
5362 "--port" "6390")))))))
5363 (native-inputs
5364 (list python-hatchling
5365 python-pytest
5366 python-pytest-asyncio
5367 python-pytest-mock
5368 redis))
5369 (propagated-inputs
5370 (list python-redis
5371 python-sortedcontainers
5372 python-valkey))
5373 (home-page "https://github.com/cunla/fakeredis-py")
5374 (synopsis "Fake implementation of redis API for testing purposes")
5375 (description
5376 "Fakeredis is a pure-Python implementation of the redis-py Python client
5377that simulates talking to a redis server. It was created for a single purpose:
5378to write unit tests.
5379
5380Setting up redis is not hard, but one often wants to write unit tests that don't
5381talk to an external server such as redis. This module can be used as a
5382reasonable substitute.")
5383 (license license:bsd-3)))
5384
5385(define-public python-redis
5386 (package
5387 (name "python-redis")
5388 (version "7.1.0")
5389 (source
5390 (origin
5391 (method git-fetch)
5392 (uri (git-reference
5393 (url "https://github.com/redis/redis-py")
5394 (commit (string-append "v" version))))
5395 (file-name (git-file-name name version))
5396 (sha256
5397 (base32 "0c2794r5xcqdqaqr1vr3ibi6lb5rvxg002ichjb42xhlbpd4860j"))))
5398 (build-system pyproject-build-system)
5399 (arguments
5400 (list
5401 #:test-flags
5402 #~(list
5403 ;; These tests are disabled in the official CI run (see:
5404 ;; https://raw.githubusercontent.com/redis/redis-py/master/
5405 ;; .github/workflows/install_and_test.sh).
5406 "-m" "not onlycluster and not redismod and not ssl"
5407 "--ignore=tests/test_scenario"
5408 "--ignore=tests/test_asyncio/test_scenario"
5409 ;; XXX: Those tests require the unpackaged "pybreaker".
5410 "--ignore=tests/test_multidb"
5411 "--ignore=tests/test_asyncio/test_multidb"
5412 ;; XXX: Those tests require the unpackaged "redis_entraid".
5413 "--ignore=tests/test_credentials.py"
5414 "--ignore=tests/test_asyncio/test_credentials.py"
5415 ;; XXX: Those test fail with ConnectionError.
5416 "--ignore=tests/test_sentinel.py"
5417 "--ignore=tests/test_asyncio/test_sentinel.py"
5418 "--deselect=tests/test_commands.py::TestRedisCommands::test_psync"
5419 "--deselect=tests/test_commands.py::TestRedisCommands::\
5420test_xgroup_create_entriesread")
5421 #:phases
5422 #~(modify-phases %standard-phases
5423 (add-after 'unpack 'relax-coverage-requirements
5424 (lambda _
5425 (substitute* "pyproject.toml"
5426 ((".*coverage.*") ""))))
5427 ;; Tests require a running Redis server.
5428 (add-before 'check 'start-redis
5429 (lambda* (#:key tests? #:allow-other-keys)
5430 (when tests?
5431 (invoke "redis-server" "--daemonize" "yes"
5432 "--enable-debug-command" "yes"
5433 "--enable-module-command" "local")))))))
5434 (native-inputs
5435 (list python-hatchling
5436 python-mock
5437 python-numpy
5438 python-pytest
5439 python-pytest-asyncio
5440 python-pytest-timeout
5441 redis))
5442 (propagated-inputs
5443 (list python-async-timeout))
5444 (home-page "https://github.com/redis/redis-py")
5445 (synopsis "Redis Python client")
5446 (description
5447 "This package provides a Python interface to the Redis key-value store.")
5448 (license license:expat)))
5449
5450(define-public python-rq
5451 (package
5452 (name "python-rq")
5453 (version "2.6.1")
5454 (source
5455 (origin
5456 (method git-fetch)
5457 (uri (git-reference
5458 (url "https://github.com/rq/rq")
5459 (commit (string-append "v" version))))
5460 (file-name (git-file-name name version))
5461 (sha256
5462 (base32 "0n2bn9awd3sbl9bkz0h7y8c356w0n7fdhifzfvzylrx2jggczv73"))))
5463 (build-system pyproject-build-system)
5464 (arguments
5465 (list
5466 ;; tests: 520 passed, 16 skipped, 76 warnings
5467 #:phases #~(modify-phases %standard-phases
5468 (add-before 'check 'start-redis
5469 (lambda _
5470 (invoke "redis-server" "--daemonize" "yes"))))))
5471 (native-inputs
5472 (list python-hatchling
5473 python-mock
5474 python-psutil
5475 python-pytest
5476 redis))
5477 (propagated-inputs
5478 (list python-click
5479 python-croniter
5480 python-redis))
5481 (home-page "https://python-rq.org/")
5482 (synopsis "Simple job queues for Python")
5483 (description
5484 "RQ (Redis Queue) is a simple Python library for queueing jobs and
5485processing them in the background with workers. It is backed by Redis and it
5486is designed to have a low barrier to entry.")
5487 (license license:bsd-2)))
5488
5489(define-public python-rq-scheduler
5490 (package
5491 (name "python-rq-scheduler")
5492 (version "0.14")
5493 (source
5494 (origin
5495 (method git-fetch)
5496 (uri (git-reference
5497 (url "https://github.com/rq/rq-scheduler")
5498 (commit (string-append "v" version))))
5499 (file-name (git-file-name name version))
5500 (sha256
5501 (base32 "09fh9m2vcl1jndq35xp1x0j8ih009r71qmhn2pkl93fykrqfavyn"))))
5502 (build-system pyproject-build-system)
5503 (arguments
5504 (list
5505 ;; tests: 60 passed, 15 deselected, 12 warnings
5506 #:test-flags
5507 #~(list #$@(map (lambda (test) (string-append "--deselect="
5508 "tests/test_scheduler.py"
5509 "::TestScheduler::"
5510 test))
5511 ;; OSError: Read crontab <...>: mcron: Only root can use
5512 ;; the -u option.
5513 (list "test_cron_sets_default_result_ttl_to_minus_1"
5514 "test_cron_sets_default_ttl_to_none"
5515 "test_cron_sets_provided_result_ttl"
5516 "test_cron_sets_provided_ttl"
5517 "test_crontab_persisted_correctly"
5518 "test_crontab_persisted_correctly_with_local_timezone"
5519 "test_crontab_rescheduled_correctly_with_local_timezone"
5520 "test_crontab_schedules_correctly"
5521 "test_crontab_sets_default_result_ttl"
5522 "test_crontab_sets_description"
5523 "test_crontab_sets_id"
5524 "test_crontab_sets_timeout"
5525 "test_job_with_crontab_get_rescheduled"))
5526 #$@(map (lambda (test) (string-append "--deselect="
5527 "tests/test_callbacks.py"
5528 "::JobCallbackTestCase::"
5529 test))
5530 ;; AssertionError: <object object at 0x7ffff7599c10> !=
5531 ;; None
5532 (list "test_job_creation_with_failure_callback"
5533 "test_job_creation_with_success_callback")))
5534 #:phases
5535 #~(modify-phases %standard-phases
5536 (add-before 'check 'start-redis
5537 (lambda _
5538 (invoke "redis-server" "--daemonize" "yes")))
5539 (add-after 'unpack 'loosen-requirements
5540 (lambda _
5541 ;; crontab package is python_crontab in PyPI.
5542 (substitute* "setup.py"
5543 (("crontab>=[0-9.]*")
5544 "python-crontab")))))))
5545 (native-inputs
5546 (list python-pytest
5547 python-setuptools
5548 redis))
5549 (propagated-inputs
5550 (list python-crontab
5551 python-freezegun
5552 python-dateutil
5553 python-rq))
5554 (home-page "https://github.com/rq/rq-scheduler")
5555 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
5556 (description
5557 "This package provides job scheduling capabilities to @code{python-rq}
5558(Redis Queue).")
5559 (license license:expat)))
5560
5561(define-public python-sqlparse
5562 (package
5563 (name "python-sqlparse")
5564 (version "0.5.5")
5565 (source
5566 (origin
5567 (method url-fetch)
5568 (uri (pypi-uri "sqlparse" version))
5569 (sha256
5570 (base32 "13pj7ylwm8w35nd8hz64grx5sk69qxk01lqh7gvgv1c51fdll3g2"))))
5571 (build-system pyproject-build-system)
5572 (native-inputs
5573 (list python-pytest
5574 python-hatchling))
5575 (home-page "https://github.com/andialbrecht/sqlparse")
5576 (synopsis "Non-validating SQL parser")
5577 (description "Sqlparse is a non-validating SQL parser for Python. It
5578provides support for parsing, splitting and formatting SQL statements.")
5579 (license license:bsd-3)
5580 (properties '((cpe-name . "sqlparse")))))
5581
5582(define-public python-sql
5583 (package
5584 (name "python-sql")
5585 (version "1.7.0")
5586 (source
5587 (origin
5588 (method url-fetch)
5589 (uri (pypi-uri "python_sql" version))
5590 (sha256
5591 (base32 "09niqspjmsn9wyqadgqjcrsxxa7w4r6dcp21xhi1mimr4ya0p5ky"))))
5592 (build-system pyproject-build-system)
5593 (native-inputs (list python-pytest python-setuptools))
5594 (home-page "https://python-sql.tryton.org/")
5595 (synopsis "Library to write SQL queries in a pythonic way")
5596 (description "@code{python-sql} is a library to write SQL queries, that
5597transforms idiomatic python function calls to well-formed SQL queries.")
5598 (license license:bsd-3)))
5599
5600(define-public python-pypika
5601 (package
5602 (name "python-pypika")
5603 (version "0.49.0")
5604 (source
5605 (origin
5606 (method git-fetch)
5607 (uri (git-reference
5608 (url "https://github.com/kayak/pypika")
5609 (commit (string-append "v" version))))
5610 (file-name (git-file-name name version))
5611 (sha256
5612 (base32 "0nxm2cxq9sx43g57qxw7kzy8lsl5svq659r3mhxpa9vcbxrjrb1d"))))
5613 (build-system pyproject-build-system)
5614 (native-inputs
5615 (list python-parameterized
5616 python-pytest
5617 python-setuptools))
5618 (home-page "https://github.com/kayak/pypika")
5619 (synopsis "SQL query builder API for Python")
5620 (description
5621 "PyPika is a python SQL query builder that exposes the full richness of
5622the SQL language using a syntax that reflects the resulting query.")
5623 (license license:asl2.0)))
5624
5625(define-public apache-orc
5626 (package
5627 (name "apache-orc")
5628 (version "2.0.0")
5629 (source
5630 (origin
5631 (method git-fetch)
5632 (uri (git-reference
5633 (url "https://github.com/apache/orc")
5634 (commit (string-append "v" version))))
5635 (file-name (git-file-name name version))
5636 (sha256
5637 (base32
5638 "1fi6d045wakks0x8clplyxgal342kljqjql7vq5gbd6a2qnaz6m2"))))
5639 (build-system cmake-build-system)
5640 (arguments
5641 (list
5642 ;; XXX: Some tests fail on i686, run on 64bit only for now.
5643 #:tests? (target-64bit?)
5644 #:build-type "Release"
5645 #:configure-flags
5646 #~(list "-DBUILD_JAVA=OFF"
5647 "-DINSTALL_VENDORED_LIBS=OFF"
5648 "-DCMAKE_CXX_FLAGS=-fPIC"
5649 (string-append "-DGTEST_HOME=" #$(this-package-native-input "googletest"))
5650 (string-append "-DZSTD_HOME=" (assoc-ref %build-inputs "zstd:lib"))
5651 (string-append "-DZLIB_HOME=" #$(this-package-input "zlib"))
5652 (string-append "-DPROTOBUF_HOME=" #$(this-package-input "protobuf"))
5653 (string-append "-DLZ4_HOME=" #$(this-package-input "lz4"))
5654 (string-append "-DSNAPPY_HOME=" #$(this-package-input "snappy")))
5655 #:phases
5656 #~(modify-phases %standard-phases
5657 (add-after 'unpack 'disable-bad-test
5658 (lambda _
5659 ;; This one test fails with an obscure error:
5660 ;;
5661 ;; Expected: (std::string::npos) != (error.find(error_msg)),
5662 ;; actual: 18446744073709551615 vs 18446744073709551615
5663 (substitute* "tools/test/TestFileScan.cc"
5664 (("findProgram\\(\"tools/src/orc-scan\"\\);" m)
5665 (string-append m "return;")))))
5666 (add-after 'unpack 'do-not-download-orc-format
5667 (lambda _
5668 (substitute* "cmake_modules/ThirdpartyToolchain.cmake"
5669 (("URL \"https://archive.apache.org/dist/orc/orc-format.*")
5670 (string-append "URL \"file://"
5671 #$(this-package-native-input "orc-format")
5672 "\"\n")))))
5673 (add-after 'unpack 'timezone-fallback
5674 (lambda _
5675 ;; In the build container we don't have /etc/localtime
5676 (substitute* "c++/src/Timezone.cc"
5677 (("return getTimezoneByFilename\\(LOCAL_TIMEZONE\\);")
5678 "if (!std::filesystem::exists(std::filesystem::path(LOCAL_TIMEZONE))) {
5679 return getTimezoneByName(\"UTC\");
5680}
5681return getTimezoneByFilename(LOCAL_TIMEZONE);"))))
5682 (add-before 'check 'pre-check
5683 (lambda* (#:key inputs #:allow-other-keys)
5684 (setenv "TZDIR" (search-input-directory inputs
5685 "share/zoneinfo")))))))
5686 (inputs
5687 `(("lz4" ,lz4)
5688 ("protobuf" ,protobuf)
5689 ("snappy" ,snappy)
5690 ("zlib" ,zlib "static")
5691 ("zstd" ,zstd)
5692 ("zstd:lib" ,zstd "lib")))
5693 (native-inputs
5694 `(("googletest" ,googletest)
5695 ("orc-format" ,(origin
5696 (method url-fetch)
5697 (uri "https://archive.apache.org/dist/orc/orc-format-1.0.0/\
5698orc-format-1.0.0.tar.gz")
5699 (sha256
5700 (base32
5701 "1mccbna3mqhhlqs4pw0fa4pgjnq4c41jhxrh84mq27sbz5gsx7vk"))))
5702 ("pkg-config" ,pkg-config)
5703 ("tzdata" ,tzdata-for-tests)))
5704 (home-page "https://orc.apache.org/")
5705 (synopsis "Columnar storage for Hadoop workloads")
5706 (description "ORC is a self-describing type-aware columnar file format
5707designed for Hadoop workloads. It is optimized for large streaming reads, but
5708with integrated support for finding required rows quickly.")
5709 (license license:asl2.0)))
5710
5711;; There are many wrappers for this in other languages. When touching, please
5712;; be sure to ensure all dependencies continue to build.
5713(define-public apache-arrow
5714 (package
5715 (name "apache-arrow")
5716 (version "24.0.0")
5717 (source
5718 (origin
5719 (method git-fetch)
5720 (uri (git-reference
5721 (url "https://github.com/apache/arrow")
5722 (commit (string-append "apache-arrow-" version))))
5723 (file-name (git-file-name name version))
5724 (sha256
5725 (base32
5726 "1j3gs5ffa9gx2y2nggmi2zn5rj0bsnjnxrzfnipx6050jz6n8dx9"))))
5727 (build-system cmake-build-system)
5728 (arguments
5729 (list
5730 #:tests? #f
5731 #:phases
5732 #~(modify-phases %standard-phases
5733 (add-before 'configure 'enter-source-directory
5734 (lambda _ (chdir "cpp")))
5735 (add-after 'unpack 'set-env
5736 (lambda* (#:key inputs #:allow-other-keys)
5737 (substitute* "cpp/cmake_modules/ThirdpartyToolchain.cmake"
5738 (("set\\(xsimd_SOURCE.*") ""))
5739 (setenv "BOOST_ROOT" #$(this-package-input "boost"))
5740 (setenv "BROTLI_HOME" #$(this-package-input "brotli"))
5741 (setenv "FLATBUFFERS_HOME" #$(this-package-input "flatbuffers"))
5742 (setenv "RAPIDJSON_HOME" #$(this-package-input "rapidjson")))))
5743 #:build-type "Release"
5744 #:configure-flags
5745 #~(list "-DARROW_PYTHON=ON"
5746 ;; Parquet options
5747 "-DARROW_PARQUET=ON"
5748 "-DPARQUET_BUILD_EXECUTABLES=ON"
5749 ;; The maintainers disallow using system versions of
5750 ;; jemalloc:
5751 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
5752 ;; is unfortunate because jemalloc increases performance:
5753 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
5754 "-DARROW_JEMALLOC=OFF"
5755 ;; System mimalloc is not suported and must be bundled:
5756 ;; https://github.com/apache/arrow/issues/42211.
5757 "-DARROW_MIMALLOC=OFF"
5758
5759 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
5760 ;; option that instructs the build system how to resolve
5761 ;; each dependency. SYSTEM = Finding the dependency in
5762 ;; system paths using CMake's built-in find_package
5763 ;; function, or using pkg-config for packages that do not
5764 ;; have this feature
5765 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
5766 "-Dxsimd_SOURCE=SYSTEM"
5767
5768 "-DARROW_RUNTIME_SIMD_LEVEL=NONE"
5769 "-DARROW_SIMD_LEVEL=NONE"
5770 "-DARROW_PACKAGE_KIND=Guix"
5771
5772 ;; Split output into its component packages.
5773 (string-append "-DCMAKE_INSTALL_PREFIX=" #$output:lib)
5774 (string-append "-DCMAKE_INSTALL_RPATH=" #$output:lib "/lib")
5775 (string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin")
5776 (string-append "-DCMAKE_INSTALL_INCLUDEDIR=" #$output:include
5777 "/share/include")
5778
5779 "-DARROW_WITH_SNAPPY=ON"
5780 "-DARROW_WITH_ZLIB=ON"
5781 "-DARROW_WITH_ZSTD=ON"
5782 "-DARROW_WITH_LZ4=ON"
5783 "-DARROW_COMPUTE=ON"
5784 "-DARROW_CSV=ON"
5785 "-DARROW_DATASET=ON"
5786 "-DARROW_FILESYSTEM=ON"
5787 "-DARROW_HDFS=ON"
5788 "-DARROW_JSON=ON"
5789 ;; Arrow Python C++ integration library (required for
5790 ;; building pyarrow). This library must be built against
5791 ;; the same Python version for which you are building
5792 ;; pyarrow. NumPy must also be installed. Enabling this
5793 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
5794 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
5795 ;; ARROW_JSON.
5796 "-DARROW_PYTHON=ON"
5797 "-DARROW_ORC=ON"
5798 "-DORC_SOURCE=SYSTEM"
5799
5800 ;; Building the tests forces on all the
5801 ;; optional features and the use of static
5802 ;; libraries.
5803 "-DARROW_BUILD_TESTS=OFF"
5804 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
5805 "-DARROW_BUILD_STATIC=OFF")))
5806 (inputs
5807 (list apache-orc
5808 boost
5809 brotli
5810 bzip2
5811 double-conversion
5812 gflags
5813 glog
5814 grpc
5815 protobuf
5816 python
5817 python-numpy
5818 rapidjson
5819 re2
5820 snappy
5821 xsimd))
5822 ;; These are all listed under Requires.private in arrow.pc
5823 (propagated-inputs
5824 (list `(,apache-thrift "lib") lz4 utf8proc zlib
5825 `(,zstd "lib")))
5826 (native-inputs
5827 (list pkg-config))
5828 (outputs '("out" "lib" "include"))
5829 (home-page "https://arrow.apache.org/")
5830 (synopsis "Columnar in-memory analytics")
5831 (description "Apache Arrow is a columnar in-memory analytics layer
5832designed to accelerate big data. It houses a set of canonical in-memory
5833representations of flat and hierarchical data along with multiple
5834language-bindings for structure manipulation. It also provides IPC and common
5835algorithm implementations.")
5836 (license license:asl2.0)))
5837
5838(define-public python-pyarrow
5839 (package
5840 (inherit apache-arrow)
5841 (name "python-pyarrow")
5842 (build-system pyproject-build-system)
5843 (arguments
5844 (list
5845 ;; XXX: Test data is distributed separately in
5846 ;; <https://github.com/apache/arrow-testing> 39MiB and requires
5847 ;; additional steps to be implemented, see
5848 ;; <https://github.com/apache/arrow/blob/main/ci/scripts/python_build.sh>.
5849 #:tests? #f
5850 #:phases
5851 #~(modify-phases %standard-phases
5852 (add-after 'unpack 'enter-source-directory
5853 (lambda _ (chdir "python")))
5854 (add-before 'install 'set-pyarrow-build-options
5855 (lambda _
5856 (setenv "PYARROW_BUNDLE_ARROW_CPP_HEADERS" "0")
5857 (setenv "PYARROW_CMAKE_OPTIONS"
5858 (string-append "-DCMAKE_INSTALL_RPATH=" #$output))
5859 (setenv "PYARROW_PARALLEL"
5860 ;; XXX: It's a build host specific option and needs to
5861 ;; be tunable.
5862 (number->string (parallel-job-count)))
5863 (setenv "PYARROW_WITH_DATASET" "1")
5864 (setenv "PYARROW_WITH_HDFS" "1")
5865 (setenv "PYARROW_WITH_ORC" "1")
5866 (setenv "PYARROW_WITH_PARQUET" "1"))))))
5867 (propagated-inputs
5868 (list (list apache-arrow "lib")
5869 (list apache-arrow "include")
5870 apache-orc
5871 python-numpy
5872 python-pandas))
5873 (native-inputs
5874 (list pkg-config
5875 python-cython
5876 python-pytest
5877 python-scikit-build-core
5878 python-setuptools-scm
5879 python-setuptools))
5880 (outputs '("out"))
5881 (home-page "https://arrow.apache.org/docs/python/")
5882 (synopsis "Python bindings for Apache Arrow")
5883 (description
5884 "This library provides a Pythonic API wrapper for the reference Arrow C++
5885implementation, along with tools for interoperability with pandas, NumPy, and
5886other traditional Python scientific computing packages.")
5887 (license license:asl2.0)))
5888
5889(define-public python-fastparquet
5890 (package
5891 (name "python-fastparquet")
5892 (version "2026.5.0")
5893 (source
5894 (origin
5895 (method git-fetch)
5896 (uri (git-reference
5897 (url "https://github.com/dask/fastparquet")
5898 (commit version)))
5899 (file-name (git-file-name name version))
5900 (sha256
5901 (base32 "1x7c25pqrishmskc2k56yh15af4fmsqj4gwxf33d26p2flqyh6xn"))))
5902 (build-system pyproject-build-system)
5903 (arguments
5904 (list
5905 ;; tests: 362 passed, 123 skipped, 15 xfailed, 6 xpassed, 2 warnings
5906 #:test-flags
5907 #~(list "--numprocesses" (number->string (parallel-job-count)))
5908 #:phases
5909 #~(modify-phases %standard-phases
5910 (add-after 'unpack 'remove-dependencies-on-git
5911 (lambda _
5912 (substitute* "setup.py"
5913 (("^.*\"git\", \"status\".*$") ""))))
5914 (add-before 'check 'remove-local-source
5915 (lambda _
5916 (copy-recursively "fastparquet/test" "test")
5917 (delete-file-recursively "fastparquet"))))))
5918 (native-inputs
5919 (list python-cython
5920 python-pytest
5921 python-pytest-xdist
5922 python-setuptools
5923 python-setuptools-scm
5924 tzdata-for-tests))
5925 (propagated-inputs
5926 (list python-cramjam
5927 python-fsspec
5928 python-numpy
5929 python-packaging
5930 python-pandas))
5931 (home-page "https://github.com/dask/fastparquet")
5932 (synopsis "Python implementation of the Parquet file format")
5933 (description
5934 "@code{fastparquet} is a Python implementation of the Parquet file
5935format. @code{fastparquet} is used implicitly by @code{dask}, @code{pandas}
5936and @code{intake-parquet}. It supports the following compression algorithms:
5937
5938@itemize
5939@item Gzip
5940@item Snappy
5941@item Brotli
5942@item LZ4
5943@item Zstd
5944@item LZO (optionally)
5945@end itemize")
5946 (license license:asl2.0)))
5947
5948(define-public python-crate
5949 (package
5950 (name "python-crate")
5951 (version "2.2.1")
5952 (source
5953 (origin
5954 (method git-fetch)
5955 (uri (git-reference
5956 (url "https://github.com/crate/crate-python")
5957 (commit version)))
5958 (file-name (git-file-name name version))
5959 (sha256
5960 (base32 "05yiigpd8kfrms4d369gmp3xiv16l4ajr664rhv0fzc7yy6qv7i7"))))
5961 (build-system pyproject-build-system)
5962 (arguments
5963 (list
5964 ;; tests: 107 passed, 8 deselected
5965 #:test-flags
5966 #~(list "--deselect=tests/test_docs.py::test_docs"
5967 #$@(map (lambda (test) (string-append "--deselect=tests/"
5968 "testing/test_layer.py"
5969 "::LayerTest"
5970 test))
5971 (list "::test_additional_settings"
5972 "::test_basic"
5973 "::test_cluster"
5974 "::test_default_settings"
5975 "::test_dynamic_http_port"
5976 "::test_environment_variables"
5977 "::test_verbosity")))
5978 #:phases
5979 #~(modify-phases %standard-phases
5980 (add-after 'unpack 'set-version
5981 ;; versioningit needs git tags; patch pyproject.toml to use static
5982 ;; version and create _version.py directly.
5983 (lambda _
5984 (substitute* "pyproject.toml"
5985 (("source = \"versioningit\"")
5986 "
5987path = \"src/crate/_version.py\"")
5988 ((", \"versioningit\"")
5989 ""))
5990 (call-with-output-file "src/crate/_version.py"
5991 (lambda (port)
5992 (format port "__version__ = \"~a\"~%" #$version))))))))
5993 (native-inputs
5994 (list python-hatchling
5995 python-pytest
5996 python-pytz
5997 tzdata-for-tests))
5998 (propagated-inputs
5999 (list python-orjson
6000 python-urllib3
6001 python-verlib2))
6002 (home-page "https://github.com/crate/crate-python")
6003 (synopsis "CrateDB Python client")
6004 (description
6005 "This package provides a Python client library for CrateDB.
6006It implements the Python DB API 2.0 specification and includes support for
6007SQLAlchemy.")
6008 (license license:asl2.0)))
6009
6010(define-public libdbi
6011 (package
6012 (name "libdbi")
6013 (version "0.9.0")
6014 (source (origin
6015 (method url-fetch)
6016 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
6017 version "/libdbi-" version ".tar.gz"))
6018 (sha256
6019 (base32
6020 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
6021 (build-system gnu-build-system)
6022 (synopsis "Database independent abstraction layer in C")
6023 (description
6024 "This library implements a database independent abstraction layer in C,
6025similar to the DBI/DBD layer in Perl. Writing one generic set of code,
6026programmers can leverage the power of multiple databases and multiple
6027simultaneous database connections by using this framework.")
6028 (home-page "https://libdbi.sourceforge.net/")
6029 (license license:lgpl2.1+)))
6030
6031(define-public libdbi-drivers
6032 (package
6033 (name "libdbi-drivers")
6034 (version "0.9.0")
6035 (source (origin
6036 (method url-fetch)
6037 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
6038 "libdbi-drivers/libdbi-drivers-" version
6039 "/libdbi-drivers-" version ".tar.gz"))
6040 (sha256
6041 (base32
6042 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
6043 (build-system gnu-build-system)
6044 (native-inputs
6045 (list ;; For tests.
6046 inetutils
6047 (libc-utf8-locales-for-target (%current-system))
6048 mariadb))
6049 (inputs
6050 `(("libdbi" ,libdbi)
6051 ("mariadb:dev" ,mariadb "dev")
6052 ("mariadb:lib" ,mariadb "lib")
6053 ("postgresql" ,postgresql)
6054 ("sqlite" ,sqlite)))
6055 (arguments
6056 `(#:configure-flags
6057 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
6058 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
6059 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
6060 (postgresql (assoc-ref %build-inputs "postgresql"))
6061 (sqlite (assoc-ref %build-inputs "sqlite")))
6062 (list "--disable-docs"
6063 (string-append "--with-dbi-incdir=" libdbi "/include")
6064 (string-append "--with-dbi-libdir=" libdbi "/lib")
6065 "--with-mysql"
6066 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
6067 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
6068 "--with-pgsql"
6069 (string-append "--with-pgsql-incdir=" postgresql "/include")
6070 (string-append "--with-pgsql-libdir=" postgresql "/lib")
6071 "--with-sqlite3"
6072 (string-append "--with-sqlite-incdir=" sqlite "/include")
6073 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
6074 #:tests? #f ; FIXME: Find why the tests get stuck forever.
6075 #:phases
6076 (modify-phases %standard-phases
6077 (add-after 'unpack 'gcc14
6078 (lambda _
6079 (setenv "CFLAGS"
6080 (string-append
6081 "-g -O2 "
6082 "-Wno-error=int-conversion "
6083 "-Wno-error=incompatible-pointer-types "
6084 "-Wno-error=implicit-function-declaration"))))
6085
6086 (add-after 'unpack 'fix-tests
6087 (lambda* (#:key inputs #:allow-other-keys)
6088 (substitute* "tests/test_mysql.sh"
6089 (("^MYMYSQLD=.*")
6090 (string-append "MYMYSQLD="
6091 (assoc-ref inputs "mariadb")
6092 "/bin/mysqld")))
6093 #t))
6094 (add-after 'install 'remove-empty-directories
6095 (lambda* (#:key outputs #:allow-other-keys)
6096 (let ((var (string-append (assoc-ref outputs "out") "/var")))
6097 (delete-file-recursively var))
6098 #t)))))
6099 (synopsis "Database drivers for the libdbi framework")
6100 (description
6101 "The @code{libdbi-drivers} library provides the database specific drivers
6102for the @code{libdbi} framework.
6103
6104The drivers officially supported by @code{libdbi} are:
6105@itemize
6106@item MySQL,
6107@item PostgreSQL,
6108@item SQLite.
6109@end itemize")
6110 (home-page "https://libdbi-drivers.sourceforge.net/")
6111 (license license:lgpl2.1+)))
6112
6113(define-public soci
6114 (package
6115 (name "soci")
6116 (version "4.0.3")
6117 (source (origin
6118 (method git-fetch)
6119 (uri (git-reference
6120 (url "https://github.com/SOCI/soci/")
6121 (commit (string-append "v" version))))
6122 (file-name (git-file-name name version))
6123 (sha256
6124 (base32
6125 "12aq7pama96l2c1kmfkclb4bvrsxs9a8ppgk5gmzw45w2lg35i0y"))
6126 (patches (search-patches "soci-mysql-ddl-types.patch"))))
6127 (build-system cmake-build-system)
6128 (propagated-inputs
6129 ;; Headers of soci has include-references to headers of these inputs.
6130 (list firebird
6131 postgresql
6132 sqlite
6133 unixodbc
6134 boost
6135 `(,mariadb "dev")))
6136 (arguments
6137 (list #:configure-flags
6138 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs
6139 ;; it.
6140 #~(list "-DCMAKE_CXX_STANDARD=17"
6141 "-DSOCI_LIBDIR=lib"
6142 ;; This is for relocation when linking statically
6143 "-DCMAKE_CXX_FLAGS=-fPIE")
6144 #:tests? #f)) ; may require running database management systems
6145 (synopsis "C++ Database Access Library")
6146 (description
6147 "SOCI is an abstraction layer for several database backends, including
6148PostreSQL, SQLite, ODBC and MySQL.")
6149 (home-page "https://soci.sourceforge.net/")
6150 (license license:boost1.0)))
6151
6152(define-public freetds
6153 (package
6154 (name "freetds")
6155 (version "1.2.20")
6156 (source
6157 (origin
6158 (method url-fetch)
6159 (uri (string-append "https://www.freetds.org/files/stable/"
6160 "freetds-" version ".tar.gz"))
6161 (sha256
6162 (base32 "11fzwcahc1bc8npxbif0448v9cwyf7k04167i7fcspmfw7a0hj0d"))))
6163 (build-system gnu-build-system)
6164 (inputs (list unixodbc))
6165 (arguments
6166 ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection,
6167 ;; disabled for now.
6168 `(#:tests? #f
6169 #:configure-flags
6170 (list (string-append "--with-unixodbc=" (assoc-ref %build-inputs "unixodbc")))))
6171 (home-page "https://www.freetds.org/")
6172 (synopsis "Client libraries for MS SQL and Sybase servers")
6173 (description
6174 "FreeTDS is an implementation of the Tabular DataStream protocol, used for
6175connecting to MS SQL and Sybase servers over TCP/IP.")
6176 (license license:lgpl2.0+)))
6177
6178(define-public python-tinydb
6179 (package
6180 (name "python-tinydb")
6181 (version "4.8.0")
6182 (source (origin
6183 (method url-fetch)
6184 (uri (pypi-uri "tinydb" version))
6185 (sha256
6186 (base32 "0r6mavw0wm03lbmqbgglsyff3vws86ddg3q8h29glpd7qnlqdmkd"))))
6187 (build-system pyproject-build-system)
6188 (native-inputs
6189 (list python-poetry-core python-pytest))
6190 (home-page "https://github.com/msiemens/tinydb")
6191 (synopsis "TinyDB is a lightweight document oriented database")
6192 (description
6193 "TinyDB is a small document oriented database written in pure Python
6194with no external dependencies. The targets are small apps that would
6195be blown away by a SQL-DB or an external database server.")
6196 (license license:expat)))
6197
6198(define-public sdb
6199 (package
6200 (name "sdb")
6201 (version "2.5.0")
6202 (source (origin
6203 (method git-fetch)
6204 (uri (git-reference
6205 (url "https://github.com/radareorg/sdb.git")
6206 (commit version)))
6207 (file-name (git-file-name name version))
6208 (sha256
6209 (base32
6210 "1fci72hcm2a0k9rnsfkcr2qsfprzxfycghpr4i3wargj781lc9jd"))))
6211 (build-system meson-build-system)
6212 (arguments
6213 (list
6214 #:phases
6215 #~(modify-phases %standard-phases
6216 (add-before 'check 'setenv-cc
6217 (lambda _
6218 (setenv "CC" #$(cc-for-target))))
6219 ;; The provided meson.build uses a Makefile in the source root
6220 ;; to run the tests, but resolves its directory relative to
6221 ;; the build directory, assuming the build is one level under
6222 ;; the source tree. This breaks if the build tree is elsewhere.
6223 (add-before 'check 'set-test-workdir-to-source-root
6224 (lambda _
6225 (substitute* "../source/meson.build"
6226 (("workdir: join_paths.*$")
6227 "workdir: meson.project_source_root(),\n")))))))
6228 (native-inputs
6229 (list node
6230 perl
6231 python-minimal-wrapper))
6232 (home-page "https://github.com/radareorg/sdb")
6233 (synopsis "Simple and fast string based key-value database")
6234 (description "SDB is a simple key/value database based on djb's cdb disk
6235storage that supports JSON and array introspection.")
6236 (license license:expat)))
6237(define-public sqlitebrowser
6238 (package
6239 (name "sqlitebrowser")
6240 (version "3.13.1")
6241 (source
6242 (origin
6243 (method git-fetch)
6244 (uri (git-reference
6245 (url "https://github.com/sqlitebrowser/sqlitebrowser")
6246 (commit (string-append "v" version))))
6247 (file-name (git-file-name name version))
6248 (sha256
6249 (base32 "0615yks1krwjw4l1xxahn9j6qbd7cs8dxza7kc73hc5wr0xng5kf"))
6250 (modules '((guix build utils)))
6251 (snippet
6252 '(begin
6253 ;; Delete bundled dependencies, available as Guix packages.
6254 (for-each delete-file-recursively
6255 (list "libs/json"
6256 "libs/qcustomplot-source"
6257 "libs/qhexedit"
6258 "libs/qscintilla"))
6259 ;; Patch #includes to be able to use Guix's nlohmann-json
6260 (with-directory-excursion "src"
6261 (substitute* (list "RemoteCommitsModel.h"
6262 "RemoteLocalFilesModel.h"
6263 "RemoteModel.h"
6264 "RemotePushDialog.cpp"
6265 "RemoteNetwork.cpp"
6266 "RemoteDock.cpp"
6267 "ExportDataDialog.cpp"
6268 "EditDialog.cpp")
6269 (("json\\.hpp") "nlohmann/json.hpp")))))))
6270 (build-system qt-build-system)
6271 (arguments
6272 (list #:configure-flags
6273 #~(list (string-append "-DQSCINTILLA_INCLUDE_DIR="
6274 #$(this-package-input "qscintilla-qt5")
6275 "/include/Qsci")
6276 "-DFORCE_INTERNAL_QCUSTOMPLOT=OFF"
6277 "-DFORCE_INTERNAL_QHEXEDIT=OFF"
6278 "-DENABLE_TESTING=ON")))
6279 (inputs
6280 (list qcustomplot-qt5
6281 qhexedit
6282 qscintilla-qt5
6283 qtbase-5
6284 qtwayland-5
6285 sqlite))
6286 (native-inputs (list nlohmann-json qttools-5))
6287 (home-page "https://sqlitebrowser.org/")
6288 (synopsis "Visual database browser and editor for SQLite")
6289 (description "Sqlitebrowser lets you create, design, and edit database files
6290compatible with SQLite using a graphical user interface.")
6291 (license
6292 ;; dual license
6293 (list license:gpl3+
6294 license:mpl2.0))))
6295
6296(define-public sqlitecpp
6297 (package
6298 (name "sqlitecpp")
6299 (version "3.3.3")
6300 (source
6301 (origin
6302 (method git-fetch)
6303 (uri (git-reference
6304 (url "https://github.com/SRombauts/SQLiteCpp")
6305 (commit version)))
6306 (file-name (git-file-name name version))
6307 (sha256
6308 (base32
6309 "10gliycmzd16ydbpwwsn1r6byf5l78fwwc7hzgjdgg68zcclj8s5"))
6310 (modules '((guix build utils)))
6311 (snippet #~(delete-file-recursively "sqlite3"))))
6312 (build-system cmake-build-system)
6313 (arguments
6314 (list
6315 #:configure-flags #~'("-DSQLITECPP_INTERNAL_SQLITE=OFF"
6316 "-DSQLITECPP_INCLUDE_SCRIPT=OFF"
6317 "-DSQLITECPP_BUILD_TESTS=ON"
6318 "-DBUILD_SHARED_LIBS=ON")))
6319 (inputs (list sqlite))
6320 (native-inputs (list googletest))
6321 (home-page "https://srombauts.github.io/SQLiteCpp/")
6322 (synopsis "C++ SQLite3 wrapper")
6323 (description "SQLiteC++ offers a intuitive C++ wrapper around the native C
6324APIs of SQLite, prioritizing speed, minimal dependencies, and portability.")
6325 ;; Complementary cmake and code-linter 3-clause BSD.
6326 (license license:expat)))
6327
6328(define-public sqlitestudio
6329 (package
6330 (name "sqlitestudio")
6331 (version "3.4.19")
6332 (source
6333 (origin
6334 (method git-fetch)
6335 (uri (git-reference
6336 (url "https://github.com/pawelsalawa/sqlitestudio")
6337 (commit version)))
6338 (file-name (git-file-name name version))
6339 (sha256
6340 (base32 "1fvyd2l1pbpl4jgn7vp8j2gsmw0sbfzidyv3k87xm6a2d7i680yc"))))
6341 (build-system gnu-build-system)
6342 (arguments
6343 (list
6344 #:phases
6345 #~(modify-phases %standard-phases
6346 (replace 'configure
6347 (lambda* (#:key inputs outputs #:allow-other-keys)
6348 (let* ((out (assoc-ref outputs "out"))
6349 (python-version #$(version-major+minor (package-version
6350 python)))
6351 (python-include (string-append (assoc-ref inputs "python")
6352 "/include/python"
6353 python-version)))
6354 (invoke "qmake"
6355 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out
6356 "/lib:")
6357 (string-append "PREFIX=" out) "./SQLiteStudio3")
6358 (mkdir-p "Plugins")
6359 (with-directory-excursion "Plugins"
6360 (invoke "qmake"
6361 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out
6362 "/lib:")
6363 (string-append "PREFIX=" out)
6364 (string-append "INCLUDEPATH+=" python-include)
6365 (string-append "PYTHON_VERSION=" python-version)
6366 ".")))))
6367 (replace 'build
6368 (lambda _
6369 (invoke "make" "-j"
6370 (number->string (parallel-job-count)))
6371 (with-directory-excursion "Plugins"
6372 (invoke "make")))) ;building plugins in parallel corrupts them
6373 (replace 'install
6374 (lambda* (#:key outputs #:allow-other-keys)
6375 (let* ((out (assoc-ref outputs "out"))
6376 (icons-dir (string-append out "/share/icons/hicolor/"))
6377 (src-img-dir (string-append
6378 "SQLiteStudio3/guiSQLiteStudio/img/")))
6379 (invoke "make" "-j"
6380 (number->string (parallel-job-count)) "install")
6381 (for-each (lambda (size)
6382 (let ((target-dir (string-append icons-dir size
6383 "x" size "/apps/")))
6384 (mkdir-p target-dir)
6385 (copy-file (string-append src-img-dir
6386 "sqlitestudio_" size
6387 ".png")
6388 (string-append target-dir
6389 "sqlitestudio.png"))))
6390 '("16" "48" "256"))
6391 (let ((target-dir (string-append icons-dir "scalable/apps/")))
6392 (mkdir-p target-dir)
6393 (install-file (string-append src-img-dir "sqlitestudio.svg")
6394 target-dir))
6395 (with-directory-excursion "Plugins"
6396 (invoke "make" "-j"
6397 (number->string (parallel-job-count)) "install")))))
6398 (add-after 'install 'install-desktop
6399 (lambda* (#:key outputs #:allow-other-keys)
6400 (let* ((out (assoc-ref outputs "out")))
6401 (make-desktop-entry-file (string-append out
6402 "/share/applications/"
6403 #$name ".desktop")
6404 #:name "SQLiteStudio"
6405 #:comment #$(package-synopsis
6406 this-package)
6407 #:exec (string-append #$name " %f")
6408 #:icon #$name
6409 #:categories '("Development"
6410 "Utility" "Database")
6411 #:mime-type "application/vnd.sqlite3")))))))
6412 (inputs (list openssl
6413 python
6414 qtbase-5
6415 qtsvg-5
6416 readline
6417 sqlite-next))
6418 (native-inputs (list python qttools-5 qtdeclarative-5 tcl))
6419 (home-page "https://sqlitestudio.pl/")
6420 (synopsis "Graphical user interface to browse and edit SQLite databases")
6421 (description
6422 "SQLiteStudio is desktop application for browsing and editing SQLite
6423database files. It is aimed for people, who know what SQLite is, or what
6424relational databases are in general.")
6425 (license license:gpl3+)))
6426
6427(define-public sqls
6428 (package
6429 (name "sqls")
6430 ;; TODO: The latest version requires a way more packages to be available
6431 ;; in Guix.
6432 (version "0.2.18")
6433 (source (origin
6434 (method git-fetch)
6435 (uri (git-reference
6436 (url "https://github.com/sqls-server/sqls")
6437 (commit (string-append "v" version))))
6438 (file-name (git-file-name name version))
6439 (sha256
6440 (base32
6441 "13837v27avdp2nls3vyy7ml12nj7rxragchwf92adn10ffp4aj6c"))))
6442 (build-system go-build-system)
6443 (arguments
6444 (list
6445 #:install-source? #f
6446 #:import-path "github.com/lighttiger2505/sqls"
6447 ;; XXX: Try to enable more or all tests.
6448 #:test-subdirs #~(list "ast/..."
6449 "dialect/..."
6450 "parser/..."
6451 "internal/completer"
6452 "internal/config/..."
6453 "internal/database"
6454 "internal/debug"
6455 "internal/formatter"
6456 "internal/lsp")))
6457 (native-inputs
6458 (list go-github-com-google-go-cmp
6459 go-github-com-go-sql-driver-mysql
6460 go-github-com-k0kubun-pp
6461 go-github-com-lib-pq
6462 go-github-com-mattn-go-runewidth
6463 go-github-com-mattn-go-sqlite3
6464 go-github-com-olekukonko-tablewriter-0.0.5
6465 go-github-com-pkg-errors
6466 go-github-com-sourcegraph-jsonrpc2
6467 go-golang-org-x-crypto
6468 go-golang-org-x-xerrors
6469 go-gopkg-in-yaml-v2))
6470 (home-page "https://github.com/sqls-server/sqls")
6471 (synopsis "SQL language server written in Go")
6472 (description
6473 "This package implements the @acronym{LSP, Language Server Protocol} for SQL.")
6474 (license license:expat)))
6475
6476(define-public python-dbutils
6477 (package
6478 (name "python-dbutils")
6479 (version "3.1.2")
6480 (source
6481 (origin
6482 (method git-fetch)
6483 (uri (git-reference
6484 (url "https://github.com/WebwareForPython/DBUtils")
6485 (commit
6486 (string-append "Release-"
6487 (string-join (string-split version #\.) "_")))))
6488 (file-name (git-file-name name version))
6489 (sha256
6490 (base32 "1x2bqqlp6ahm8k8d0f1g3l0fcsjala3z6jdmcwhwkbh0agg8agff"))))
6491 (build-system pyproject-build-system)
6492 (native-inputs (list python-pytest python-setuptools))
6493 (home-page "https://github.com/WebwareForPython/DBUtils")
6494 (synopsis "Database connections for multi-threaded environments")
6495 (description
6496 "This package provides tooling for solid, persistent and pooled
6497connections to a database that can be used in all kinds of multi-threaded
6498environments.")
6499 (license license:expat)))
6500
6501(define-public python-dogpile-cache
6502 (package
6503 (name "python-dogpile-cache")
6504 (version "1.3.4")
6505 (source
6506 (origin
6507 (method url-fetch)
6508 (uri (pypi-uri "dogpile_cache" version))
6509 (sha256
6510 (base32 "1h58g3iyv6gc6x3in252d4c1v5sncvishjy82dz3zpazbxbra0jg"))))
6511 (build-system pyproject-build-system)
6512 (native-inputs
6513 (list python-mako
6514 python-pytest
6515 python-setuptools
6516 python-wheel))
6517 (propagated-inputs
6518 (list python-decorator
6519 python-stevedore
6520 python-typing-extensions))
6521 (home-page "https://github.com/sqlalchemy/dogpile.cache")
6522 (synopsis "Caching front-end based on the Dogpile lock")
6523 (description "@code{dogpile.cache} is a caching API which provides a
6524generic interface to caching backends of any variety, and additionally
6525provides API hooks which integrate these cache backends with the locking
6526mechanism of @code{dogpile}.")
6527 (license license:expat)))
6528
6529(define-public datasette
6530 (package
6531 (name "datasette")
6532 (version "1.0a26")
6533 (source
6534 (origin
6535 (method git-fetch)
6536 (uri (git-reference
6537 (url "https://github.com/simonw/datasette")
6538 (commit version)))
6539 (file-name (git-file-name name version))
6540 (sha256
6541 (base32 "1ra0yfrz9w3jx7ix3dmcsg0g8hjxkz37586g7ijmqshxpzczxfm7"))))
6542 (build-system pyproject-build-system)
6543 (arguments
6544 (list
6545 ;; tests: 1720 passed, 9 skipped, 8 xfailed, 13 xpassed, 3 warnings, 120
6546 ;; subtests passed
6547 #:test-flags
6548 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
6549 "--ignore=tests/test_black.py")
6550 #:phases
6551 #~(modify-phases %standard-phases
6552 (add-after 'unpack 'relax-requirements
6553 (lambda _
6554 (substitute* "pyproject.toml"
6555 (("\"pip\",") "")))))))
6556 (propagated-inputs
6557 (list python-aiofiles
6558 python-asgi-csrf
6559 python-asgiref
6560 python-asyncinject
6561 python-click
6562 python-click-default-group
6563 python-httpx
6564 python-hupper
6565 python-itsdangerous
6566 python-janus
6567 python-jinja2
6568 python-mergedeep
6569 python-pluggy
6570 python-pyyaml
6571 python-sqlite-utils
6572 python-uvicorn))
6573 (native-inputs
6574 (list nss-certs-for-test
6575 python-beautifulsoup4
6576 python-cogapp
6577 python-multipart-form-data-conformance
6578 python-pytest
6579 python-pytest-asyncio
6580 python-pytest-timeout
6581 python-pytest-xdist
6582 python-setuptools
6583 python-trustme))
6584 (home-page "https://datasette.io/")
6585 (synopsis "Multi-tool for exploring and publishing data")
6586 (description "Datasette is a tool for exploring and publishing data.
6587It helps people take data of any shape or size and publish that as an
6588interactive, explorable website and accompanying API.")
6589 (license license:asl2.0)))