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

bash shell script heredoc inline SQL support #99

Open CC-Hsu opened 1 year ago

CC-Hsu commented 1 year ago

Hi, Team,

Thanks for your great extension, it helps me a lot😊.

I hope to know whether it is possible to support heredoc SQLs in bash shell script.

Heredoc is a way to pass multiple line SQLs to RDBMS client tools (PostgreSQL psql, MySQL mysql, Oracle sqlplus, etc.) inside shell scripts.

If SQL syntax highlighting can also be supported in shell script heredoc, more people can get benefit from it.

A postgres psql example likes below.

#!/bin/bash
psql -v ON_ERROR_STOP=1 -AqtX <<EOF
--sql
BEGIN;
SELECT * FROM table_1;
INSERT INTO table_2 VALUES (1,'hello');
COMMIT;
EOF

Best Regards.