projects/guix·blob java-team · refs

6635 lines · 261.5 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 "1.0.1")
4394 (source
4395 (origin
4396 (method git-fetch)
4397 (uri (git-reference
4398 (url "https://github.com/mdbtools/mdbtools")
4399 (commit (string-append "v" version))))
4400 (file-name (git-file-name name version))
4401 (sha256
4402 (base32 "1yswq95n2i22dqzi8myz1ppi2207gpxaji2kiplxzisa0s0hasax"))))
4403 (build-system gnu-build-system)
4404 (arguments
4405 (list
4406 #:configure-flags
4407 #~(list (string-append "--with-unixodbc="
4408 #$(this-package-input "unixodbc")))))
4409 (inputs (list glib unixodbc))
4410 (native-inputs
4411 (list autoconf
4412 automake
4413 bison
4414 flex
4415 gettext-minimal
4416 libtool
4417 pkg-config
4418 txt2man
4419 which))
4420 (home-page "https://github.com/mdbtools/mdbtools")
4421 (synopsis "Read Microsoft Access databases")
4422 (description "MDB Tools is a set of tools and applications to read the
4423proprietary MDB file format used in Microsoft's Access database package. This
4424includes programs to export schema and data from Microsoft's Access database
4425file format to CSV and JSON as well as to other databases such as MySQL,
4426Oracle, Sybase, PostgreSQL, etc., and an SQL engine for performing simple SQL
4427queries.")
4428 (license (list license:lgpl2.0
4429 license:gpl2+))))
4430
4431(define-public python-lmdb
4432 (package
4433 (name "python-lmdb")
4434 (version "1.0.0")
4435 (source
4436 (origin
4437 (method url-fetch)
4438 (uri (pypi-uri "lmdb" version))
4439 (sha256
4440 (base32 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
4441 (snippet
4442 ;; Delete bundled lmdb source files.
4443 #~(for-each delete-file
4444 '("lib/lmdb.h" "lib/mdb.c" "lib/midl.c" "lib/midl.h")))))
4445 (build-system pyproject-build-system)
4446 (arguments
4447 (list
4448 #:phases
4449 #~(modify-phases %standard-phases
4450 (add-before 'build 'use-system-lmdb
4451 (lambda* (#:key inputs #:allow-other-keys)
4452 (let ((lmdb (assoc-ref inputs "lmdb")))
4453 (setenv "LMDB_PURE" "set") ;don't apply env-copy-txn.patch
4454 (setenv "LMDB_FORCE_SYSTEM" "set")
4455 (setenv "LMDB_INCLUDEDIR"
4456 (string-append lmdb "/include"))
4457 (setenv "LMDB_LIBDIR"
4458 (string-append lmdb "/lib"))))))))
4459 (native-inputs (list python-pytest python-setuptools python-wheel))
4460 (inputs (list lmdb))
4461 (home-page "https://github.com/dw/py-lmdb")
4462 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
4463 (description
4464 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
4465Memory-Mapped Database} (LMDB), a high-performance key-value store.")
4466 (license (list license:openldap2.8
4467 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
4468 ;; but not actually needed on platforms currently supported by Guix.
4469 license:bsd-3))))
4470
4471(define-public virtuoso-ose
4472 (package
4473 (name "virtuoso-ose")
4474 (version "7.2.15")
4475 (source
4476 (origin
4477 (method url-fetch)
4478 (uri (string-append "mirror://sourceforge/virtuoso/virtuoso/" version "/"
4479 "virtuoso-opensource-" version ".tar.gz"))
4480 (sha256
4481 (base32 "1nz6kddwxz5k79g3skj7y45f0l20m8fh8haw42j313xm177xpdp0"))
4482 (modules '((guix build utils)))
4483 ;; This snippet removes pre-built Java archives.
4484 (snippet
4485 #~(for-each delete-file-recursively
4486 (find-files "." "\\.jar$")))))
4487 (build-system gnu-build-system)
4488 (arguments
4489 (list
4490 #:tests? #f ; tests require a network connection
4491 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
4492 ;; This indicates that the internal zlib code may still be used.
4493 #:configure-flags
4494 #~(list "--without-internal-zlib"
4495 "--with-readline"
4496 "--enable-static=no")
4497 #:phases
4498 #~(modify-phases %standard-phases
4499 (add-after 'unpack 'avoid-embedding-kernel-and-timestamps
4500 ;; For a reproducible build, avoid embedding the kernel version and
4501 ;; timestamps.
4502 (lambda _
4503 (substitute*
4504 (list "bin/makever"
4505 "appsrc/ODS-Polls/make_vad.sh"
4506 "appsrc/ODS-Blog/make_vad.sh"
4507 "appsrc/ODS-Community/make_vad.sh"
4508 "appsrc/ODS-Framework/make_vad.sh"
4509 "appsrc/ODS-Framework/oauth/make_vad.sh"
4510 "appsrc/ODS-WebMail/make_vad.sh"
4511 "appsrc/ODS-Calendar/make_vad.sh"
4512 "appsrc/ODS-Gallery/make_vad.sh"
4513 "appsrc/ODS-Briefcase/make_vad.sh"
4514 "appsrc/ODS-FeedManager/make_vad.sh"
4515 "appsrc/ODS-Bookmark/make_vad.sh"
4516 "appsrc/ODS-Addressbook/make_vad.sh"
4517 "binsrc/samples/demo/make_vad.sh"
4518 "binsrc/samples/demo/mkdoc.sh"
4519 "binsrc/rdf_mappers/make_vad.sh")
4520 (("^UNAME_SYSTEM=.*") "UNAME_SYSTEM=unknown\n")
4521 (("^UNAME_RELEASE=.*") "UNAME_RELEASE=unknown\n")
4522 (("^PACKDATE=.*") "PACKDATE=2012-04-18\n")
4523 (("^DATE=.*") "DATE=2012-04-18\n"))))
4524 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
4525 ;; the build output. The following phase removes it.
4526 (add-after 'install 'remove-static-libs
4527 (lambda _
4528 (for-each
4529 (lambda (file)
4530 (delete-file (string-append #$output "/lib/" file)))
4531 '("libvirtuoso-t.a"
4532 "libvirtuoso-t.la")))))))
4533 (native-inputs
4534 (list autoconf automake bison flex gperf libtool python))
4535 (inputs
4536 (list openssl net-tools readline which zlib))
4537 (home-page "https://vos.openlinksw.com/owiki/wiki/VOS/")
4538 (synopsis "Multi-model database system")
4539 (description "Virtuoso is a scalable cross-platform server that combines
4540relational, graph, and document data management with web application server
4541and web services platform functionality.")
4542 ;; configure: error: ... can only be build on 64bit platforms
4543 (supported-systems %64bit-supported-systems)
4544 (license license:gpl2)))
4545
4546(define-public python-ccm
4547 (package
4548 (name "python-ccm")
4549 (version "3.1.5")
4550 (source
4551 (origin
4552 (method url-fetch)
4553 (uri (pypi-uri "ccm" version))
4554 (sha256
4555 (base32
4556 "0v1jahchm9czcdhynfy76mca52k6jbvngm60jqdwxlhnf6iw0z7h"))))
4557 (build-system pyproject-build-system)
4558 (arguments
4559 ;; TODO: tests require a complex setup, see <.github/workflows/main.yml>.
4560 (list #:tests? #f))
4561 (native-inputs
4562 (list python-pbr))
4563 (propagated-inputs
4564 (list python-pyyaml
4565 python-psutil
4566 python-six)) ;XXX: hard dependency
4567 (home-page "https://github.com/pcmanus/ccm")
4568 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
4569localhost")
4570 (description "Cassandra Cluster Manager is a development tool for testing
4571local Cassandra clusters. It creates, launches and removes Cassandra clusters
4572on localhost.")
4573 (license license:asl2.0)))
4574
4575(define-public python-sqlalchemy
4576 (package
4577 (name "python-sqlalchemy")
4578 (version "1.4.54")
4579 (source
4580 (origin
4581 (method url-fetch)
4582 (uri (pypi-uri "SQLAlchemy" version))
4583 (sha256
4584 (base32 "06n36zs280iahxj34fvq1iwq3zjlmvsalfcanwhdqdcc13nznw24"))))
4585 (build-system pyproject-build-system)
4586 (native-inputs
4587 (list python-cython ; for C extensions
4588 python-pytest python-mock python-pytest-xdist ; for tests
4589 python-setuptools python-wheel))
4590 (propagated-inputs
4591 (list python-greenlet))
4592 (arguments
4593 (list
4594 #:test-flags
4595 '(list ;; The memory usage tests are very expensive and run in sequence;
4596 ;; skip them.
4597 "-k" "not test_memusage.py")))
4598 (home-page "https://www.sqlalchemy.org")
4599 (synopsis "Database abstraction library")
4600 (description
4601 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
4602gives application developers the full power and flexibility of SQL. It
4603provides a full suite of well known enterprise-level persistence patterns,
4604designed for efficient and high-performing database access, adapted into a
4605simple and Pythonic domain language.")
4606 (license license:x11)))
4607
4608(define-public python-sqlalchemy-2
4609 (package
4610 (name "python-sqlalchemy")
4611 (version "2.0.45")
4612 (source
4613 (origin
4614 (method url-fetch)
4615 (uri (pypi-uri "sqlalchemy" version))
4616 (sha256
4617 (base32 "126fxwlk5kd0vwymw3pfmayl29c8il2n6qxdzl1mglnjm2ys8chn"))))
4618 (build-system pyproject-build-system)
4619 (arguments
4620 (list
4621 #:test-flags
4622 ;; Remove expensive tests.
4623 #~(list "--ignore=test/aaa_profiling/test_memusage.py"
4624 "--ignore=test/ext/mypy/test_mypy_plugin_py3k.py"
4625 "--ignore=test/typing/test_mypy.py"
4626 ;; Disable a test that fails randomly.
4627 "-k" "test_recycle_pool_no_race")))
4628 (native-inputs
4629 (list python-cython
4630 python-pytest
4631 python-setuptools))
4632 (propagated-inputs
4633 (list python-greenlet
4634 python-typing-extensions))
4635 (home-page "https://www.sqlalchemy.org")
4636 (synopsis "SQL toolkit and object relational mapper")
4637 (description
4638 "SQLAlchemy is the Python SQL toolkit and @acronym{ORM, Object Relational
4639Mapper} that gives application developers the full power and flexibility of
4640SQL. It provides a full suite of well known enterprise-level persistence
4641patterns, designed for efficient and high-performing database access, adapted
4642into a simple and Pythonic domain language.")
4643 (license license:expat)))
4644
4645(define-public python-sqlalchemy-utils
4646 (package
4647 (name "python-sqlalchemy-utils")
4648 (version "0.42.1")
4649 (source
4650 (origin
4651 (method git-fetch)
4652 (uri (git-reference
4653 (url "https://github.com/kvesteri/sqlalchemy-utils")
4654 (commit version)))
4655 (file-name (git-file-name name version))
4656 (sha256
4657 (base32 "0ny1p352p0dlgrf9fnmzj7ld1rga5zj698qpla1kdaliwwh6xawn"))))
4658 (build-system pyproject-build-system)
4659 (arguments
4660 (list
4661 #:test-flags
4662 ;; XXX: These tests require additional inputs.
4663 #~(list "--deselect=tests/test_views.py::TestMySqlTrivialView"
4664 "--deselect=tests/functions/test_database.py::\
4665TestDatabasePostgresPg8000::test_create_and_drop"
4666 "--deselect=tests/functions/test_database.py::\
4667TestDatabasePostgresPsycoPG2CFFI::test_create_and_drop")
4668 #:phases
4669 #~(modify-phases %standard-phases
4670 (add-before 'check 'start-postgresql
4671 (lambda* (#:key inputs tests? #:allow-other-keys)
4672 (when tests?
4673 (setenv "TZDIR" (search-input-directory inputs
4674 "share/zoneinfo"))
4675 (let ((dbdir (string-append (getcwd) "/../pgdir")))
4676 (setenv "SQLALCHEMY_UTILS_TEST_POSTGRESQL_USER"
4677 "nixbld")
4678 (invoke "initdb" "-D" dbdir)
4679 (invoke "pg_ctl" "-D" dbdir
4680 "-o" (string-append "-k " dbdir)
4681 "-l" (string-append dbdir "/db.log")
4682 "start")
4683 (invoke "psql" "-h" dbdir "-d" "postgres"
4684 "-c" "CREATE DATABASE sqlalchemy_utils_test;"))))))))
4685 (propagated-inputs (list python-six python-sqlalchemy))
4686 (native-inputs
4687 (list postgresql
4688 python-dateutil
4689 python-flexmock
4690 python-psycopg2
4691 python-pytest
4692 python-pytz
4693 python-setuptools
4694 tzdata-for-tests))
4695 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
4696 (synopsis "Various utility functions for SQLAlchemy")
4697 (description
4698 "SQLAlchemy-utils provides various utility functions and custom data types
4699for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
4700
4701You might also want to install the following optional dependencies:
4702@enumerate
4703@item @code{python-passlib}
4704@item @code{python-babel}
4705@item @code{python-cryptography}
4706@item @code{python-pytz}
4707@item @code{python-psycopg2}
4708@item @code{python-furl}
4709@item @code{python-flask-babel}
4710@end enumerate
4711")
4712 (license license:bsd-3)))
4713
4714;; python-alchemy-mock is abandoned, last commit in 2019, no maintained fork.
4715;; Perhaps deprecate and remove with the python-six cleanup.
4716(define-public python-alchemy-mock
4717 (package
4718 (name "python-alchemy-mock")
4719 (version "0.4.3")
4720 (home-page "https://github.com/miki725/alchemy-mock")
4721 (source
4722 (origin
4723 (method git-fetch)
4724 (uri (git-reference
4725 (url "https://github.com/miki725/alchemy-mock")
4726 (commit version)))
4727 (file-name (git-file-name name version))
4728 (sha256
4729 (base32 "053gj8d8ca5kpp7v61wd7lcm9mqp9xqz3d8pp9spdbcjsaqz9nk9"))
4730 (snippet #~(begin
4731 (use-modules (guix build utils))
4732 (substitute* "alchemy_mock/comparison.py"
4733 (("collections\\.Mapping")
4734 "collections.abc.Mapping"))))))
4735 (build-system pyproject-build-system)
4736 (arguments
4737 (list
4738 #:test-flags
4739 #~(list "--doctest-modules" "alchemy_mock")))
4740 (native-inputs (list python-mock python-pytest python-setuptools
4741 python-wheel))
4742 (propagated-inputs (list python-sqlalchemy python-six))
4743 (synopsis "Mock helpers for SQLAlchemy")
4744 (description
4745 "This package provides mock helpers for SQLAlchemy that makes it easy
4746to mock an SQLAlchemy session while preserving the ability to do asserts.
4747
4748Normally Normally SQLAlchemy's expressions cannot be easily compared as
4749comparison on binary expression produces yet another binary expression, but
4750this library provides functions to facilitate such comparisons.")
4751 (license license:expat)))
4752
4753(define-public python-alembic
4754 (package
4755 (name "python-alembic")
4756 (version "1.18.1")
4757 (source
4758 (origin
4759 (method url-fetch)
4760 (uri (pypi-uri "alembic" version))
4761 (sha256
4762 (base32 "0rmq5z30vmv5x5c355mj2whjz1m086c0k4xqndpq35lm6n0npb43"))))
4763 (build-system pyproject-build-system)
4764 (arguments
4765 (list
4766 #:test-flags
4767 #~(list "--ignore=tests/integration")))
4768 (native-inputs
4769 (list python-black ; runs a hook in tests.
4770 python-mock
4771 python-pytest
4772 python-setuptools
4773 python-tzdata))
4774 (propagated-inputs
4775 (list python-mako
4776 python-sqlalchemy-2
4777 python-tomli
4778 python-typing-extensions))
4779 (home-page "https://github.com/sqlalchemy/alembic")
4780 (synopsis "Database migration tool for SQLAlchemy")
4781 (description
4782 "Alembic is a lightweight database migration tool for usage with the
4783SQLAlchemy Database Toolkit for Python.")
4784 (license license:expat)))
4785
4786(define-public python-sqlite-fts4
4787 (package
4788 (name "python-sqlite-fts4")
4789 (version "1.0.3")
4790 (source
4791 (origin
4792 (method git-fetch)
4793 (uri (git-reference
4794 (url "https://github.com/simonw/sqlite-fts4")
4795 (commit version)))
4796 (file-name (git-file-name name version))
4797 (sha256
4798 (base32 "05c69n4nrc9srkbih1q1wxlw6n9mb3dm7ysb47ipqjn3rp1aif11"))))
4799 (build-system pyproject-build-system)
4800 (native-inputs (list python-pytest python-setuptools))
4801 (home-page "https://github.com/simonw/sqlite-fts4")
4802 (synopsis "Python functions for working with SQLite FTS4 search")
4803 (description
4804 "This package provides custom SQLite functions written in Python for
4805ranking documents indexed using the SQLite's FTS4 full text search
4806extension.")
4807 (license license:asl2.0)))
4808
4809(define-public python-sqlite-utils
4810 (package
4811 (name "python-sqlite-utils")
4812 (version "3.38")
4813 (source (origin
4814 (method git-fetch) ;for tests
4815 (uri (git-reference
4816 (url "https://github.com/simonw/sqlite-utils")
4817 (commit version)))
4818 (file-name (git-file-name name version))
4819 (sha256
4820 (base32
4821 "1rai8rbw5drxppypyl3r8j9gr12278h3snkj7l280zkskbxxh7hf"))))
4822 (build-system pyproject-build-system)
4823 (arguments
4824 (list #:phases #~(modify-phases %standard-phases
4825 (add-after 'unpack 'relax-requirements
4826 (lambda _
4827 (substitute* "setup.py"
4828 ;; This is a variant designed to have a binary
4829 ;; wheel made available on PyPI, which is not a
4830 ;; concern to Guix.
4831 (("click-default-group-wheel")
4832 "click-default-group")))))))
4833 (propagated-inputs (list python-click python-click-default-group
4834 python-dateutil python-sqlite-fts4
4835 python-tabulate))
4836 (native-inputs (list python-pytest python-setuptools python-wheel))
4837 (home-page "https://github.com/simonw/sqlite-utils")
4838 (synopsis
4839 "CLI tool and Python utility functions for manipulating SQLite databases")
4840 (description
4841 "This package provides a CLI tool and Python utility functions for
4842manipulating SQLite databases. It's main features are:
4843@itemize
4844@item
4845Pipe JSON (or CSV or TSV) directly into a new SQLite database file,
4846automatically creating a table with the appropriate schema.
4847@item
4848Run in-memory SQL queries, including joins, directly against data in
4849CSV, TSV or JSON files and view the results.
4850@item
4851Configure SQLite full-text search against your database tables and run
4852search queries against them, ordered by relevance.
4853@item
4854Run transformations against your tables to make schema changes that
4855SQLite ALTER TABLE does not directly support, such as changing the type
4856of a column.
4857@item
4858Extract columns into separate tables to better normalize your existing
4859data.
4860@end itemize")
4861 (license license:asl2.0)))
4862
4863(define-public python-pickleshare
4864 (package
4865 (name "python-pickleshare")
4866 (version "0.7.5")
4867 (source
4868 (origin
4869 (method url-fetch)
4870 (uri (pypi-uri "pickleshare" version))
4871 (sha256
4872 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
4873 (build-system pyproject-build-system)
4874 (native-inputs
4875 (list python-pytest
4876 python-setuptools
4877 python-wheel))
4878 (home-page "https://github.com/vivainio/pickleshare")
4879 (synopsis "Tiny key value database with concurrency support")
4880 (description
4881 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
4882Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
4883shelve, many processes can access the database simultaneously. Changing a
4884value in database is immediately visible to other processes accessing the same
4885database. Concurrency is possible because the values are stored in separate
4886files. Hence the “database” is a directory where all files are governed by
4887PickleShare.")
4888 (license license:expat)))
4889
4890(define-public python-apsw
4891 (package
4892 (name "python-apsw")
4893 (version "3.50.4.0")
4894 (source
4895 (origin
4896 (method git-fetch)
4897 (uri (git-reference
4898 (url "https://github.com/rogerbinns/apsw")
4899 (commit version)))
4900 (file-name (git-file-name name version))
4901 (sha256
4902 (base32 "0r9awjgpl9cmqz5xd4zbqrpiv0rv5c36a18jkqnsfky6n6sgr424"))))
4903 (build-system pyproject-build-system)
4904 (arguments
4905 (list #:test-backend #~'custom
4906 #:test-flags #~(list "-m" "apsw.tests")))
4907 (native-inputs
4908 (list python-setuptools))
4909 (inputs
4910 (list sqlite-next)) ;SQLite 3.45.1 required.
4911 (home-page "https://github.com/rogerbinns/apsw/")
4912 (synopsis "Another Python SQLite Wrapper")
4913 (description
4914 "APSW is a Python wrapper for the SQLite embedded relational database
4915engine. In contrast to other wrappers such as pysqlite it focuses on being a
4916minimal layer over SQLite attempting just to translate the complete SQLite API
4917into Python.")
4918 (license license:zlib)))
4919
4920(define-public python-aiosqlite
4921 (package
4922 (name "python-aiosqlite")
4923 (version "0.21.0")
4924 (source
4925 (origin
4926 (method git-fetch)
4927 (uri (git-reference
4928 (url "https://github.com/omnilib/aiosqlite")
4929 (commit (string-append "v" version))))
4930 (file-name (git-file-name name version))
4931 (sha256
4932 (base32 "1njzxi130bbix53wl0gcsvryk1b2cazq0s2701jbkf6nvr3ywpyy"))))
4933 (build-system pyproject-build-system)
4934 (native-inputs (list python-flit-core python-packaging))
4935 (propagated-inputs (list python-typing-extensions))
4936 (home-page "https://github.com/jreese/aiosqlite")
4937 (synopsis "Asyncio bridge for sqlite3")
4938 (description
4939 "The package aiosqlite replicates the standard sqlite3 module, but with
4940async versions of all the standard connection and cursor methods, and context
4941managers for automatically closing connections.")
4942 (license license:expat)))
4943
4944(define-public python-databases
4945 (package
4946 (name "python-databases")
4947 ;; 0.9.0 needs sqlalchemy>=2.0.7
4948 ;; 0.8.0 needs sqlalchemy>=1.4.42,<1.5
4949 (version "0.8.0")
4950 (source
4951 (origin
4952 (method git-fetch)
4953 (uri (git-reference
4954 (url "https://github.com/encode/databases")
4955 (commit version)))
4956 (file-name (git-file-name name version))
4957 (sha256
4958 (base32 "183yawn8w561y1ni117rf5zaxm4gqqbcmi9fp52xd5fx2dj8qy3v"))))
4959 (build-system pyproject-build-system)
4960 (arguments
4961 (list
4962 #:test-flags
4963 ;; These need TEST_DATABASE_URLS set.
4964 ;; TODO: Use "sqlite:///test.db"? See docs/contributing.md.
4965 #~(list "--ignore=tests/test_databases.py"
4966 "--ignore=tests/test_integration.py"
4967 "--ignore=tests/test_connection_options.py")))
4968 (native-inputs
4969 (list python-httpx
4970 python-psycopg
4971 python-pytest
4972 python-setuptools
4973 python-starlette))
4974 (propagated-inputs
4975 (list python-aiosqlite
4976 python-aiopg
4977 python-aiomysql
4978 python-asyncpg
4979 python-asyncmy
4980 python-sqlalchemy))
4981 (home-page "https://github.com/encode/databases")
4982 (synopsis "Asynchronous database abstraction library")
4983 (description "Databases provides a wrapper around asynchronous database
4984libraries with SQLALchemy.")
4985 (license license:bsd-3)))
4986
4987(define-public python-psycopg2
4988 (package
4989 (name "python-psycopg2")
4990 (version "2.9.11")
4991 (source
4992 (origin
4993 (method git-fetch)
4994 (uri (git-reference
4995 (url "https://github.com/psycopg/psycopg2")
4996 (commit version)))
4997 (file-name (git-file-name name version))
4998 (sha256
4999 (base32 "04l2yzbl15nrw1pcjfkqycvqn6h9phcdh1xx9ynfy3dzfscq5ly5"))))
5000 (build-system pyproject-build-system)
5001 (arguments
5002 (list
5003 #:phases
5004 #~(modify-phases %standard-phases
5005 (add-before 'check 'start-postgresql
5006 (lambda* (#:key inputs tests? #:allow-other-keys)
5007 (when tests?
5008 (setenv "TZDIR" (search-input-directory inputs
5009 "share/zoneinfo"))
5010 (let ((dbdir (string-append (getcwd) "/../pgdir")))
5011 (setenv "PSYCOPG2_TESTDB_USER" "nixbld")
5012 (setenv "PSYCOPG2_TESTDB_HOST" dbdir)
5013 (invoke "initdb" "-D" dbdir)
5014 (invoke "pg_ctl" "-D" dbdir
5015 "-o" (string-append "-k " dbdir)
5016 "-l" (string-append dbdir "/db.log")
5017 "start")
5018 (invoke "psql" "-h" dbdir "-d" "postgres"
5019 "-c" "CREATE DATABASE psycopg2_test;"))))))))
5020 (native-inputs
5021 (list postgresql
5022 python-pytest
5023 python-setuptools
5024 tzdata-for-tests))
5025 (inputs
5026 (list postgresql)) ; libpq
5027 (home-page "https://www.psycopg.org/")
5028 (synopsis "Python PostgreSQL adapter")
5029 (description
5030 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
50312.0.")
5032 (license license:lgpl3+)))
5033
5034(define-public python-psycopg-pool
5035 (package
5036 (name "python-psycopg-pool")
5037 ;; The connection pooling code is on a different release cadence
5038 ;; from the driver code, so fetch the latest PyPI release.
5039 (version "3.1.7")
5040 (source (origin
5041 (method url-fetch)
5042 (uri (pypi-uri "psycopg-pool" version))
5043 (sha256
5044 (base32
5045 "1pkx7nj1mhacwpna7ldzqfqxd1xg8826600r0bs9ad1h93f429yh"))))
5046 (build-system pyproject-build-system)
5047 (arguments
5048 (list
5049 #:tests? #f ;run for psycopg below
5050 #:phases
5051 #~(modify-phases %standard-phases
5052 ;; This module requires 'psycopg', however psycopg needs this
5053 ;; for its tests. Disable sanity check to break the cycle.
5054 (delete 'sanity-check))))
5055 (native-inputs (list python-setuptools))
5056 (home-page "https://www.psycopg.org/")
5057 (synopsis "Connection pooler for psycopg")
5058 (description
5059 "This module provides connection pool implementations that can be used
5060with the @code{psycopg} PostgreSQL driver.")
5061 (license license:lgpl3+)))
5062
5063(define-public python-psycopg
5064 (package
5065 (name "python-psycopg")
5066 (version "3.3.4")
5067 (source
5068 (origin
5069 (method git-fetch)
5070 (uri (git-reference
5071 (url "https://github.com/psycopg/psycopg")
5072 (commit version)))
5073 (file-name (git-file-name name version))
5074 (sha256
5075 (base32 "0kp9pig5hv2378zllmb6kmmabydmp98k8qacmm8098cspb0jqy44"))))
5076 (build-system pyproject-build-system)
5077 (arguments
5078 (list
5079 #:test-flags
5080 #~(list "-o" "asyncio_mode=auto"
5081 ;; FIXME: Many of the typing tests are failing,
5082 ;; conveniently tagged as slow...
5083 "-k" "not slow"
5084 ;; Tests are in parent directory due to the chdir.
5085 "..")
5086 #:phases
5087 #~(modify-phases %standard-phases
5088 (add-before 'build 'change-directory
5089 (lambda _ (chdir "psycopg")))
5090 (add-after 'build 'build-c-extensions
5091 (lambda _
5092 (with-directory-excursion "../psycopg_c"
5093 ((assoc-ref %standard-phases 'build)))))
5094 (add-after 'install 'install-c-extensions
5095 (lambda* (#:key inputs outputs #:allow-other-keys)
5096 (with-directory-excursion "../psycopg_c"
5097 ((assoc-ref %standard-phases 'install)
5098 #:inputs inputs #:outputs outputs))))
5099 (add-before 'check 'start-postgresql
5100 (lambda* (#:key inputs tests? #:allow-other-keys)
5101 (when tests?
5102 (setenv "TZDIR" (search-input-directory inputs
5103 "share/zoneinfo"))
5104 (let ((dbdir (string-append (getcwd) "/../pgdir")))
5105 (invoke "initdb" "-D" dbdir)
5106 (invoke "pg_ctl" "-D" dbdir
5107 "-o" (string-append "-k " dbdir)
5108 "-l" (string-append dbdir "/db.log")
5109 "start")
5110 (invoke "psql" "-h" dbdir "-d" "postgres"
5111 "-c" "CREATE DATABASE nixbld;"))))))))
5112 (native-inputs
5113 (list python-cython
5114 python-psycopg-pool
5115 python-pytest
5116 python-pytest-asyncio
5117 python-anyio
5118 python-setuptools
5119 python-tenacity
5120 pproxy
5121 tzdata-for-tests))
5122 (inputs
5123 (list postgresql))
5124 (home-page "https://www.psycopg.org/")
5125 (synopsis "PostgreSQL driver for Python")
5126 (description
5127 "Psycopg 3 is a new implementation of the popular @code{psycopg2}
5128database adapter for Python.")
5129 (license license:lgpl3+)))
5130
5131;; XXX: The latest version is from 2018, source was deleted from
5132;; Bitbucket.org, consider to withdraw if it keeps failing.
5133(define-public python-sadisplay
5134 (package
5135 (name "python-sadisplay")
5136 (version "0.4.9")
5137 (source
5138 (origin
5139 (method url-fetch)
5140 (uri (pypi-uri "sadisplay" version))
5141 (sha256
5142 (base32 "15jxwgla3q4xsp6rw8inqaiy1kdzc8l2cixj8amqcf0ji47icrxg"))))
5143 (build-system pyproject-build-system)
5144 (arguments
5145 (list
5146 #:test-flags
5147 #~(list "--deselect=tests/test_describe.py::test_inherits"
5148 "--deselect=tests/test_describe.py::test_single_mapper")))
5149 (native-inputs
5150 (list python-pytest
5151 python-setuptools
5152 python-wheel))
5153 (propagated-inputs
5154 (list python-sqlalchemy))
5155 (home-page "https://bitbucket.org/estin/sadisplay")
5156 (synopsis "SQLAlchemy schema displayer")
5157 (description
5158 "This package provides a program to build Entity Relationship diagrams
5159from a SQLAlchemy model (or directly from the database).")
5160 (license license:bsd-3)))
5161
5162(define-public yoyo-migrations
5163 (package
5164 (name "yoyo-migrations")
5165 (version "9.0.0")
5166 (source
5167 (origin
5168 (method hg-fetch)
5169 (uri (hg-reference
5170 (url "https://hg.sr.ht/~olly/yoyo")
5171 (changeset (string-append "v" version "-release"))))
5172 (file-name (string-append name "-" version "-checkout"))
5173 (sha256
5174 (base32 "0bn4n043y0n4dh7axwavfims2krap5dcmdaxswbadzmis3a4hxyb"))))
5175 (build-system pyproject-build-system)
5176 (arguments
5177 (list
5178 #:phases
5179 #~(modify-phases %standard-phases
5180 (add-before 'check 'start-postgresql
5181 (lambda* (#:key inputs tests? #:allow-other-keys)
5182 (when tests?
5183 (delete-file "test_databases.ini")
5184 (call-with-output-file "test_databases.ini"
5185 (lambda (port)
5186 (format port "[DEFAULT]
5187postgresql = postgresql://nixbld@/yoyo_test~%")))
5188 (setenv "TZDIR" (search-input-directory inputs
5189 "share/zoneinfo"))
5190 (let ((dbdir (string-append (getcwd) "/../pgdir")))
5191 (setenv "PGHOST" dbdir)
5192 (setenv "PGUSER" "nixbld")
5193 (invoke "initdb" "-D" dbdir)
5194 (invoke "pg_ctl" "-D" dbdir
5195 "-o" (string-append "-k " dbdir)
5196 "-l" (string-append dbdir "/db.log")
5197 "start")
5198 (invoke "psql" "-h" dbdir "-d" "postgres"
5199 "-c" "CREATE DATABASE yoyo_test;"))))))))
5200 (native-inputs
5201 (list postgresql
5202 python-freezegun
5203 python-psycopg2
5204 python-pytest
5205 python-setuptools
5206 tms
5207 tzdata-for-tests))
5208 (propagated-inputs
5209 (list python-sqlparse python-tabulate python-importlib-metadata))
5210 (home-page "https://ollycope.com/software/yoyo/latest/")
5211 (synopsis "Database migrations with SQL")
5212 (description
5213 "Yoyo is a database schema migration tool. Migrations are written as SQL
5214files or Python scripts that define a list of migration steps.")
5215 (license license:asl2.0)))
5216
5217(define-public mutastructura
5218 (package
5219 (name "mutastructura")
5220 (version "0.7.1")
5221 (source
5222 (origin
5223 (method git-fetch)
5224 (uri (git-reference
5225 (url "https://codeberg.org/jjba23/mutastructura")
5226 (commit (string-append "v" version))))
5227 (file-name (git-file-name name version))
5228 (sha256
5229 (base32 "0rzy7clbzc580xp1mk2qwqv29lq2xn8sfr9lv1rdczk5fj55m4d6"))))
5230 (build-system guile-build-system)
5231 (arguments
5232 (list
5233 #:source-directory "src"
5234 #:modules '((guix build guile-build-system)
5235 (guix build utils)
5236 (ice-9 match))
5237 #:phases
5238 #~(modify-phases %standard-phases
5239 (add-before 'build 'install-program-files
5240 (lambda _
5241 (let* ((bin (string-append #$output "/bin"))
5242 (share (string-append #$output "/share")))
5243 (copy-recursively "resources"
5244 (string-append share "/resources"))
5245 (install-file "scripts/mutastructura" bin)
5246 (chmod (string-append bin "/mutastructura") #o755))))
5247 (add-after 'unpack 'fix-paths
5248 (lambda* (#:key inputs #:allow-other-keys)
5249 (for-each (match-lambda
5250 ((pattern program format-string)
5251 (substitute* "scripts/mutastructura"
5252 ((pattern)
5253 (format #f format-string
5254 (search-input-file inputs
5255 (string-append "bin/"
5256 program)))))))
5257 '(("readlink -f " "readlink" "~s -f ")
5258 ("realpath " "realpath" "~s ")
5259 ("dirname " "dirname" "~s ")
5260 ("getopt " "getopt" "~s ")
5261 ("exec guile " "guile" "exec ~s "))))))))
5262 (propagated-inputs (list guile-dbi
5263 guile-dbd-mysql
5264 guile-dbd-sqlite3
5265 guile-dbd-postgresql
5266 guile-gcrypt))
5267 (inputs (list guile-3.0 bash-minimal coreutils util-linux))
5268 (home-page "https://codeberg.org/jjba23/mutastructura")
5269 (synopsis "Relational database schema migrations powered by Guile Scheme")
5270 (description
5271 "Mutastructura provides a familiar, declarative and transactional
5272approach to managing database states. It exposes a user-friendly
5273@acronym{CLI, command-line interface} and has support for PostgreSQL, MySQL, and SQLite.
5274It also exposes library functions and can be imported and used directly from other Guile code.
5275
5276Features include executing migrations transactionally and computing SHA256
5277checksums to track schema evolution in a @code{migrations_history} table.")
5278 (license license:agpl3+)))
5279
5280(define-public python-mysqlclient
5281 (package
5282 (name "python-mysqlclient")
5283 (version "2.2.7")
5284 (source
5285 (origin
5286 (method url-fetch)
5287 (uri (pypi-uri "mysqlclient" version))
5288 (sha256
5289 (base32 "0i9q2vj6rb4w2iggk0mcp9jla2rm91sx7jcrgv7grm8njjsj5bi4"))))
5290 (build-system pyproject-build-system)
5291 (arguments
5292 (list #:test-flags
5293 #~'("tests/test__mysql.py" ;tests not needing a live db
5294 "tests/test_MySQLdb_times.py")))
5295 (native-inputs
5296 (list pkg-config python-pytest python-setuptools python-wheel))
5297 (inputs (list mariadb-connector-c))
5298 (home-page "https://github.com/PyMySQL/mysqlclient")
5299 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
5300 (description "MySQLdb is an interface to the popular MySQL database server
5301for Python. The design goals are:
5302@enumerate
5303@item Compliance with Python database API version 2.0 [PEP-0249],
5304@item Thread-safety,
5305@item Thread-friendliness (threads will not block each other).
5306@end enumerate")
5307 (license license:gpl2)))
5308
5309(define-public python-hiredis
5310 (package
5311 (name "python-hiredis")
5312 (version "3.1.0")
5313 (source (origin
5314 (method git-fetch) ;for tests
5315 (uri (git-reference
5316 (url "https://github.com/redis/hiredis-py")
5317 (commit (string-append "v" version))))
5318 (file-name (git-file-name name version))
5319 (sha256
5320 (base32
5321 "1g9qj37phq9989av0bwkqy40f5wx9q08y19dsmzwd1ssqsxwhfav"))
5322 (patches
5323 (search-patches "python-hiredis-use-system-hiredis.patch"))))
5324 (build-system pyproject-build-system)
5325 (native-inputs (list python-pytest python-setuptools python-wheel))
5326 (inputs (list hiredis))
5327 (home-page "https://github.com/redis/hiredis-py")
5328 (synopsis "Python extension that wraps protocol parsing code in hiredis")
5329 (description "Python-hiredis is a python extension that wraps protocol
5330parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
5331 (license license:bsd-3)))
5332
5333(define-public python-fakeredis
5334 (package
5335 (name "python-fakeredis")
5336 (version "2.33.0")
5337 (source
5338 (origin
5339 (method git-fetch)
5340 (uri (git-reference
5341 (url "https://github.com/cunla/fakeredis-py")
5342 (commit (string-append "v" version))))
5343 (file-name (git-file-name name version))
5344 (sha256
5345 (base32 "02zi7dl4dm90z4aiadq8bba4vjhrpj8ns34ziazqcxlm72pyzxms"))))
5346 (build-system pyproject-build-system)
5347 (arguments
5348 (list
5349 ;; tests: 2652 passed, 319 skipped, 194 deselected, 24 warnings
5350 #:test-flags
5351 #~(list "-m" "not slow"
5352 "-k" (string-join
5353 ;; redis.exceptions.ResponseError: unknown command
5354 ;; 'evalsha', with args beginning with:
5355 (list "not test_async_lock[fake_resp2]"
5356 "test_async_lock[fake_resp3]"
5357 ;; AssertionError: Commands not found in category
5358 ;; b'write'...
5359 "test_acl_cat[StrictRedis2]"
5360 "test_acl_cat[StrictRedis3]")
5361 " and not "))
5362 #:phases
5363 #~(modify-phases %standard-phases
5364 ;; Tests require a running Redis server.
5365 (add-before 'check 'start-redis
5366 (lambda* (#:key tests? #:allow-other-keys)
5367 (when tests?
5368 (invoke "redis-server" "--daemonize" "yes"
5369 "--port" "6390")))))))
5370 (native-inputs
5371 (list python-hatchling
5372 python-pytest
5373 python-pytest-asyncio
5374 python-pytest-mock
5375 redis))
5376 (propagated-inputs
5377 (list python-redis
5378 python-sortedcontainers
5379 python-valkey))
5380 (home-page "https://github.com/cunla/fakeredis-py")
5381 (synopsis "Fake implementation of redis API for testing purposes")
5382 (description
5383 "Fakeredis is a pure-Python implementation of the redis-py Python client
5384that simulates talking to a redis server. It was created for a single purpose:
5385to write unit tests.
5386
5387Setting up redis is not hard, but one often wants to write unit tests that don't
5388talk to an external server such as redis. This module can be used as a
5389reasonable substitute.")
5390 (license license:bsd-3)))
5391
5392(define-public python-redis
5393 (package
5394 (name "python-redis")
5395 (version "7.1.0")
5396 (source
5397 (origin
5398 (method git-fetch)
5399 (uri (git-reference
5400 (url "https://github.com/redis/redis-py")
5401 (commit (string-append "v" version))))
5402 (file-name (git-file-name name version))
5403 (sha256
5404 (base32 "0c2794r5xcqdqaqr1vr3ibi6lb5rvxg002ichjb42xhlbpd4860j"))))
5405 (build-system pyproject-build-system)
5406 (arguments
5407 (list
5408 #:test-flags
5409 #~(list
5410 ;; These tests are disabled in the official CI run (see:
5411 ;; https://raw.githubusercontent.com/redis/redis-py/master/
5412 ;; .github/workflows/install_and_test.sh).
5413 "-m" "not onlycluster and not redismod and not ssl"
5414 "--ignore=tests/test_scenario"
5415 "--ignore=tests/test_asyncio/test_scenario"
5416 ;; XXX: Those tests require the unpackaged "pybreaker".
5417 "--ignore=tests/test_multidb"
5418 "--ignore=tests/test_asyncio/test_multidb"
5419 ;; XXX: Those tests require the unpackaged "redis_entraid".
5420 "--ignore=tests/test_credentials.py"
5421 "--ignore=tests/test_asyncio/test_credentials.py"
5422 ;; XXX: Those test fail with ConnectionError.
5423 "--ignore=tests/test_sentinel.py"
5424 "--ignore=tests/test_asyncio/test_sentinel.py"
5425 "--deselect=tests/test_commands.py::TestRedisCommands::test_psync"
5426 "--deselect=tests/test_commands.py::TestRedisCommands::\
5427test_xgroup_create_entriesread")
5428 #:phases
5429 #~(modify-phases %standard-phases
5430 (add-after 'unpack 'relax-coverage-requirements
5431 (lambda _
5432 (substitute* "pyproject.toml"
5433 ((".*coverage.*") ""))))
5434 ;; Tests require a running Redis server.
5435 (add-before 'check 'start-redis
5436 (lambda* (#:key tests? #:allow-other-keys)
5437 (when tests?
5438 (invoke "redis-server" "--daemonize" "yes"
5439 "--enable-debug-command" "yes"
5440 "--enable-module-command" "local")))))))
5441 (native-inputs
5442 (list python-hatchling
5443 python-mock
5444 python-numpy
5445 python-pytest
5446 python-pytest-asyncio
5447 python-pytest-timeout
5448 redis))
5449 (propagated-inputs
5450 (list python-async-timeout))
5451 (home-page "https://github.com/redis/redis-py")
5452 (synopsis "Redis Python client")
5453 (description
5454 "This package provides a Python interface to the Redis key-value store.")
5455 (license license:expat)))
5456
5457(define-public python-rq
5458 (package
5459 (name "python-rq")
5460 (version "2.6.1")
5461 (source
5462 (origin
5463 (method git-fetch)
5464 (uri (git-reference
5465 (url "https://github.com/rq/rq")
5466 (commit (string-append "v" version))))
5467 (file-name (git-file-name name version))
5468 (sha256
5469 (base32 "0n2bn9awd3sbl9bkz0h7y8c356w0n7fdhifzfvzylrx2jggczv73"))))
5470 (build-system pyproject-build-system)
5471 (arguments
5472 (list
5473 ;; tests: 520 passed, 16 skipped, 76 warnings
5474 #:phases #~(modify-phases %standard-phases
5475 (add-before 'check 'start-redis
5476 (lambda _
5477 (invoke "redis-server" "--daemonize" "yes"))))))
5478 (native-inputs
5479 (list python-hatchling
5480 python-mock
5481 python-psutil
5482 python-pytest
5483 redis))
5484 (propagated-inputs
5485 (list python-click
5486 python-croniter
5487 python-redis))
5488 (home-page "https://python-rq.org/")
5489 (synopsis "Simple job queues for Python")
5490 (description
5491 "RQ (Redis Queue) is a simple Python library for queueing jobs and
5492processing them in the background with workers. It is backed by Redis and it
5493is designed to have a low barrier to entry.")
5494 (license license:bsd-2)))
5495
5496(define-public python-rq-scheduler
5497 (package
5498 (name "python-rq-scheduler")
5499 (version "0.14")
5500 (source
5501 (origin
5502 (method git-fetch)
5503 (uri (git-reference
5504 (url "https://github.com/rq/rq-scheduler")
5505 (commit (string-append "v" version))))
5506 (file-name (git-file-name name version))
5507 (sha256
5508 (base32 "09fh9m2vcl1jndq35xp1x0j8ih009r71qmhn2pkl93fykrqfavyn"))))
5509 (build-system pyproject-build-system)
5510 (arguments
5511 (list
5512 ;; tests: 60 passed, 15 deselected, 12 warnings
5513 #:test-flags
5514 #~(list #$@(map (lambda (test) (string-append "--deselect="
5515 "tests/test_scheduler.py"
5516 "::TestScheduler::"
5517 test))
5518 ;; OSError: Read crontab <...>: mcron: Only root can use
5519 ;; the -u option.
5520 (list "test_cron_sets_default_result_ttl_to_minus_1"
5521 "test_cron_sets_default_ttl_to_none"
5522 "test_cron_sets_provided_result_ttl"
5523 "test_cron_sets_provided_ttl"
5524 "test_crontab_persisted_correctly"
5525 "test_crontab_persisted_correctly_with_local_timezone"
5526 "test_crontab_rescheduled_correctly_with_local_timezone"
5527 "test_crontab_schedules_correctly"
5528 "test_crontab_sets_default_result_ttl"
5529 "test_crontab_sets_description"
5530 "test_crontab_sets_id"
5531 "test_crontab_sets_timeout"
5532 "test_job_with_crontab_get_rescheduled"))
5533 #$@(map (lambda (test) (string-append "--deselect="
5534 "tests/test_callbacks.py"
5535 "::JobCallbackTestCase::"
5536 test))
5537 ;; AssertionError: <object object at 0x7ffff7599c10> !=
5538 ;; None
5539 (list "test_job_creation_with_failure_callback"
5540 "test_job_creation_with_success_callback")))
5541 #:phases
5542 #~(modify-phases %standard-phases
5543 (add-before 'check 'start-redis
5544 (lambda _
5545 (invoke "redis-server" "--daemonize" "yes")))
5546 (add-after 'unpack 'loosen-requirements
5547 (lambda _
5548 ;; crontab package is python_crontab in PyPI.
5549 (substitute* "setup.py"
5550 (("crontab>=[0-9.]*")
5551 "python-crontab")))))))
5552 (native-inputs
5553 (list python-pytest
5554 python-setuptools
5555 redis))
5556 (propagated-inputs
5557 (list python-crontab
5558 python-freezegun
5559 python-dateutil
5560 python-rq))
5561 (home-page "https://github.com/rq/rq-scheduler")
5562 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
5563 (description
5564 "This package provides job scheduling capabilities to @code{python-rq}
5565(Redis Queue).")
5566 (license license:expat)))
5567
5568(define-public python-sqlmodel
5569 (package
5570 (name "python-sqlmodel")
5571 (version "0.0.37")
5572 (source
5573 (origin
5574 (method git-fetch)
5575 (uri (git-reference
5576 (url "https://github.com/fastapi/sqlmodel")
5577 (commit version)))
5578 (file-name (git-file-name name version))
5579 (sha256
5580 (base32 "1kb81a1ffvsvkvi9msblv3sq0s74ww340dxz3rymh5snnxc1pg92"))))
5581 (build-system pyproject-build-system)
5582 (arguments
5583 (list
5584 #:test-flags
5585 ;; Ignore optional tests.
5586 #~(list "--ignore=docs_src"
5587 "--ignore=tests/test_tutorial"
5588 ;; Unclear why this test fails.
5589 "-k" "not test_select_gen")))
5590 (propagated-inputs
5591 (list python-pydantic
5592 python-sqlalchemy-2
5593 python-typing-extensions))
5594 (native-inputs
5595 (list python-dirty-equals
5596 python-pdm-backend
5597 python-pytest))
5598 (home-page "https://github.com/fastapi/sqlmodel")
5599 (synopsis "SQLModel, SQL databases in Python, designed")
5600 (description
5601 "SQLModel is a library for interacting with SQL databases from
5602Python code, with Python objects. It is based on Python type
5603annotations, and powered by Pydantic and SQLAlchemy.")
5604 (license license:expat)))
5605
5606(define-public python-sqlparse
5607 (package
5608 (name "python-sqlparse")
5609 (version "0.5.5")
5610 (source
5611 (origin
5612 (method url-fetch)
5613 (uri (pypi-uri "sqlparse" version))
5614 (sha256
5615 (base32 "13pj7ylwm8w35nd8hz64grx5sk69qxk01lqh7gvgv1c51fdll3g2"))))
5616 (build-system pyproject-build-system)
5617 (native-inputs
5618 (list python-pytest
5619 python-hatchling))
5620 (home-page "https://github.com/andialbrecht/sqlparse")
5621 (synopsis "Non-validating SQL parser")
5622 (description "Sqlparse is a non-validating SQL parser for Python. It
5623provides support for parsing, splitting and formatting SQL statements.")
5624 (license license:bsd-3)
5625 (properties '((cpe-name . "sqlparse")))))
5626
5627(define-public python-sql
5628 (package
5629 (name "python-sql")
5630 (version "1.7.0")
5631 (source
5632 (origin
5633 (method url-fetch)
5634 (uri (pypi-uri "python_sql" version))
5635 (sha256
5636 (base32 "09niqspjmsn9wyqadgqjcrsxxa7w4r6dcp21xhi1mimr4ya0p5ky"))))
5637 (build-system pyproject-build-system)
5638 (native-inputs (list python-pytest python-setuptools))
5639 (home-page "https://python-sql.tryton.org/")
5640 (synopsis "Library to write SQL queries in a pythonic way")
5641 (description "@code{python-sql} is a library to write SQL queries, that
5642transforms idiomatic python function calls to well-formed SQL queries.")
5643 (license license:bsd-3)))
5644
5645(define-public python-pypika
5646 (package
5647 (name "python-pypika")
5648 (version "0.49.0")
5649 (source
5650 (origin
5651 (method git-fetch)
5652 (uri (git-reference
5653 (url "https://github.com/kayak/pypika")
5654 (commit (string-append "v" version))))
5655 (file-name (git-file-name name version))
5656 (sha256
5657 (base32 "0nxm2cxq9sx43g57qxw7kzy8lsl5svq659r3mhxpa9vcbxrjrb1d"))))
5658 (build-system pyproject-build-system)
5659 (native-inputs
5660 (list python-parameterized
5661 python-pytest
5662 python-setuptools))
5663 (home-page "https://github.com/kayak/pypika")
5664 (synopsis "SQL query builder API for Python")
5665 (description
5666 "PyPika is a python SQL query builder that exposes the full richness of
5667the SQL language using a syntax that reflects the resulting query.")
5668 (license license:asl2.0)))
5669
5670(define-public apache-orc
5671 (package
5672 (name "apache-orc")
5673 (version "2.0.0")
5674 (source
5675 (origin
5676 (method git-fetch)
5677 (uri (git-reference
5678 (url "https://github.com/apache/orc")
5679 (commit (string-append "v" version))))
5680 (file-name (git-file-name name version))
5681 (sha256
5682 (base32
5683 "1fi6d045wakks0x8clplyxgal342kljqjql7vq5gbd6a2qnaz6m2"))))
5684 (build-system cmake-build-system)
5685 (arguments
5686 (list
5687 ;; XXX: Some tests fail on i686, run on 64bit only for now.
5688 #:tests? (target-64bit?)
5689 #:build-type "Release"
5690 #:configure-flags
5691 #~(list "-DBUILD_JAVA=OFF"
5692 "-DINSTALL_VENDORED_LIBS=OFF"
5693 "-DCMAKE_CXX_FLAGS=-fPIC"
5694 (string-append "-DGTEST_HOME=" #$(this-package-native-input "googletest"))
5695 (string-append "-DZSTD_HOME=" (assoc-ref %build-inputs "zstd:lib"))
5696 (string-append "-DZLIB_HOME=" #$(this-package-input "zlib"))
5697 (string-append "-DPROTOBUF_HOME=" #$(this-package-input "protobuf"))
5698 (string-append "-DLZ4_HOME=" #$(this-package-input "lz4"))
5699 (string-append "-DSNAPPY_HOME=" #$(this-package-input "snappy")))
5700 #:phases
5701 #~(modify-phases %standard-phases
5702 (add-after 'unpack 'disable-bad-test
5703 (lambda _
5704 ;; This one test fails with an obscure error:
5705 ;;
5706 ;; Expected: (std::string::npos) != (error.find(error_msg)),
5707 ;; actual: 18446744073709551615 vs 18446744073709551615
5708 (substitute* "tools/test/TestFileScan.cc"
5709 (("findProgram\\(\"tools/src/orc-scan\"\\);" m)
5710 (string-append m "return;")))))
5711 (add-after 'unpack 'do-not-download-orc-format
5712 (lambda _
5713 (substitute* "cmake_modules/ThirdpartyToolchain.cmake"
5714 (("URL \"https://archive.apache.org/dist/orc/orc-format.*")
5715 (string-append "URL \"file://"
5716 #$(this-package-native-input "orc-format")
5717 "\"\n")))))
5718 (add-after 'unpack 'timezone-fallback
5719 (lambda _
5720 ;; In the build container we don't have /etc/localtime
5721 (substitute* "c++/src/Timezone.cc"
5722 (("return getTimezoneByFilename\\(LOCAL_TIMEZONE\\);")
5723 "if (!std::filesystem::exists(std::filesystem::path(LOCAL_TIMEZONE))) {
5724 return getTimezoneByName(\"UTC\");
5725}
5726return getTimezoneByFilename(LOCAL_TIMEZONE);"))))
5727 (add-before 'check 'pre-check
5728 (lambda* (#:key inputs #:allow-other-keys)
5729 (setenv "TZDIR" (search-input-directory inputs
5730 "share/zoneinfo")))))))
5731 (inputs
5732 `(("lz4" ,lz4)
5733 ("protobuf" ,protobuf)
5734 ("snappy" ,snappy)
5735 ("zlib" ,zlib "static")
5736 ("zstd" ,zstd)
5737 ("zstd:lib" ,zstd "lib")))
5738 (native-inputs
5739 `(("googletest" ,googletest)
5740 ("orc-format" ,(origin
5741 (method url-fetch)
5742 (uri "https://archive.apache.org/dist/orc/orc-format-1.0.0/\
5743orc-format-1.0.0.tar.gz")
5744 (sha256
5745 (base32
5746 "1mccbna3mqhhlqs4pw0fa4pgjnq4c41jhxrh84mq27sbz5gsx7vk"))))
5747 ("pkg-config" ,pkg-config)
5748 ("tzdata" ,tzdata-for-tests)))
5749 (home-page "https://orc.apache.org/")
5750 (synopsis "Columnar storage for Hadoop workloads")
5751 (description "ORC is a self-describing type-aware columnar file format
5752designed for Hadoop workloads. It is optimized for large streaming reads, but
5753with integrated support for finding required rows quickly.")
5754 (license license:asl2.0)))
5755
5756;; There are many wrappers for this in other languages. When touching, please
5757;; be sure to ensure all dependencies continue to build.
5758(define-public apache-arrow
5759 (package
5760 (name "apache-arrow")
5761 (version "24.0.0")
5762 (source
5763 (origin
5764 (method git-fetch)
5765 (uri (git-reference
5766 (url "https://github.com/apache/arrow")
5767 (commit (string-append "apache-arrow-" version))))
5768 (file-name (git-file-name name version))
5769 (sha256
5770 (base32
5771 "1j3gs5ffa9gx2y2nggmi2zn5rj0bsnjnxrzfnipx6050jz6n8dx9"))))
5772 (build-system cmake-build-system)
5773 (arguments
5774 (list
5775 #:tests? #f
5776 #:phases
5777 #~(modify-phases %standard-phases
5778 (add-before 'configure 'enter-source-directory
5779 (lambda _ (chdir "cpp")))
5780 (add-after 'unpack 'set-env
5781 (lambda* (#:key inputs #:allow-other-keys)
5782 (substitute* "cpp/cmake_modules/ThirdpartyToolchain.cmake"
5783 (("set\\(xsimd_SOURCE.*") ""))
5784 (setenv "BOOST_ROOT" #$(this-package-input "boost"))
5785 (setenv "BROTLI_HOME" #$(this-package-input "brotli"))
5786 (setenv "FLATBUFFERS_HOME" #$(this-package-input "flatbuffers"))
5787 (setenv "RAPIDJSON_HOME" #$(this-package-input "rapidjson")))))
5788 #:build-type "Release"
5789 #:configure-flags
5790 #~(list "-DARROW_PYTHON=ON"
5791 ;; Parquet options
5792 "-DARROW_PARQUET=ON"
5793 "-DPARQUET_BUILD_EXECUTABLES=ON"
5794 ;; The maintainers disallow using system versions of
5795 ;; jemalloc:
5796 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
5797 ;; is unfortunate because jemalloc increases performance:
5798 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
5799 "-DARROW_JEMALLOC=OFF"
5800 ;; System mimalloc is not suported and must be bundled:
5801 ;; https://github.com/apache/arrow/issues/42211.
5802 "-DARROW_MIMALLOC=OFF"
5803
5804 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
5805 ;; option that instructs the build system how to resolve
5806 ;; each dependency. SYSTEM = Finding the dependency in
5807 ;; system paths using CMake's built-in find_package
5808 ;; function, or using pkg-config for packages that do not
5809 ;; have this feature
5810 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
5811 "-Dxsimd_SOURCE=SYSTEM"
5812
5813 "-DARROW_RUNTIME_SIMD_LEVEL=NONE"
5814 "-DARROW_SIMD_LEVEL=NONE"
5815 "-DARROW_PACKAGE_KIND=Guix"
5816
5817 ;; Split output into its component packages.
5818 (string-append "-DCMAKE_INSTALL_PREFIX=" #$output:lib)
5819 (string-append "-DCMAKE_INSTALL_RPATH=" #$output:lib "/lib")
5820 (string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin")
5821 (string-append "-DCMAKE_INSTALL_INCLUDEDIR=" #$output:include
5822 "/share/include")
5823
5824 "-DARROW_WITH_SNAPPY=ON"
5825 "-DARROW_WITH_ZLIB=ON"
5826 "-DARROW_WITH_ZSTD=ON"
5827 "-DARROW_WITH_LZ4=ON"
5828 "-DARROW_COMPUTE=ON"
5829 "-DARROW_CSV=ON"
5830 "-DARROW_DATASET=ON"
5831 "-DARROW_FILESYSTEM=ON"
5832 "-DARROW_HDFS=ON"
5833 "-DARROW_JSON=ON"
5834 ;; Arrow Python C++ integration library (required for
5835 ;; building pyarrow). This library must be built against
5836 ;; the same Python version for which you are building
5837 ;; pyarrow. NumPy must also be installed. Enabling this
5838 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
5839 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
5840 ;; ARROW_JSON.
5841 "-DARROW_PYTHON=ON"
5842 "-DARROW_ORC=ON"
5843 "-DORC_SOURCE=SYSTEM"
5844
5845 ;; Building the tests forces on all the
5846 ;; optional features and the use of static
5847 ;; libraries.
5848 "-DARROW_BUILD_TESTS=OFF"
5849 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
5850 "-DARROW_BUILD_STATIC=OFF")))
5851 (inputs
5852 (list apache-orc
5853 boost
5854 brotli
5855 bzip2
5856 double-conversion
5857 gflags
5858 glog
5859 grpc
5860 protobuf
5861 python
5862 python-numpy
5863 rapidjson
5864 re2
5865 snappy
5866 xsimd))
5867 ;; These are all listed under Requires.private in arrow.pc
5868 (propagated-inputs
5869 (list `(,apache-thrift "lib") lz4 utf8proc zlib
5870 `(,zstd "lib")))
5871 (native-inputs
5872 (list pkg-config))
5873 (outputs '("out" "lib" "include"))
5874 (home-page "https://arrow.apache.org/")
5875 (synopsis "Columnar in-memory analytics")
5876 (description "Apache Arrow is a columnar in-memory analytics layer
5877designed to accelerate big data. It houses a set of canonical in-memory
5878representations of flat and hierarchical data along with multiple
5879language-bindings for structure manipulation. It also provides IPC and common
5880algorithm implementations.")
5881 (license license:asl2.0)))
5882
5883(define-public python-pyarrow
5884 (package
5885 (inherit apache-arrow)
5886 (name "python-pyarrow")
5887 (build-system pyproject-build-system)
5888 (arguments
5889 (list
5890 ;; XXX: Test data is distributed separately in
5891 ;; <https://github.com/apache/arrow-testing> 39MiB and requires
5892 ;; additional steps to be implemented, see
5893 ;; <https://github.com/apache/arrow/blob/main/ci/scripts/python_build.sh>.
5894 #:tests? #f
5895 #:phases
5896 #~(modify-phases %standard-phases
5897 (add-after 'unpack 'enter-source-directory
5898 (lambda _ (chdir "python")))
5899 (add-before 'install 'set-pyarrow-build-options
5900 (lambda _
5901 (setenv "PYARROW_BUNDLE_ARROW_CPP_HEADERS" "0")
5902 (setenv "PYARROW_CMAKE_OPTIONS"
5903 (string-append "-DCMAKE_INSTALL_RPATH=" #$output))
5904 (setenv "PYARROW_PARALLEL"
5905 ;; XXX: It's a build host specific option and needs to
5906 ;; be tunable.
5907 (number->string (parallel-job-count)))
5908 (setenv "PYARROW_WITH_DATASET" "1")
5909 (setenv "PYARROW_WITH_HDFS" "1")
5910 (setenv "PYARROW_WITH_ORC" "1")
5911 (setenv "PYARROW_WITH_PARQUET" "1"))))))
5912 (propagated-inputs
5913 (list (list apache-arrow "lib")
5914 (list apache-arrow "include")
5915 apache-orc
5916 python-numpy
5917 python-pandas))
5918 (native-inputs
5919 (list pkg-config
5920 python-cython
5921 python-pytest
5922 python-scikit-build-core
5923 python-setuptools-scm
5924 python-setuptools))
5925 (outputs '("out"))
5926 (home-page "https://arrow.apache.org/docs/python/")
5927 (synopsis "Python bindings for Apache Arrow")
5928 (description
5929 "This library provides a Pythonic API wrapper for the reference Arrow C++
5930implementation, along with tools for interoperability with pandas, NumPy, and
5931other traditional Python scientific computing packages.")
5932 (license license:asl2.0)))
5933
5934(define-public python-fastparquet
5935 (package
5936 (name "python-fastparquet")
5937 (version "2026.5.0")
5938 (source
5939 (origin
5940 (method git-fetch)
5941 (uri (git-reference
5942 (url "https://github.com/dask/fastparquet")
5943 (commit version)))
5944 (file-name (git-file-name name version))
5945 (sha256
5946 (base32 "1x7c25pqrishmskc2k56yh15af4fmsqj4gwxf33d26p2flqyh6xn"))))
5947 (build-system pyproject-build-system)
5948 (arguments
5949 (list
5950 ;; tests: 362 passed, 123 skipped, 15 xfailed, 6 xpassed, 2 warnings
5951 #:test-flags
5952 #~(list "--numprocesses" (number->string (parallel-job-count)))
5953 #:phases
5954 #~(modify-phases %standard-phases
5955 (add-after 'unpack 'remove-dependencies-on-git
5956 (lambda _
5957 (substitute* "setup.py"
5958 (("^.*\"git\", \"status\".*$") ""))))
5959 (add-before 'check 'remove-local-source
5960 (lambda _
5961 (copy-recursively "fastparquet/test" "test")
5962 (delete-file-recursively "fastparquet"))))))
5963 (native-inputs
5964 (list python-cython
5965 python-pytest
5966 python-pytest-xdist
5967 python-setuptools
5968 python-setuptools-scm
5969 tzdata-for-tests))
5970 (propagated-inputs
5971 (list python-cramjam
5972 python-fsspec
5973 python-numpy
5974 python-packaging
5975 python-pandas))
5976 (home-page "https://github.com/dask/fastparquet")
5977 (synopsis "Python implementation of the Parquet file format")
5978 (description
5979 "@code{fastparquet} is a Python implementation of the Parquet file
5980format. @code{fastparquet} is used implicitly by @code{dask}, @code{pandas}
5981and @code{intake-parquet}. It supports the following compression algorithms:
5982
5983@itemize
5984@item Gzip
5985@item Snappy
5986@item Brotli
5987@item LZ4
5988@item Zstd
5989@item LZO (optionally)
5990@end itemize")
5991 (license license:asl2.0)))
5992
5993(define-public python-crate
5994 (package
5995 (name "python-crate")
5996 (version "2.2.1")
5997 (source
5998 (origin
5999 (method git-fetch)
6000 (uri (git-reference
6001 (url "https://github.com/crate/crate-python")
6002 (commit version)))
6003 (file-name (git-file-name name version))
6004 (sha256
6005 (base32 "05yiigpd8kfrms4d369gmp3xiv16l4ajr664rhv0fzc7yy6qv7i7"))))
6006 (build-system pyproject-build-system)
6007 (arguments
6008 (list
6009 ;; tests: 107 passed, 8 deselected
6010 #:test-flags
6011 #~(list "--deselect=tests/test_docs.py::test_docs"
6012 #$@(map (lambda (test) (string-append "--deselect=tests/"
6013 "testing/test_layer.py"
6014 "::LayerTest"
6015 test))
6016 (list "::test_additional_settings"
6017 "::test_basic"
6018 "::test_cluster"
6019 "::test_default_settings"
6020 "::test_dynamic_http_port"
6021 "::test_environment_variables"
6022 "::test_verbosity")))
6023 #:phases
6024 #~(modify-phases %standard-phases
6025 (add-after 'unpack 'set-version
6026 ;; versioningit needs git tags; patch pyproject.toml to use static
6027 ;; version and create _version.py directly.
6028 (lambda _
6029 (substitute* "pyproject.toml"
6030 (("source = \"versioningit\"")
6031 "
6032path = \"src/crate/_version.py\"")
6033 ((", \"versioningit\"")
6034 ""))
6035 (call-with-output-file "src/crate/_version.py"
6036 (lambda (port)
6037 (format port "__version__ = \"~a\"~%" #$version))))))))
6038 (native-inputs
6039 (list python-hatchling
6040 python-pytest
6041 python-pytz
6042 tzdata-for-tests))
6043 (propagated-inputs
6044 (list python-orjson
6045 python-urllib3
6046 python-verlib2))
6047 (home-page "https://github.com/crate/crate-python")
6048 (synopsis "CrateDB Python client")
6049 (description
6050 "This package provides a Python client library for CrateDB.
6051It implements the Python DB API 2.0 specification and includes support for
6052SQLAlchemy.")
6053 (license license:asl2.0)))
6054
6055(define-public libdbi
6056 (package
6057 (name "libdbi")
6058 (version "0.9.0")
6059 (source (origin
6060 (method url-fetch)
6061 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
6062 version "/libdbi-" version ".tar.gz"))
6063 (sha256
6064 (base32
6065 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
6066 (build-system gnu-build-system)
6067 (synopsis "Database independent abstraction layer in C")
6068 (description
6069 "This library implements a database independent abstraction layer in C,
6070similar to the DBI/DBD layer in Perl. Writing one generic set of code,
6071programmers can leverage the power of multiple databases and multiple
6072simultaneous database connections by using this framework.")
6073 (home-page "https://libdbi.sourceforge.net/")
6074 (license license:lgpl2.1+)))
6075
6076(define-public libdbi-drivers
6077 (package
6078 (name "libdbi-drivers")
6079 (version "0.9.0")
6080 (source (origin
6081 (method url-fetch)
6082 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
6083 "libdbi-drivers/libdbi-drivers-" version
6084 "/libdbi-drivers-" version ".tar.gz"))
6085 (sha256
6086 (base32
6087 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
6088 (build-system gnu-build-system)
6089 (native-inputs
6090 (list ;; For tests.
6091 inetutils
6092 (libc-utf8-locales-for-target (%current-system))
6093 mariadb))
6094 (inputs
6095 `(("libdbi" ,libdbi)
6096 ("mariadb:dev" ,mariadb "dev")
6097 ("mariadb:lib" ,mariadb "lib")
6098 ("postgresql" ,postgresql)
6099 ("sqlite" ,sqlite)))
6100 (arguments
6101 `(#:configure-flags
6102 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
6103 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
6104 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
6105 (postgresql (assoc-ref %build-inputs "postgresql"))
6106 (sqlite (assoc-ref %build-inputs "sqlite")))
6107 (list "--disable-docs"
6108 (string-append "--with-dbi-incdir=" libdbi "/include")
6109 (string-append "--with-dbi-libdir=" libdbi "/lib")
6110 "--with-mysql"
6111 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
6112 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
6113 "--with-pgsql"
6114 (string-append "--with-pgsql-incdir=" postgresql "/include")
6115 (string-append "--with-pgsql-libdir=" postgresql "/lib")
6116 "--with-sqlite3"
6117 (string-append "--with-sqlite-incdir=" sqlite "/include")
6118 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
6119 #:tests? #f ; FIXME: Find why the tests get stuck forever.
6120 #:phases
6121 (modify-phases %standard-phases
6122 (add-after 'unpack 'gcc14
6123 (lambda _
6124 (setenv "CFLAGS"
6125 (string-append
6126 "-g -O2 "
6127 "-Wno-error=int-conversion "
6128 "-Wno-error=incompatible-pointer-types "
6129 "-Wno-error=implicit-function-declaration"))))
6130
6131 (add-after 'unpack 'fix-tests
6132 (lambda* (#:key inputs #:allow-other-keys)
6133 (substitute* "tests/test_mysql.sh"
6134 (("^MYMYSQLD=.*")
6135 (string-append "MYMYSQLD="
6136 (assoc-ref inputs "mariadb")
6137 "/bin/mysqld")))
6138 #t))
6139 (add-after 'install 'remove-empty-directories
6140 (lambda* (#:key outputs #:allow-other-keys)
6141 (let ((var (string-append (assoc-ref outputs "out") "/var")))
6142 (delete-file-recursively var))
6143 #t)))))
6144 (synopsis "Database drivers for the libdbi framework")
6145 (description
6146 "The @code{libdbi-drivers} library provides the database specific drivers
6147for the @code{libdbi} framework.
6148
6149The drivers officially supported by @code{libdbi} are:
6150@itemize
6151@item MySQL,
6152@item PostgreSQL,
6153@item SQLite.
6154@end itemize")
6155 (home-page "https://libdbi-drivers.sourceforge.net/")
6156 (license license:lgpl2.1+)))
6157
6158(define-public soci
6159 (package
6160 (name "soci")
6161 (version "4.0.3")
6162 (source (origin
6163 (method git-fetch)
6164 (uri (git-reference
6165 (url "https://github.com/SOCI/soci/")
6166 (commit (string-append "v" version))))
6167 (file-name (git-file-name name version))
6168 (sha256
6169 (base32
6170 "12aq7pama96l2c1kmfkclb4bvrsxs9a8ppgk5gmzw45w2lg35i0y"))
6171 (patches (search-patches "soci-mysql-ddl-types.patch"))))
6172 (build-system cmake-build-system)
6173 (propagated-inputs
6174 ;; Headers of soci has include-references to headers of these inputs.
6175 (list firebird
6176 postgresql
6177 sqlite
6178 unixodbc
6179 boost
6180 `(,mariadb "dev")))
6181 (arguments
6182 (list #:configure-flags
6183 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs
6184 ;; it.
6185 #~(list "-DCMAKE_CXX_STANDARD=17"
6186 "-DSOCI_LIBDIR=lib"
6187 ;; This is for relocation when linking statically
6188 "-DCMAKE_CXX_FLAGS=-fPIE")
6189 #:tests? #f)) ; may require running database management systems
6190 (synopsis "C++ Database Access Library")
6191 (description
6192 "SOCI is an abstraction layer for several database backends, including
6193PostreSQL, SQLite, ODBC and MySQL.")
6194 (home-page "https://soci.sourceforge.net/")
6195 (license license:boost1.0)))
6196
6197(define-public freetds
6198 (package
6199 (name "freetds")
6200 (version "1.2.20")
6201 (source
6202 (origin
6203 (method url-fetch)
6204 (uri (string-append "https://www.freetds.org/files/stable/"
6205 "freetds-" version ".tar.gz"))
6206 (sha256
6207 (base32 "11fzwcahc1bc8npxbif0448v9cwyf7k04167i7fcspmfw7a0hj0d"))))
6208 (build-system gnu-build-system)
6209 (inputs (list unixodbc))
6210 (arguments
6211 ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection,
6212 ;; disabled for now.
6213 `(#:tests? #f
6214 #:configure-flags
6215 (list (string-append "--with-unixodbc=" (assoc-ref %build-inputs "unixodbc")))))
6216 (home-page "https://www.freetds.org/")
6217 (synopsis "Client libraries for MS SQL and Sybase servers")
6218 (description
6219 "FreeTDS is an implementation of the Tabular DataStream protocol, used for
6220connecting to MS SQL and Sybase servers over TCP/IP.")
6221 (license license:lgpl2.0+)))
6222
6223(define-public python-tinydb
6224 (package
6225 (name "python-tinydb")
6226 (version "4.8.0")
6227 (source (origin
6228 (method url-fetch)
6229 (uri (pypi-uri "tinydb" version))
6230 (sha256
6231 (base32 "0r6mavw0wm03lbmqbgglsyff3vws86ddg3q8h29glpd7qnlqdmkd"))))
6232 (build-system pyproject-build-system)
6233 (native-inputs
6234 (list python-poetry-core python-pytest))
6235 (home-page "https://github.com/msiemens/tinydb")
6236 (synopsis "TinyDB is a lightweight document oriented database")
6237 (description
6238 "TinyDB is a small document oriented database written in pure Python
6239with no external dependencies. The targets are small apps that would
6240be blown away by a SQL-DB or an external database server.")
6241 (license license:expat)))
6242
6243(define-public sdb
6244 (package
6245 (name "sdb")
6246 (version "2.5.0")
6247 (source (origin
6248 (method git-fetch)
6249 (uri (git-reference
6250 (url "https://github.com/radareorg/sdb.git")
6251 (commit version)))
6252 (file-name (git-file-name name version))
6253 (sha256
6254 (base32
6255 "1fci72hcm2a0k9rnsfkcr2qsfprzxfycghpr4i3wargj781lc9jd"))))
6256 (build-system meson-build-system)
6257 (arguments
6258 (list
6259 #:phases
6260 #~(modify-phases %standard-phases
6261 (add-before 'check 'setenv-cc
6262 (lambda _
6263 (setenv "CC" #$(cc-for-target))))
6264 ;; The provided meson.build uses a Makefile in the source root
6265 ;; to run the tests, but resolves its directory relative to
6266 ;; the build directory, assuming the build is one level under
6267 ;; the source tree. This breaks if the build tree is elsewhere.
6268 (add-before 'check 'set-test-workdir-to-source-root
6269 (lambda _
6270 (substitute* "../source/meson.build"
6271 (("workdir: join_paths.*$")
6272 "workdir: meson.project_source_root(),\n")))))))
6273 (native-inputs
6274 (list node
6275 perl
6276 python-minimal-wrapper))
6277 (home-page "https://github.com/radareorg/sdb")
6278 (synopsis "Simple and fast string based key-value database")
6279 (description "SDB is a simple key/value database based on djb's cdb disk
6280storage that supports JSON and array introspection.")
6281 (license license:expat)))
6282
6283(define-public sqlitebrowser
6284 (package
6285 (name "sqlitebrowser")
6286 (version "3.13.1")
6287 (source
6288 (origin
6289 (method git-fetch)
6290 (uri (git-reference
6291 (url "https://github.com/sqlitebrowser/sqlitebrowser")
6292 (commit (string-append "v" version))))
6293 (file-name (git-file-name name version))
6294 (sha256
6295 (base32 "0615yks1krwjw4l1xxahn9j6qbd7cs8dxza7kc73hc5wr0xng5kf"))
6296 (modules '((guix build utils)))
6297 (snippet
6298 '(begin
6299 ;; Delete bundled dependencies, available as Guix packages.
6300 (for-each delete-file-recursively
6301 (list "libs/json"
6302 "libs/qcustomplot-source"
6303 "libs/qhexedit"
6304 "libs/qscintilla"))
6305 ;; Patch #includes to be able to use Guix's nlohmann-json
6306 (with-directory-excursion "src"
6307 (substitute* (list "RemoteCommitsModel.h"
6308 "RemoteLocalFilesModel.h"
6309 "RemoteModel.h"
6310 "RemotePushDialog.cpp"
6311 "RemoteNetwork.cpp"
6312 "RemoteDock.cpp"
6313 "ExportDataDialog.cpp"
6314 "EditDialog.cpp")
6315 (("json\\.hpp") "nlohmann/json.hpp")))))))
6316 (build-system qt-build-system)
6317 (arguments
6318 (list #:configure-flags
6319 #~(list (string-append "-DQSCINTILLA_INCLUDE_DIR="
6320 #$(this-package-input "qscintilla-qt5")
6321 "/include/Qsci")
6322 "-DFORCE_INTERNAL_QCUSTOMPLOT=OFF"
6323 "-DFORCE_INTERNAL_QHEXEDIT=OFF"
6324 "-DENABLE_TESTING=ON")))
6325 (inputs
6326 (list qcustomplot-qt5
6327 qhexedit
6328 qscintilla-qt5
6329 qtbase-5
6330 qtwayland-5
6331 sqlite))
6332 (native-inputs (list nlohmann-json qttools-5))
6333 (home-page "https://sqlitebrowser.org/")
6334 (synopsis "Visual database browser and editor for SQLite")
6335 (description "Sqlitebrowser lets you create, design, and edit database files
6336compatible with SQLite using a graphical user interface.")
6337 (license
6338 ;; dual license
6339 (list license:gpl3+
6340 license:mpl2.0))))
6341
6342(define-public sqlitecpp
6343 (package
6344 (name "sqlitecpp")
6345 (version "3.3.3")
6346 (source
6347 (origin
6348 (method git-fetch)
6349 (uri (git-reference
6350 (url "https://github.com/SRombauts/SQLiteCpp")
6351 (commit version)))
6352 (file-name (git-file-name name version))
6353 (sha256
6354 (base32
6355 "10gliycmzd16ydbpwwsn1r6byf5l78fwwc7hzgjdgg68zcclj8s5"))
6356 (modules '((guix build utils)))
6357 (snippet #~(delete-file-recursively "sqlite3"))))
6358 (build-system cmake-build-system)
6359 (arguments
6360 (list
6361 #:configure-flags #~'("-DSQLITECPP_INTERNAL_SQLITE=OFF"
6362 "-DSQLITECPP_INCLUDE_SCRIPT=OFF"
6363 "-DSQLITECPP_BUILD_TESTS=ON"
6364 "-DBUILD_SHARED_LIBS=ON")))
6365 (inputs (list sqlite))
6366 (native-inputs (list googletest))
6367 (home-page "https://srombauts.github.io/SQLiteCpp/")
6368 (synopsis "C++ SQLite3 wrapper")
6369 (description "SQLiteC++ offers a intuitive C++ wrapper around the native C
6370APIs of SQLite, prioritizing speed, minimal dependencies, and portability.")
6371 ;; Complementary cmake and code-linter 3-clause BSD.
6372 (license license:expat)))
6373
6374(define-public sqlitestudio
6375 (package
6376 (name "sqlitestudio")
6377 (version "3.4.19")
6378 (source
6379 (origin
6380 (method git-fetch)
6381 (uri (git-reference
6382 (url "https://github.com/pawelsalawa/sqlitestudio")
6383 (commit version)))
6384 (file-name (git-file-name name version))
6385 (sha256
6386 (base32 "1fvyd2l1pbpl4jgn7vp8j2gsmw0sbfzidyv3k87xm6a2d7i680yc"))))
6387 (build-system gnu-build-system)
6388 (arguments
6389 (list
6390 #:phases
6391 #~(modify-phases %standard-phases
6392 (replace 'configure
6393 (lambda* (#:key inputs outputs #:allow-other-keys)
6394 (let* ((out (assoc-ref outputs "out"))
6395 (python-version #$(version-major+minor (package-version
6396 python)))
6397 (python-include (string-append (assoc-ref inputs "python")
6398 "/include/python"
6399 python-version)))
6400 (invoke "qmake"
6401 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out
6402 "/lib:")
6403 (string-append "PREFIX=" out) "./SQLiteStudio3")
6404 (mkdir-p "Plugins")
6405 (with-directory-excursion "Plugins"
6406 (invoke "qmake"
6407 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out
6408 "/lib:")
6409 (string-append "PREFIX=" out)
6410 (string-append "INCLUDEPATH+=" python-include)
6411 (string-append "PYTHON_VERSION=" python-version)
6412 ".")))))
6413 (replace 'build
6414 (lambda _
6415 (invoke "make" "-j"
6416 (number->string (parallel-job-count)))
6417 (with-directory-excursion "Plugins"
6418 (invoke "make")))) ;building plugins in parallel corrupts them
6419 (replace 'install
6420 (lambda* (#:key outputs #:allow-other-keys)
6421 (let* ((out (assoc-ref outputs "out"))
6422 (icons-dir (string-append out "/share/icons/hicolor/"))
6423 (src-img-dir (string-append
6424 "SQLiteStudio3/guiSQLiteStudio/img/")))
6425 (invoke "make" "-j"
6426 (number->string (parallel-job-count)) "install")
6427 (for-each (lambda (size)
6428 (let ((target-dir (string-append icons-dir size
6429 "x" size "/apps/")))
6430 (mkdir-p target-dir)
6431 (copy-file (string-append src-img-dir
6432 "sqlitestudio_" size
6433 ".png")
6434 (string-append target-dir
6435 "sqlitestudio.png"))))
6436 '("16" "48" "256"))
6437 (let ((target-dir (string-append icons-dir "scalable/apps/")))
6438 (mkdir-p target-dir)
6439 (install-file (string-append src-img-dir "sqlitestudio.svg")
6440 target-dir))
6441 (with-directory-excursion "Plugins"
6442 (invoke "make" "-j"
6443 (number->string (parallel-job-count)) "install")))))
6444 (add-after 'install 'install-desktop
6445 (lambda* (#:key outputs #:allow-other-keys)
6446 (let* ((out (assoc-ref outputs "out")))
6447 (make-desktop-entry-file (string-append out
6448 "/share/applications/"
6449 #$name ".desktop")
6450 #:name "SQLiteStudio"
6451 #:comment #$(package-synopsis
6452 this-package)
6453 #:exec (string-append #$name " %f")
6454 #:icon #$name
6455 #:categories '("Development"
6456 "Utility" "Database")
6457 #:mime-type "application/vnd.sqlite3")))))))
6458 (inputs (list openssl
6459 python
6460 qtbase-5
6461 qtsvg-5
6462 readline
6463 sqlite-next))
6464 (native-inputs (list python qttools-5 qtdeclarative-5 tcl))
6465 (home-page "https://sqlitestudio.pl/")
6466 (synopsis "Graphical user interface to browse and edit SQLite databases")
6467 (description
6468 "SQLiteStudio is desktop application for browsing and editing SQLite
6469database files. It is aimed for people, who know what SQLite is, or what
6470relational databases are in general.")
6471 (license license:gpl3+)))
6472
6473(define-public sqls
6474 (package
6475 (name "sqls")
6476 ;; TODO: The latest version requires a way more packages to be available
6477 ;; in Guix.
6478 (version "0.2.18")
6479 (source (origin
6480 (method git-fetch)
6481 (uri (git-reference
6482 (url "https://github.com/sqls-server/sqls")
6483 (commit (string-append "v" version))))
6484 (file-name (git-file-name name version))
6485 (sha256
6486 (base32
6487 "13837v27avdp2nls3vyy7ml12nj7rxragchwf92adn10ffp4aj6c"))))
6488 (build-system go-build-system)
6489 (arguments
6490 (list
6491 #:install-source? #f
6492 #:import-path "github.com/lighttiger2505/sqls"
6493 ;; XXX: Try to enable more or all tests.
6494 #:test-subdirs #~(list "ast/..."
6495 "dialect/..."
6496 "parser/..."
6497 "internal/completer"
6498 "internal/config/..."
6499 "internal/database"
6500 "internal/debug"
6501 "internal/formatter"
6502 "internal/lsp")))
6503 (native-inputs
6504 (list go-github-com-google-go-cmp
6505 go-github-com-go-sql-driver-mysql
6506 go-github-com-k0kubun-pp
6507 go-github-com-lib-pq
6508 go-github-com-mattn-go-runewidth
6509 go-github-com-mattn-go-sqlite3
6510 go-github-com-olekukonko-tablewriter-0.0.5
6511 go-github-com-pkg-errors
6512 go-github-com-sourcegraph-jsonrpc2
6513 go-golang-org-x-crypto
6514 go-golang-org-x-xerrors
6515 go-gopkg-in-yaml-v2))
6516 (home-page "https://github.com/sqls-server/sqls")
6517 (synopsis "SQL language server written in Go")
6518 (description
6519 "This package implements the @acronym{LSP, Language Server Protocol} for SQL.")
6520 (license license:expat)))
6521
6522(define-public python-dbutils
6523 (package
6524 (name "python-dbutils")
6525 (version "3.1.2")
6526 (source
6527 (origin
6528 (method git-fetch)
6529 (uri (git-reference
6530 (url "https://github.com/WebwareForPython/DBUtils")
6531 (commit
6532 (string-append "Release-"
6533 (string-join (string-split version #\.) "_")))))
6534 (file-name (git-file-name name version))
6535 (sha256
6536 (base32 "1x2bqqlp6ahm8k8d0f1g3l0fcsjala3z6jdmcwhwkbh0agg8agff"))))
6537 (build-system pyproject-build-system)
6538 (native-inputs (list python-pytest python-setuptools))
6539 (home-page "https://github.com/WebwareForPython/DBUtils")
6540 (synopsis "Database connections for multi-threaded environments")
6541 (description
6542 "This package provides tooling for solid, persistent and pooled
6543connections to a database that can be used in all kinds of multi-threaded
6544environments.")
6545 (license license:expat)))
6546
6547(define-public python-dogpile-cache
6548 (package
6549 (name "python-dogpile-cache")
6550 (version "1.3.4")
6551 (source
6552 (origin
6553 (method url-fetch)
6554 (uri (pypi-uri "dogpile_cache" version))
6555 (sha256
6556 (base32 "1h58g3iyv6gc6x3in252d4c1v5sncvishjy82dz3zpazbxbra0jg"))))
6557 (build-system pyproject-build-system)
6558 (native-inputs
6559 (list python-mako
6560 python-pytest
6561 python-setuptools
6562 python-wheel))
6563 (propagated-inputs
6564 (list python-decorator
6565 python-stevedore
6566 python-typing-extensions))
6567 (home-page "https://github.com/sqlalchemy/dogpile.cache")
6568 (synopsis "Caching front-end based on the Dogpile lock")
6569 (description "@code{dogpile.cache} is a caching API which provides a
6570generic interface to caching backends of any variety, and additionally
6571provides API hooks which integrate these cache backends with the locking
6572mechanism of @code{dogpile}.")
6573 (license license:expat)))
6574
6575(define-public datasette
6576 (package
6577 (name "datasette")
6578 (version "1.0a26")
6579 (source
6580 (origin
6581 (method git-fetch)
6582 (uri (git-reference
6583 (url "https://github.com/simonw/datasette")
6584 (commit version)))
6585 (file-name (git-file-name name version))
6586 (sha256
6587 (base32 "1ra0yfrz9w3jx7ix3dmcsg0g8hjxkz37586g7ijmqshxpzczxfm7"))))
6588 (build-system pyproject-build-system)
6589 (arguments
6590 (list
6591 ;; tests: 1720 passed, 9 skipped, 8 xfailed, 13 xpassed, 3 warnings, 120
6592 ;; subtests passed
6593 #:test-flags
6594 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
6595 "--ignore=tests/test_black.py")
6596 #:phases
6597 #~(modify-phases %standard-phases
6598 (add-after 'unpack 'relax-requirements
6599 (lambda _
6600 (substitute* "pyproject.toml"
6601 (("\"pip\",") "")))))))
6602 (propagated-inputs
6603 (list python-aiofiles
6604 python-asgi-csrf
6605 python-asgiref
6606 python-asyncinject
6607 python-click
6608 python-click-default-group
6609 python-httpx
6610 python-hupper
6611 python-itsdangerous
6612 python-janus
6613 python-jinja2
6614 python-mergedeep
6615 python-pluggy
6616 python-pyyaml
6617 python-sqlite-utils
6618 python-uvicorn))
6619 (native-inputs
6620 (list nss-certs-for-test
6621 python-beautifulsoup4
6622 python-cogapp
6623 python-multipart-form-data-conformance
6624 python-pytest
6625 python-pytest-asyncio
6626 python-pytest-timeout
6627 python-pytest-xdist
6628 python-setuptools
6629 python-trustme))
6630 (home-page "https://datasette.io/")
6631 (synopsis "Multi-tool for exploring and publishing data")
6632 (description "Datasette is a tool for exploring and publishing data.
6633It helps people take data of any shape or size and publish that as an
6634interactive, explorable website and accompanying API.")
6635 (license license:asl2.0)))