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

Add extension-functions.c info to README #779

Merged
merged 1 commit into from Apr 16, 2020
Merged

Conversation

dinedal
Copy link
Contributor

@dinedal dinedal commented Feb 2, 2020

One thing I've found SQLite3 lacking is a lot of common functions that many SQL databases have, such as stdev. These functions can be found for SQLite3 by the file extension-functions.c found on https://www.sqlite.org/contrib?orderby=date

I've copied the file to GitHub at https://github.com/dinedal/go-sqlite3-extension-functions and put together a very small CMake script so it will build in a cross-platform way.

extension-functions.c adds the following functions:

  • Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi.
  • String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter.
  • Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile

Hopefully this makes it easier to get this functions more widespread.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 51.497% when pulling b91083c on dinedal:master into 9bdaffc on mattn:master.

@mattn mattn merged commit 58b2310 into mattn:master Apr 16, 2020
@mattn
Copy link
Owner

mattn commented Apr 16, 2020

Thank you

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

Successfully merging this pull request may close these issues.

None yet

3 participants