-
Notifications
You must be signed in to change notification settings - Fork 58
AI #1564: Added transpile helper #1560
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
base: working_draft
Are you sure you want to change the base?
Conversation
… different engine type. Signed-off-by: Mike Fuller <[email protected]>
|
I will open an AI for this today and update the title |
|
Per our discussion yesterday, I propose leaving this out of scope for 1.3 and consider bringing it in for a future release. |
| #### Usage | ||
|
|
||
| ```bash | ||
| # Transpile all SQL blocks in markdown files to T-SQL | ||
| ./sql_transpile.py ../*.md --to tsql | ||
|
|
||
| # List all SQL blocks without transpiling | ||
| ./sql_transpile.py ../*.md --list | ||
|
|
||
| # Transpile with dialect preference for detection | ||
| ./sql_transpile.py ../*.md --to bigquery --prefer trino | ||
|
|
||
| # Process specific files | ||
| ./sql_transpile.py ../file1.md ../file2.md --to postgres | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to consider:
#### Usage
##### Linux / macOS (Bash)
```bash
# List all SQL blocks without transpiling
./sql_transpile.py ../*.md --list
# Transpile all SQL blocks in markdown files to T-SQL
./sql_transpile.py ../*.md --to tsql
# Transpile with dialect preference for detection
./sql_transpile.py ../*.md --to bigquery --prefer trino
# Process specific files
./sql_transpile.py ../file1.md ../file2.md --to postgres
```
##### Windows (PowerShell)
```powershell
# List all SQL blocks without transpiling
python .\sql_transpile.py (Get-ChildItem ..\*.md).FullName --list
# Transpile all SQL blocks in markdown files to T-SQL
python .\sql_transpile.py (Get-ChildItem ..\*.md).FullName --to tsql
# Transpile with dialect preference for detection
python .\sql_transpile.py (Get-ChildItem ..\*.md).FullName --to bigquery --prefer trino
# Process specific files
python .\sql_transpile.py (Get-ChildItem ../file1.md).FullName (Get-ChildItem ../file2.md).FullName --to postgres
```
|
List of dialects is with uppercase but script only handles lowercase Dialect Hints work out which one doesn't break GitHub and then update README |
For those who need to see our example sql in a different engine type.
This helper enables you to switch the language for any sql blocks in markdown