lintel 0.2.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
lintel::DatabaseBootstrapPlugin Class Reference

#include <DatabaseBootstrapPlugin.h>

Inheritance diagram for lintel::DatabaseBootstrapPlugin:
lintel::BootstrapPlugin

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
 

Detailed Description

DatabaseBootstrapPlugin:

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.

Constructor & Destructor Documentation

◆ DatabaseBootstrapPlugin()

lintel::DatabaseBootstrapPlugin::DatabaseBootstrapPlugin ( std::shared_ptr< DatabaseConnectionConfigurations >  connectionConfigurations)
explicit

Construct a DatabaseBootstrapPlugin with the given database connection configurations.

Parameters
connectionConfigurationsthe database connection configurations

Member Function Documentation

◆ getPriority()

BootstrapSequence lintel::DatabaseBootstrapPlugin::getPriority ( )
overridevirtual

Returns the priority for ordering this plugin in the bootstrap sequence.

Implements lintel::BootstrapPlugin.

◆ onStart()

void lintel::DatabaseBootstrapPlugin::onStart ( )
overridevirtual

Execute database schema initialization and data loading.

Implements lintel::BootstrapPlugin.


The documentation for this class was generated from the following file: