I found out that compile time optimization is quite useful specially for database queries, instead of it being generated at every call, it can be generated like I typed it using compile time optimizations... so I thought,

Is it possible to convert an array of values or a list from a file to variables or struct at compile time?

So basically I have a database, instead of writing a struct, I would like to query the database for the list of tables and their column information then parse that as a struct or variables for parsing so that I could use it, so that if I delete or add columns I then only need to recompile the code and not worry about editing files...

class Users
{
      /*
query the database and create fields at compile time and use the variables below
      */

      void create(){
            this.name = "Louie";
       }

}

or  something like this...

foreach(table_names, key; table){
        /*
              generate struct using table and informations
       */
}



Reply via email to