1#!/usr/bin/env cwl-runner
2### Export a table or a query result to a file system
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.util.pg_export]
25requirements:
26 InlineJavascriptRequirement: {}
27 NetworkAccess:
28 networkAccess: True
29
30doc: |
31 This tool builds all indices for the specified table.
32 Log file displays real-time progress of building indices
33
34
35inputs:
36 table:
37 type: string?
38 doc: the name of the table
39 inputBinding:
40 prefix: --table
41 sql:
42 type: string?
43 doc: SQL query
44 inputBinding:
45 prefix: --sql
46 partition:
47 type: string[]?
48 doc: List of columns to be used for partitioning
49 inputBinding:
50 prefix: --partition
51 output:
52 type: string
53 doc: the name of the newly created file or directory
54 inputBinding:
55 prefix: --output
56 format:
57 type: string
58 doc: Format of the export, one of jsonl, parquet, csv, hdf5
59 inputBinding:
60 prefix: --format
61 database:
62 type: File
63 doc: Path to database connection file, usually database.ini
64 inputBinding:
65 prefix: --db
66 connection_name:
67 type: string
68 doc: The name of the section in the database.ini file
69 inputBinding:
70 prefix: --connection
71 depends_on:
72 type: Any?
73 doc: a special field used to enforce dependencies and execution order
74
75
76
77outputs:
78 data:
79 type:
80 - File
81 - Directory
82 outputBinding:
83 glob: $(inputs.output + "*")
84 log:
85 type: File
86 outputBinding:
87 glob: "*.log"
88 errors:
89 type: stderr
90
91stderr: $("export-" + inputs.table + ".err")