Trying to load a sqlite extension in apsw, in vain

79 views
Skip to first unread message

E. Pasma

unread,
Apr 4, 2019, 5:09:49 AM4/4/19
to python-sqlite
Dear python-sqlite users of the apsw interface,
according https://rogerbinns.github.io/apsw/connection.html there is a loadconnection method. I try to use that, but in vain, see below. What I can do to find out why?
Thanks, E. Pasma

Last login: Mon Mar 25 11:24:48 on ttys000

$ python

Python 2.7.10 (default, Aug 17 2018, 19:45:58) 

[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import apsw

>>> apsw.apswversion()

'3.27.2-r1'

>>> apsw.sqlitelibversion()

'3.28.0'

>>> cx=apsw.Connection('test.db')

>>> cx.loadextension('testobject')

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

AttributeError: 'apsw.Connection' object has no attribute 'loadextension'

>>> 


Roger Binns

unread,
Apr 4, 2019, 10:57:51 AM4/4/19
to python...@googlegroups.com, E. Pasma
On 04/04/2019 02:09, E. Pasma wrote:
> according https://rogerbinns.github.io/apsw/connection.html there is a
> loadconnection method.
> ...
> AttributeError: 'apsw.Connection' object has no attribute 'loadextension'

Whoever compiled APSW did so with SQLITE_OMIT_LOAD_EXTENSION defined.

Roger

signature.asc

E. Pasma

unread,
Apr 4, 2019, 12:02:05 PM4/4/19
to python-sqlite
I do not have the poetical capabilities to spontaneously set SQLITE_OMIT_LOAD_EXTENSION  
I have MacOS Mojave 10.14..3 and added apsw with the command 
  sudo python setup.py install
it ended in /Library/Python/2.7/site-packages/
There is no other Python installed, this is a new computer.
The env command does not show SQLITE_OMIT_LOAD_EXTENSION

As a workaround I forced the desired setting in setup.py         %s/load_extension=False/load_extension=True/

and loadextension() and enableloadextension() are now there (after new build)

Thanks, E Pasma 

Reply all
Reply to author
Forward
0 new messages