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