pragma icon indicating copy to clipboard operation
pragma copied to clipboard

Dashes should be allowed in project names

Open anasbarg opened this issue 4 years ago • 0 comments

In Pragma v0.1.0 the projectName's value in a config can't contain a - like this:

config {
  projectName = "montaj-online"
}

Current behavior

In this case, Pragma will throw the following error:

[Error] The project's name must not contain any dashes ('-') : at line 2

  projectName = "montaj-online"
  ^^^^^^^^^^^

Now this is because the project name as the name of the PostgreSQL database in development mode, and database names in PostgreSQL can't contain dashes.

Expected behavior

Pragma shouldn't complain about this.

Suggested fix

The name of the database should be the name of the project between ": dbName = '"' + projectName + '"'. This will make PostgreSQL ignore the dash.

anasbarg avatar Nov 15 '20 07:11 anasbarg