Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash shell script heredoc inline SQL support #99

Open
CC-Hsu opened this issue Nov 14, 2022 · 0 comments
Open

bash shell script heredoc inline SQL support #99

CC-Hsu opened this issue Nov 14, 2022 · 0 comments

Comments

@CC-Hsu
Copy link

CC-Hsu commented Nov 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant