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

diesel_cli: `diesel database reset` does not escape database name #350

Closed
anp opened this Issue Jun 5, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@anp
Contributor

anp commented Jun 5, 2016

I have an ill-advised database name in use on my laptop with a dash in the name. Issue:

$ diesel database reset
Dropping database: name-withdash
ERROR:  syntax error at or near "-"
LINE 1: DROP DATABASE IF EXISTS name-withdash
                                    ^

I tried putting together a PR to escape the name, but the diesel_cli tests are aborting for me before I make any changes (panic in a panic). I'll take another run at it later when I have some time on a different machine.

@mcasper

This comment has been minimized.

Collaborator

mcasper commented Jun 13, 2016

😲
Well that's no good! If you don't beat me to it, I'll take a look tonight

Eijebong added a commit to Eijebong/diesel that referenced this issue May 13, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

Eijebong added a commit to Eijebong/diesel that referenced this issue May 13, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

Eijebong added a commit to Eijebong/diesel that referenced this issue May 13, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

Eijebong added a commit to Eijebong/diesel that referenced this issue May 14, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

Eijebong added a commit to Eijebong/diesel that referenced this issue May 14, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

Eijebong added a commit to Eijebong/diesel that referenced this issue May 14, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

Eijebong added a commit to Eijebong/diesel that referenced this issue May 14, 2017

Sanitize the database name in diesel_cli for CREATE / DROP database
operations.

This allows the usage of database names like foo-bar.

I chose not to use my query_helper functions and instead escape the
names myself in the tests directory to avoid adding a lib.rs to diesel_cli.

Fixes diesel-rs#350

@Eijebong Eijebong closed this in 280e01c May 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment