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

sqlite3 math extension #136

Open
bodemann opened this issue Jul 23, 2022 · 4 comments
Open

sqlite3 math extension #136

bodemann opened this issue Jul 23, 2022 · 4 comments

Comments

@bodemann
Copy link

I hope this is the right place to ask.

I'd like to use the math extension to be able to query like this:
stmt := conn.Prep("SELECT cos(lat) FROM t WHERE rowid = $id;")

Does anybody know how I could activate it?

@anacrolix
Copy link
Contributor

I believe you need to add a define SQLITE_* to enable math and then possibly link against an appropriate library to provide math functions to C -lm.

@AdamSLevy
Copy link
Collaborator

This could be something we expose as a build tag perhaps. Or just decide to include it always. I'm not strictly opposed to including the extension by default but open to the opinions of others.

@anacrolix
Copy link
Contributor

I think include it by default.

@bodemann
Copy link
Author

Include it by default would be nice.

BTW: The sqlite binary from https://www.sqlite.org/download.html has quite a few extensions compiled in (I tested the linux binary). I would suggest this as a reference for what to include.

Thank you both for reacting to my question.

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

3 participants