Squashed '.claude/llm-functions/' content from commit 616d8d8

git-subtree-dir: .claude/llm-functions
git-subtree-split: 616d8d84c5565fdb66d8782ae5ba56d994bfa82a
This commit is contained in:
2026-03-27 09:14:17 +01:00
commit 2f1d437723
80 changed files with 5498 additions and 0 deletions

21
tools/execute_sql_code.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
# @describe Execute the sql code.
# @option --code! The code to execute.
# @meta require-tools usql
# @env USQL_DSN! The database connection url. e.g. pgsql://user:pass@host:port
# @env LLM_OUTPUT=/dev/stdout The output path
ROOT_DIR="${LLM_ROOT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
main() {
if ! grep -qi '^select' <<<"$argc_code"; then
"$ROOT_DIR/utils/guard_operation.sh"
fi
usql -c "$argc_code" "$USQL_DSN" >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"