Skip to content

Implement support for calling Go functions from SQLite #229

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

Merged
merged 5 commits into from
Sep 16, 2015
Merged

Implement support for calling Go functions from SQLite #229

merged 5 commits into from
Sep 16, 2015

Conversation

danderson
Copy link
Contributor

Fixes #226.

Supports scalar functions and aggregation functions.

I've benchmarked the call stack, and even with the reflection, the performance matches the QueryRow benchmark (18 microseconds per "SELECT custom_func(1,2)").

@mattn
Copy link
Owner

mattn commented Aug 21, 2015

Oh, awesome. I'll look into it in later.

…ndling.

A call now doesn't have to do any reflection, it just blindly invokes
a bunch of argument and return value handlers to execute the translation,
and the safety of the translation is determined at registration time.
Currently, the variadic part must all be the same type, because there's
no "generic" arg converter.
This enabled support for functions like Foo(a interface{}) and
Bar(a ...interface{}).
@danderson
Copy link
Contributor Author

Ping?

@mattn
Copy link
Owner

mattn commented Sep 15, 2015

I'll merge this after CI. 👍

@mattn
Copy link
Owner

mattn commented Sep 15, 2015

Could you handle error on CI?

@danderson
Copy link
Contributor Author

Sorry, there was a typo in one of the tests. Fixed and repushed, CI passes now.

mattn added a commit that referenced this pull request Sep 16, 2015
Implement support for calling Go functions from SQLite
@mattn mattn merged commit 0bb7f1c into mattn:master Sep 16, 2015
@mattn
Copy link
Owner

mattn commented Sep 16, 2015

Coooooooooool! 👍

@dashed
Copy link

dashed commented Sep 17, 2015

This is slick. 👍

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.

3 participants