Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Straightforward way to enable loading extensions? #81

Open
tomviolin opened this issue Feb 26, 2020 · 0 comments
Open

Straightforward way to enable loading extensions? #81

tomviolin opened this issue Feb 26, 2020 · 0 comments

Comments

@tomviolin
Copy link

I need to be able to load extensions into sqlite3 for use in queries with pandasql. In particular, I am using the excellent collection of mathematical functions available from this extension library:

https://github.com/seth/RSQLite.extfuns/blob/master/src/extension-functions.c

The only way I've been able to figure out so far to do this is by using a rather convoluted approach that I discovered by poking around in the PandaSQL class:

from pandasql import PandaSQL
pdsql = PandaSQL(persist=True)
sqlite3conn = next(pdsql.conn.gen).connection.connection
sqlite3conn.enable_load_extension(True)
sqlite3conn.load_extension('./libsqlitefunctions.so')

pdsql("select atan(1)*4;")

Is there a more straightforward way of accessing the sqlite3 connection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant