create.cwl

 1#!/usr/bin/env cwl-runner
 2### Table/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 executes DDL to drop and recreate
30  a table, a view or a materialized view in the database.
31  By default, it is assumed it is run for Medicaid domain,
32  parameter `domain` must be defined if using a different domain
33
34
35inputs:
36  #$import: db.yaml
37  table:
38    type: string
39    doc: the name of the table to be created
40    inputBinding:
41      prefix: --table
42  database:
43    type: File
44    doc: Path to database connection file, usually database.ini
45    inputBinding:
46      prefix: --db
47  connection_name:
48    type: string
49    doc: The name of the section in the database.ini file
50    inputBinding:
51      prefix: --connection
52  sloppy:
53    type: boolean
54    default: false
55    inputBinding:
56      prefix: --sloppy
57  domain:
58    type: string
59    default:  "medicaid"
60    inputBinding:
61      prefix: --domain
62  action:
63    type: string?
64    inputBinding:
65      prefix: --action
66  registry:
67    type: string?
68    inputBinding:
69      prefix: --registry
70  input_data:
71    type: File?
72    inputBinding:
73      prefix: --data
74  limit:
75    type: string?
76    inputBinding:
77      prefix: --limit
78
79  depends_on:
80    type:
81      - File?
82      - File[]
83    doc: a special field used to enforce dependencies and execution order
84
85arguments:
86    - valueFrom: "--reset"
87
88
89outputs:
90  log:
91    type: File
92    outputBinding:
93      glob: "*.log"
94  errors:
95    type: stderr
96
97stderr: $("create_" + inputs.table + ".err")