dbcli / dbcli/litecli

FR: configuration to import custom python functions

未关闭
#158 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
3.3k
派生
95
PR 合并指标
30 天内没有已合并 PR

描述

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](https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.create_function).

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`](https://stackoverflow.com/q/67631), 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!

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。