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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support variable substitution in sql scripts #33725

Open
chriswhite199 opened this issue Jan 14, 2019 · 3 comments
Open

Support variable substitution in sql scripts #33725

chriswhite199 opened this issue Jan 14, 2019 · 3 comments
Labels
A-cli-client CLI commands that pertain to using SQL features C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-community Originated from the community

Comments

@chriswhite199
Copy link

chriswhite199 commented Jan 14, 2019

Add variable substitution to cockroach sql cli, similar to psql -v option:

echo "CREATE DATABASE IF NOT EXISTS :dbname" | cockroach sql -v dbname=test

Origin: https://forum.cockroachlabs.com/t/execute-cockroach-sql-with-variable-substitution/2310

In the meantime, as pointed out on the above forum post, you can use psql to enable this.

Jira issue: CRDB-6348

@knz knz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-community Originated from the community A-cli labels Jan 14, 2019
@knz knz added this to To do in DB Server & Security via automation Jan 14, 2019
@knz
Copy link
Contributor

knz commented Jan 14, 2019

thanks for filing!

@tim-o
Copy link
Contributor

tim-o commented Jul 15, 2019

Zendesk ticket #3090 has been linked to this issue.

@knz knz added this to To do in SQL CLI (demo + sql + workload + dump) via automation Apr 8, 2020
@knz knz removed this from To do in DB Server & Security Apr 8, 2020
@knz knz added A-cli-client CLI commands that pertain to using SQL features and removed A-cli labels Mar 20, 2021
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli-client CLI commands that pertain to using SQL features C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-community Originated from the community
Development

No branches or pull requests

4 participants