barklan / inline_sql_syntax

Highlight and lint inline SQL strings.
https://marketplace.visualstudio.com/items?itemName=qufiwefefwoyn.inline-sql-syntax
MIT License
57 stars 24 forks source link

Support for YAML #68

Open Jeromearsene opened 2 years ago

Jeromearsene commented 2 years ago

Like yaml-string-sql, purpose possibility to parse SQL in YAML.

Example:

Single request

   data: |
          --sql
          SELECT * FROM test;

Multiple requests

   data: |
          --sql-start
          SELECT * FROM test;
          SELECT COUNT(*) from test_2;
          --sql-end
barklan commented 2 years ago

That's interesting, thanks for opening issue! It might actually be cleaner without closing comment, even for multiple requests (using next yaml key as a closing anchor)?

   data: |
          --sql
          SELECT * FROM test;
          SELECT COUNT(*) from test_2;
   next_key: "This is not SQL"

I'll try to experiment if it's possible to hack something like this using TextMate.