You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's currently no generalized tools for formatting this kind of strings, so you usually end up doing it manually.
But I've been thinking that gritql seems like the perfect tool for dealing with this problem. You could write patterns to extract these strings, define an external command to pipe the string to, then use output of the command for your needs.
It could, for example, look like this:
`sqlx::query("$query")` where {
$formatted = $query|>$(sqlfluff format), // this pipes $query to a shell command$query =>$formatted
}
The text was updated successfully, but these errors were encountered:
I think formatting itself is out of scope for GritQL, but this is a scenario we could likely support in our upcoming workflow engine + SDK. The syntax would look something like this:
One of my pet peeves is formatting languages embedded in strings.
For example, with
sqlx
in rust:Or
jq
in the shell:jq '.[0] | {message: .commit.message, name: .commit.committer.name}'
There's currently no generalized tools for formatting this kind of strings, so you usually end up doing it manually.
But I've been thinking that
gritql
seems like the perfect tool for dealing with this problem. You could write patterns to extract these strings, define an external command to pipe the string to, then use output of the command for your needs.It could, for example, look like this:
The text was updated successfully, but these errors were encountered: