rdagumampan / yuniql

Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released!
https://yuniql.io
Apache License 2.0
417 stars 63 forks source link

YUNIQL_DB_NAME should be replaced in scripts #305

Open gurry opened 1 year ago

gurry commented 1 year ago

Currently you cannot use the reserved token YUNIQL_DB_NAME in scripts like this:

Use [${YUNIQL_DB_NAME}]

because Yuniql doesn't replace it in scripts.

The result is that you have to introduce a token of your own for DB name, such as DBNAME, and specify it with -k during yuniql run, e.g.:

yuniql run -a -c ""Server=localhost,1433;User Id=use;Password=pwd;Database=MyDb;" -k "DBNAME=MyDb"

As you can see, not only do you have to introduce an extra token, you have to specify the DB name twice in the command, once in the connection string and once with -k. This is awkward and in fact creates potential for mistakes.

Can you please make Yuniql replace YUNIQL_DB_NAME in scripts as well? It will make the above problem go away.

gurry commented 1 year ago

@rdagumampan I should add that I'd be happy to implement this if you agree. I'm not sure what it might break.