|
lintel 0.2.0
|
#include <DatabaseBootstrapPlugin.h>
Public Member Functions | |
| DatabaseBootstrapPlugin (std::shared_ptr< DatabaseConnectionConfigurations > connectionConfigurations) | |
| void | onStart () override |
| BootstrapSequence | getPriority () override |
Public Member Functions inherited from lintel::BootstrapPlugin | |
| BootstrapPlugin ()=default | |
| virtual | ~BootstrapPlugin ()=default |
The following plugin is for variant to configure / initialize databases.
Configuration Path and type of configuration files: CONFIG_DIRECTORY / database / name-of-database
The init files are responsible for the creation or changing of the structure in the database itself. This means tables, trigger, etc.. Of course, also table extensions, or just changes, deletion in the table itself.
The data files are responsible for initialization of default data in the database itself. For example for configurations. Note, that this is not a way to just insert test data etc.. For this each database type have an available cli tool. Just like postgresql or sqlite3 or gui tools like DBeaver. For tracking the state of the initialization state the bootstrap plugin will create automatically an schema_version table. This table will keep track of initialized version.
Note:
The initialization works in the following way. The version number implies the sequence of the files. The information in the schema_version table implies the start point of the init and data files.
We'll first init the current version and then execute the data include.
|
explicit |
Construct a DatabaseBootstrapPlugin with the given database connection configurations.
| connectionConfigurations | the database connection configurations |
|
overridevirtual |
Returns the priority for ordering this plugin in the bootstrap sequence.
Implements lintel::BootstrapPlugin.
|
overridevirtual |
Execute database schema initialization and data loading.
Implements lintel::BootstrapPlugin.