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

FR: configuration to import custom python functions #158

Open
mjpieters opened this issue Apr 20, 2023 · 0 comments
Open

FR: configuration to import custom python functions #158

mjpieters opened this issue Apr 20, 2023 · 0 comments

Comments

@mjpieters
Copy link
Contributor

mjpieters commented Apr 20, 2023

LiteCLI is built in Python, and the Python bindings for SQLite make it possible to bind custom functions you can then call from SQL, see the Connection.create_function() documentation.

I'd love to see litecli support defining your own custom functions for use in SQL queries. This could be in the form of compiling the source code for such a function embedded in the config file, or to support importing functions from Python modules (I'd suggest a path:callable syntax, where you use importlib to import path, then get the callable name from the imported module to register as a functoin).

Bonus points if you can also register aggregation, window and collation functions!

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