dbcli / dbcli/litecli

FR: configuration to import custom python functions

オープン
#158 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。