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

The db:create command fails if the database name contains a hyphen #545

Closed
aledalgrande opened this issue Sep 19, 2017 · 3 comments
Closed
Labels

Comments

@aledalgrande
Copy link

What you are doing?

The config file:

{
  "development": {
     "username": "postgres",
     "password": "",
     "database": "example-development",
     "dialect": "postgres",
     "host": "localhost"
  }
}

The command:

sequelize db:create

What do you expect to happen?

The database is created.

What is actually happening?

The code at https://github.com/sequelize/cli/blob/master/src/commands/database.js#L22 should be using quotes to make this work I think.

Output, either JSON or SQL

Error: syntax error at or near "-"

Dialect: postgres
Database version: 9.6.3
Sequelize CLI version: 3.0.0-3
Sequelize version: 4.8.4

@aledalgrande aledalgrande changed the title The db:create command fails if the name contains a hyphen The db:create command fails if the database name contains a hyphen Sep 19, 2017
@alexbakerdev
Copy link

Hey, this is still an issue, is it ok if we re-open it? I have made a PR that has tests and should fix the issue. Which is also a big problem for connection string usage, as you cannot wrap the database name with quotes as double-quotes get encoded by url.parse to %22.

@alexbakerdev
Copy link

@sushantdhiman

@alexbakerdev
Copy link

I misread this thread, the issue has been fixed in 3.0.0.

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

No branches or pull requests

3 participants