dotnetmigrations icon indicating copy to clipboard operation
dotnetmigrations copied to clipboard

Command to set default or 'current' connection so that you don't have to specify it with every command

Open jpoehls opened this issue 14 years ago • 7 comments

Pros:

  • One less arg to type if you are doing a series of commands against the same database

Cons:

  • Added complexity with argument parsing
  • Having to update app.config file on the fly to store setting (not a big deal really)

jpoehls avatar May 11 '11 18:05 jpoehls

Another option, just to consider, is to default to the one database connection in the config file IF there is one database connection in the file.

darrencauthon avatar May 11 '11 18:05 darrencauthon

And of course... I wonder if the same thing could be done with setting a database.

darrencauthon avatar May 11 '11 18:05 darrencauthon

This is actually starting to dove tail a little into another feature idea #19 which would enable DNM to discover (and use) connection strings stored in your project's web.config or app.config files.

jpoehls avatar May 11 '11 18:05 jpoehls

Not sure if I like the idea of DNM looking into another set of configuration files. Part of its beauty at the moment is quite how simple it is to use.

kieranbenton avatar Jul 14 '11 17:07 kieranbenton

It wouldn't take another set of configuration files, what little data it would take would still reside in the existing config file.

I'm only suggesting it as a convention because I've seen it done elsewhere, and I find myself repeating the same arguments over and over and over and over while using DNM.

darrencauthon avatar Jul 14 '11 21:07 darrencauthon

@darren, no I completely agree with you - having a default does make a certain amount of sense. In a multi-developer environment though I would argue that it makes more sense for that to be set outside of the config file - as that would truly be shared between all developers.

Otherwise there would be no point of default then, as each dev would need to specify their own db every time.

kieranbenton avatar Jul 15 '11 12:07 kieranbenton

Hmm... yeah, now that you say that, I see what you're saying. It makes sense perhaps with a setup like Git, where the executable is run locally. Right now, I'm including the DNM db.exe in the source control so other programmers have it and so I can bind it to my rake scripts.

It could be helpful since the other programmers are doing the same thing, but... now I agree. I don't think cutting out a "-c DBVALUE" is worth the extra complexity.

darrencauthon avatar Jul 15 '11 14:07 darrencauthon