Skip to content

Latest commit

 

History

History
88 lines (50 loc) · 3.08 KB

databaseModifier.md

File metadata and controls

88 lines (50 loc) · 3.08 KB

Models


DatabaseModifier

The purpose of the DatabaseModifier atom is to modify a database by executing a query.

Source code

./src/model/databaseModifier/databaseModifier.js

Construction

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();	     

Work flow

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.

Properties

Source model

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.

Target database

Type

Choose the type of database that you want to modify. The visibility of the following arguments might depend on the type.

File path

The path to some *.sqlite file (not relevant for the type mySql).

Host

The host name or IP address of a MySQL server, for example "fooserver" or "153.96.123.456".

Port

The port number of a MySQL server, for example 3306.

Schema name

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.

User

The user name, for example "root".

Password

A password only needs to be specified if the database is password protected.

Code

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.

Status

A preview of the resulting query (including injected variable values).


FileCleanup