|
|
# HOTMapper Commands
|
|
|
|
|
|
Updated with v1.0.
|
|
|
Updated with v1.1.
|
|
|
|
|
|
This page contains information about all HOTMapper commands.
|
|
|
|
... | ... | @@ -14,6 +14,10 @@ This page contains information about all HOTMapper commands. |
|
|
* [Remap](#remap)
|
|
|
* [Update From file](#update_from_file)
|
|
|
* [Run Aggregations](#run_aggregations)
|
|
|
* [Execute Sql Group](#execute_sql_group)
|
|
|
* [Drop Group](#drop_group)
|
|
|
* [Rebuild Group](#rebuild_group)
|
|
|
* [Run Script](#run_script)
|
|
|
|
|
|
#### Basic Format
|
|
|
All HOTMapper commands follow the pattern bellow:
|
... | ... | @@ -36,6 +40,8 @@ $ ./manage.py create <table_name> |
|
|
~~~bash
|
|
|
$ ./manage.py create table_test
|
|
|
~~~
|
|
|
* Optional arguments:
|
|
|
* `--ignore_definitions`: If set true, it will ignore the columns from table definition if both, table_definitions and mapping_protocol, exists (though it will still get primary_key, foreign_key and source information)'''
|
|
|
|
|
|
#### insert
|
|
|
The insert command puts the data from a csv file into a specified table. The commands needs the absolute path of the
|
... | ... | @@ -75,6 +81,10 @@ $ ./manage.py remap <table_name> |
|
|
~~~bash
|
|
|
$ ./manage.py remap table_test
|
|
|
~~~
|
|
|
* Optional arguments:
|
|
|
* `--auto_confirmation`: If set true, remap will not ask before doing any operation. Default=False
|
|
|
* `--verify_definitions`: If set true, remap will ask about any diference between the mapping_protocol and the table_definition columns.
|
|
|
|
|
|
|
|
|
#### update_from_file
|
|
|
With the update_from_file command is possible to update columns from a database table. It's used when the pairing of a
|
... | ... | @@ -95,4 +105,56 @@ $ ./manage.py run_aggregations <table_name> |
|
|
* Example:
|
|
|
~~~bash
|
|
|
$ ./manage.py run_aggregations table_test
|
|
|
~~~ |
|
|
\ No newline at end of file |
|
|
~~~
|
|
|
|
|
|
#### execute_sql_group
|
|
|
This command execute a group of sql scripts, the group can be defined in the `groups.py` file or it can be a list of files using the `--files` argument.
|
|
|
~~~bash
|
|
|
$ ./manage.py execute_sql_group <group_name>
|
|
|
~~~
|
|
|
* Example
|
|
|
~~~bash
|
|
|
$ ./manage.py execute_sql_group base
|
|
|
~~~
|
|
|
* Optional arguments:
|
|
|
* `--sql_path`: folder which contains the sql scripts. Default=SCRIPTS_FOLDER (`settings.py`)
|
|
|
* `--files`: List of files to be executed. Eg.: --files="file1.sql,file2.sql,..."
|
|
|
|
|
|
#### drop_group
|
|
|
This commands drop a group of tables defined in the `groups.py` file or passed as a list using `--files`.
|
|
|
It will be executed in the reverse order as defined to prevent dependencies.
|
|
|
~~~bash
|
|
|
$ ./manage.py drop_group <group_name>
|
|
|
~~~
|
|
|
* Example
|
|
|
~~~bash
|
|
|
$ ./manage.py drop_group base
|
|
|
~~~
|
|
|
* Optional arguments:
|
|
|
* `--files`: List of tables to be dropped. Eg.: --files="table1,table2,..."
|
|
|
|
|
|
#### rebuild_group
|
|
|
Execute the drop_group command followed by the execute_sql_group.
|
|
|
~~~bash
|
|
|
$ ./manage.py rebuild_group <group_name>
|
|
|
~~~
|
|
|
* Example
|
|
|
~~~bash
|
|
|
$ ./manage.py rebuild_group base
|
|
|
~~~
|
|
|
* Optional arguments:
|
|
|
* `--sql_path`: folder which contains the sql scripts. Default=SCRIPTS_FOLDER (`settings.py`)
|
|
|
* `--files`: List of files to be executed. Eg.: --files="file1.sql,file2.sql,..."
|
|
|
|
|
|
#### run_script
|
|
|
Runs a sql, python or bash script from the scripts folder, the arguments of the script needs to be passed as a string.
|
|
|
~~~bash
|
|
|
$ ./manage.py run_script <script_name>
|
|
|
~~~
|
|
|
* Example
|
|
|
~~~bash
|
|
|
$ ./manage.py run_script test_reference.sql
|
|
|
~~~
|
|
|
* Optional arguments:
|
|
|
* `--folder`: folder which contains the script. Default=SCRIPTS_FOLDER (`settings.py`)
|
|
|
* `--args`: List of arguments used in the script. Eg.: --args="arg1,arg2,..." |