@@ -115,6 +115,55 @@ sqldeps data/sql_folder \
115
115
-o folder_deps.csv
116
116
```
117
117
118
+ ``` bash
119
+ # Access CLI help
120
+ sqldeps --help
121
+
122
+ Usage: sqldeps [OPTIONS] COMMAND [ARGS]...
123
+
124
+ SQL Dependency Extractor - Analyze SQL files to extract table and column dependencies
125
+
126
+ ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
127
+ │ --version Show the version and exit. │
128
+ │ --install-completion Install completion for the current shell. │
129
+ │ --show-completion Show completion for the current shell, to copy it or customize the installation. │
130
+ │ --help Show this message and exit. │
131
+ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
132
+ ╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
133
+ │ extract Extract SQL dependencies from file or folder. │
134
+ │ app Run the SQLDeps web application │
135
+ │ cache Manage SQLDeps cache │
136
+ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
137
+
138
+ # Access CLI help for extraction
139
+ $ sqldeps extract --help
140
+
141
+ Usage: sqldeps extract [OPTIONS] FPATH
142
+
143
+ Extract SQL dependencies from file or folder.
144
+ This tool analyzes SQL files to identify table and column dependencies, optionally validating them against a real database schema.
145
+
146
+ ╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
147
+ │ * fpath PATH SQL file or directory path [default: None] [required] │
148
+ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
149
+ ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
150
+ │ --framework TEXT LLM framework to use [groq, openai, deepseek] [default: groq] │
151
+ │ --model TEXT Model name for the selected framework [default: None] │
152
+ │ --prompt FILE Path to custom prompt YAML file [default: None] │
153
+ │ --recursive -r Recursively scan folder for SQL files │
154
+ │ --db-match-schema --no-db-match-schema Match dependencies against database schema [default: no-db-match-schema] │
155
+ │ --db-target-schemas TEXT Comma-separated list of target schemas to validate against [default: public] │
156
+ │ --db-credentials FILE Path to database credentials YAML file [default: None] │
157
+ │ --db-dialect TEXT Database dialect to use for schema validation [default: postgresql] │
158
+ │ --n-workers INTEGER Number of workers for parallel processing. Use -1 for all CPU cores, 1 for sequential processing. [default: 1] │
159
+ │ --rpm INTEGER Maximum requests per minute for API rate limiting (0 to disable) [default: 100] │
160
+ │ --use-cache --no-use-cache Use local cache for SQL extraction results [default: use-cache] │
161
+ │ --clear-cache --no-clear-cache Clear local cache after processing [default: no-clear-cache] │
162
+ │ --output -o PATH Output file path for extracted dependencies [default: dependencies.json] │
163
+ │ --help Show this message and exit. │
164
+ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
165
+ ```
166
+
118
167
## Example
119
168
120
169
Given this SQL query:
@@ -249,7 +298,12 @@ The custom prompt YAML should include:
249
298
250
299
``` yaml
251
300
system_prompt : |
252
- Detailed instructions to the model...
301
+ You are a SQL analyzer that extracts two key elements from SQL queries:
302
+
303
+ 1. DEPENDENCIES: Tables and columns that must exist BEFORE query execution.
304
+ 2. OUTPUTS: Tables and columns permanently CREATED or MODIFIED by the query.
305
+
306
+ # Add detailed instructions for the LLM here...
253
307
254
308
user_prompt : |
255
309
Extract SQL dependencies and outputs from this query:
0 commit comments