diff mbox series

[bug#69716] gnu: python-3.12: Enable loadable sqlite extensions.

Message ID 10bb4eeb00197f5f02a1d88368e004ba17541612.1710105764.git.felgru@posteo.net
State New
Headers show
Series [bug#69716] gnu: python-3.12: Enable loadable sqlite extensions. | expand

Commit Message

Felix Gruber March 10, 2024, 9:22 p.m. UTC
This change makes it possible to load sqlite extensions with

import sqlite3
con = sqlite3.connect(":memory:")
con.enable_load_extension(True)
con.load_extension(path_to_extension)

* gnu/packages/python.scm (python-3.12)[arguments]: Add
--enable-loadable-sqlite-extensions to configure-flags.

Change-Id: I4fb0a5482c96a12a71c88bc48fffc4c3abe78544
---
 gnu/packages/python.scm | 1 +
 1 file changed, 1 insertion(+)


base-commit: c7836393be4d134861d652b2fcf09cf4e68275ca

Comments

Lars-Dominik Braun March 30, 2024, 4:10 p.m. UTC | #1
Hi,

> This change makes it possible to load sqlite extensions with

what is the use-case for this? Do we have any loadable extensions for
SQLite packaged?

Lars
Felix Gruber March 30, 2024, 10:16 p.m. UTC | #2
Hi Lars,

On 3/30/24 5:10 PM, Lars-Dominik Braun wrote:
>> This change makes it possible to load sqlite extensions with
> 
> what is the use-case for this? Do we have any loadable extensions for
> SQLite packaged?

I'm interested in loading the spatialite extension [1] for working with 
geographical data in sqlite. Spatialite is already packaged in guix 
under the name libspatialite.

[1]: https://www.gaia-gis.it/fossil/libspatialite/index

In the end, I want to use spatialite in datasette (which is also 
packaged in guix) to explore geographical datasets [2,3].

[2]: https://datasette.io/for/geospatial
[3]: https://datasette.io/tutorials/spatialite

I don't know if we have any other loadable sqlite extensions packaged in 
guix, apart from libspatialite.

Kind regards,
Felix
Lars-Dominik Braun April 26, 2024, 6:53 a.m. UTC | #3
Hi,

> I'm interested in loading the spatialite extension [1] for working with 
> geographical data in sqlite. Spatialite is already packaged in guix 
> under the name libspatialite.

seems to work. Pushed as 4caf26a4f5708f490c62f46ab68527f6fcc54295.

Lars
diff mbox series

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 12a5148cb1..e7df4d86ce 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -633,6 +633,7 @@  (define-public python-3.12
                                "--with-computed-gotos" ;main interpreter loop optimization
                                "--enable-unicode=ucs4"
                                "--without-static-libpython"
+                               "--enable-loadable-sqlite-extensions"
 
                                ;; FIXME: These flags makes Python significantly faster,
                                ;; but leads to non-reproducible binaries.