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
add support for Built-In Mathematical SQL Functions #77
Comments
Can you provide an example query? |
i.e: the 'power' is from the math functions |
The latest release of the SQLite client that is used by the plugin seems to be on SQLite 3.28.0. Currently latest release: https://github.com/mattn/go-sqlite3/releases/tag/v1.10.0 |
Isnt this the latest version? https://pkg.go.dev/github.com/mattn/go-sqlite3?tab=versions 1.14.9 (Didn't look at the sqlite version in that version) |
Yeah, you are right. It is just not shown as a Github release. The plugin currently uses this version: v1.14.4 I wouldn't expect significant upgrades to the underlying SQLite version between 1.14.9 and v1.14.4 but if you happen to find which version the latest is running I can try upgrading |
Well, based on the code, it's currently at 3.36.0. https://github.com/mattn/go-sqlite3/blob/master/sqlite3-binding.h Line 127. |
Neat. I'll test out the new version later and see if the math functions are included 👌🏻 |
I updated to the newer version of the go library and it still did not recognize the power function. I tried using this extension, that was linked in the golang client docs: https://github.com/dinedal/go-sqlite3-extension-functions To be fair I am not really an expert regarding linking C libraries in go but I am sadly out of idea... |
Hmm, to bad. Sort of hoped/expected it would just work with upgrading the sqlite / go package. |
Hmm, weird. They even mention the math functions in the version... I will check again later this week. Maybe I did something wrong during the go package upgrade... |
I can't get it working... I opened an issue in the underlying library to get see what I am doing wrong... |
Tnx for the update and all the time and work in it. I will also follow #990 |
I didn't understand: is it possible to use pow and sqrt or not? If not, when will it be fixed? I spent a couple of days trying to figure out why sqllite works differently in different applications! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There's still a PR pending in go-sqlite3 to add a build tag for maths functions - mattn/go-sqlite3#1037 until then the functions won't work |
The plugin is using a different sqlite library by now. The linked issue will not have any impact anymore, sadly. The current library is https://pkg.go.dev/modernc.org/sqlite |
Latest does have math functions enabled and they are working (at least the power function). Just noticing that the grafana widget are loading much slower with latest sqlite Datasource plugin |
@fr-ser didn't see your message for a while, thanks for correcting me. Good to know that the math functions are now working :) |
Haha, I didn't even realize that myself. But with the new sqlite package provider it makes sense that some behavior changed 😅
In case the slow down is noticable and consistent could you open a new issue and describe a bit more what you experience? |
per v3.35 sqlite has by default enabled Built-In Mathematical SQL Functions.
https://www.sqlite.org/lang_mathfunc.html
installed sqlite v.3.37 on my grafana host, tried a function, but these do not work.
query does work when executing it directly in sqlite.
The text was updated successfully, but these errors were encountered: