inline_sql_syntax
inline_sql_syntax copied to clipboard
bash shell script heredoc inline SQL support
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.