Script to fetch, insert data to provided tables from postgres database.
Prerequisites
- Edit database credentials in core_database.ini file
- Update primary key id_sequence to latest if db insert is being used.
- Make app.py executable with chmod +x app.py
- The project uses python 3.7. You can install the specified version using the following command:
sudo apt-get install python3.7- Install pip and venv:
sudo apt-get install python3-pip
sudo apt-get install python3-venv- Create and activate new virtual environment:
cd ~
python3 -m venv myenv
source ~/myenv/bin/activate- Install requirements:
pip install -r dbworkbench/requirements.txtRun the script:
bash app.py
Arguments:
| Argument | Parameter | Description |
|---|---|---|
-h or --help |
NA | show help message and exit |
-i or --insert |
table msb msb_id countryId |
** table:** table name to insert msb: msb name **msb_id: **MSB's company id countryId: Destination Country Id. All the data for specified table, msb and country will be added. |
-s or --select |
table [columns ...] |
** table:** table to be fetched [columns ...]: list of columns to fetch. Eg: name id Get data of specified tables and columns |
-l or --limit |
limit |
Limit: total number of data to fetch. It can be used along with --select argument to limit the no. of data to be fetched. |
-e or --enable |
type countryId companyId |
Enable payers/bank of specified country id for mto |