QSqlMigrator icon indicating copy to clipboard operation
QSqlMigrator copied to clipboard

Slow compiling because of wrong interface header file design

Open mlathan opened this issue 12 years ago • 1 comments

Migrations have to include api.h to be implemented at the moment. api.h is a rather complex header file which polutes every migration header file with unnecessery command and structure classes at the moment.

Specify a tightly defined header file to define a new migration (HPP). Specify a header file for new migration implemantions (CPP).

mlathan avatar Jul 19 '13 21:07 mlathan

The compile time impact of the current structure should be quite low. Migration Headers are included at most twice.

  1. The migration implementation, which require api.h definitions.
  2. The migration registration (as long as auto-registration does not work) includes all the migrations. The api.h is only included from the first, so impact should be low.

Additionally the QSqlMigrator is an external dependency for projects that use it. Therefore it's a good idea to include the api.h in the precompiled header. Which should eliminate almost all of it's compile time costs.

On the other hand is the ease of us. Using the "api.h" makes the migrations really easy to write or generate with a macro.

In the end it's always a trade off.

arBmind avatar Jun 09 '14 11:06 arBmind