drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.44k stars 1.1k forks source link

dg_ctl create model -- support namespaces #1591

Open rickiewars opened 1 year ago

rickiewars commented 1 year ago

Is your feature request related to a problem? Please describe. When (re)creating the models using the dg_ctl create model ... command, the model-classes are automatically created in a namespace equal to the configured database name. I would like to use a simpler namespace name than how I've named my database. Defining a custom namespace also can advoid accedental model-namespace changes when working together with someone who has it's database named differently.

Describe the solution you'd like An option in the dg_ctl create model ... command and/or a key in the model.json file where a custom namespace name can be defined. Here follow some input-result examples:

I think this should be a small change but a helpfull one.

bradleysmith commented 6 days ago

Agreed. I usually dev using a databaseName_dev database and have databaseName as production. Currently this is impossible to do as the namespace name is tied to the database name.

I have deja vu here though. I feel like I've asked this in the past and it was solved but now I cannot find it.