SQL Wizard
Creating the Configuration File
The SQL Wizard is a tool for creating the configuration file for the time-driven custom classes DefaultSQLCron and DefaultFileSQLCron (SQLCron).
We will use the existing database tables comm_partnerelations, comm_auths, comm_auths_additional and the default database alias (in this case hub) to create a configuration file with the SQL Wizard. For each record in comm_partnerrelations, there are n records in comm_auths, which in turn can reference to n records in comm_auths_additional. Following the Entity Relationship Diagram.
Page 1 (database alias)
Choose the database alias that is used by Lobster_data (1) (default is hub). Then click on button Select tables (2).
This example will not show all the possible options of the configuration file, but focus on the creation of the SQL statements and their dependencies.
Page 2 (comm_partnerrelations)
The list contains all the available tables of the chosen database alias. Choose table comm_partnerrelations (3) and click on button (4).
Page 3 (comm_partnerrelations)
You can select the desired columns of the table.
Click button Create SQL command and the automatically generated SQL statement will appear in the window below (5). This statement can be modified if necessary. If you are ready, click on button Apply SQL command (6).
Page 2 (comm_auths)
Now choose table comm_auths (7) and click on button (8).
Page 3 (comm_auths)
Now we want to refer to table comm_partnerrelations with column id_partner.
Open the context menu on row id_partner and select comm_partnerrelations and the reference to id_partner (9).
Click on button Create SQL command (10) again.
The automatically generated SQL statement will appear in the window below (11). This statement can be modified if necessary. If you are ready, click on button Apply SQL command (12).
Page 2 (comm_auths_additional)
Now choose table comm_auths_additional (13) and click on button (14).
Page 3 (comm_auths_additional)
As described for table comm_auths, we create references for table comm_auth_additional.
Select context menu item Reference to: comm_auths and then item id_partner for line id_partner (15).
Select context menu item Reference to: comm_auths and then item id_auth for line id_auth (16).
Click on button Create SQL command (17) and then on button Apply SQL command (18).
Page 4
Now we are done with our references. Click on button Apply (19). This will automatically create the properties configuration file.
Via (20) and (21) in phase 1 (see classes DefaultSQLCron and DefaultFileSQLCron (SQLCron)) you can view the properties file.
Modifying the Configuration File
If you have already created a configuration file, the name of the file is automatically saved in the SQL Wizard. If the SQL Wizard is opened again, this file is read in. All existing settings in the file are displayed. To change the configuration, just go through the steps you want to change and save at the end. This overwrites the existing configuration file. Of course, you can also work directly in the configuration file if you want. Details of the parameters in the file are described in the documentation of the before mentioned classes.