The purpose of the DatabaseModifier atom is to modify a database by executing a query.
./src/model/databaseModifier/databaseModifier.js
A new DatabaseModifier atom is created either by:
- using the context menu of a Models atom in the Tree View or
- calling the corresponding factory method of the Models atom in the source code of the Editor view:
...
let databaseModifier = models.createDatabaseModifier();
You can run the DatabaseModifier atom either
a) with the run button in the upper right corner of the Properties View
b) with the run button in the context menu of the atom in the Tree View
c) with the run button in the context menu of the parent Models atom in the Tree View (runs all executable models)
d) remotely with another atom (e.g. as part of a Sweep study.
The tree path of a model that provides variables (e.g. "root.models.genericInput").
Leave this input field empty if you
- do not want to inject variable values into the query code or you
- only want to use the ("global") variables jobId and studyId.
Choose the type of database that you want to modify. The visibility of the following arguments might depend on the type.
The path to some *.sqlite file (not relevant for the type mySql).
The host name or IP address of a MySQL server, for example "fooserver" or "153.96.123.456".
The port number of a MySQL server, for example 3306.
A single MySQL database can include several "sub databases", called "schema". Please specifiy the name of the schema that contains the table you would like to modify.
The user name, for example "root".
A password only needs to be specified if the database is password protected.
The query to be executed. The query might contain variable placeholders (e.g. {$jobId$}) that are replaced with the actual variable values before the query is executed.
A preview of the resulting query (including injected variable values).