[storm] sqlite3_enable_load_extension

Pietro Abate Pietro.Abate at pps.jussieu.fr
Tue Sep 16 13:52:33 BST 2008


Hi all.

I'm using storm with python2.5 and I have a problem with the sqlite3
extension api. In order to enable the extension loading, I need to call
this library function : sqlite3_enable_load_extension . Unfortunately,
this is not supported in python 2.5 (it will in python 2.6).

To get aroudn this problem I'm trying to build a small python binding
around this C call. I'm using swig to make my life a bit easier. However
I'm a bit stuck when I try to invoke my function passing a storm
connection object. I've attached the code in a tgz to this email.

Briefly, if sqlitext is my module, I'd like to call my function as :

storm.create_database(db_url)
store = storm.Store(database)
sqlitext.enable_extension(store,1)

where enable_extension looks like : 

#include "sqlitext.h"

int enable_extension(Connection* self, int onoff) {
    return sqlite3_enable_load_extension(self->db, onoff);
}

and Connection is the struct as defined in _sqlite3/connection.h in the
python 2.5 source code. The result os storm.Store(database) should be
the result of the lower level python library ...

Is anybody able to help me ?

:)
p

ps: to compile the code you need swig and python-dev of course ...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlitext.tgz
Type: application/x-gtar
Size: 2919 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/storm/attachments/20080916/9a0fbea3/attachment.tgz 


More information about the storm mailing list