1#!/usr/bin/env cwl-runner
2### Generic Table (View/Materialized View) Initializer
3# Copyright (c) 2021. Harvard University
4#
5# Developed by Research Software Engineering,
6# Faculty of Arts and Sciences, Research Computing (FAS RC)
7# Author: Michael A Bouzinier
8#
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20#
21
22cwlVersion: v1.2
23class: CommandLineTool
24baseCommand: [python, -m, dorieh.platform.loader.data_loader]
25requirements:
26 InlineJavascriptRequirement: {}
27
28doc: |
29 This tool drops the tables and deletes all previous data from the database
30
31
32inputs:
33 registry:
34 type: File?
35 inputBinding:
36 prefix: --registry
37 doc: |
38 A path to the data model file
39 domain:
40 type: string
41 doc: the name of the domain
42 inputBinding:
43 prefix: --domain
44 table:
45 type: string?
46 inputBinding:
47 prefix: --table
48 default: ps
49 doc: the name of the table being deleted
50 database:
51 type: File
52 doc: Path to database connection file, usually database.ini
53 inputBinding:
54 prefix: --db
55 connection_name:
56 type: string
57 doc: The name of the section in the database.ini file
58 inputBinding:
59 prefix: --connection
60
61arguments:
62 - valueFrom: "--reset"
63
64
65outputs:
66 log:
67 type: File
68 outputBinding:
69 glob: "*.log"
70 errors:
71 type: stderr
72
73stderr: $("reset-" + inputs.table + ".err")