handshake.cwl

 1### Workflow checking handshake with the database
 2#  Copyright (c) 2022. Harvard University
 3#
 4#  Developed by Research Software Engineering,
 5#  Faculty of Arts and Sciences, Research Computing (FAS RC)
 6#  Author: Michael A Bouzinier
 7#
 8#  Licensed under the Apache License, Version 2.0 (the "License");
 9#  you may not use this file except in compliance with the License.
10#  You may obtain a copy of the License at
11#
12#         http://www.apache.org/licenses/LICENSE-2.0
13#
14#  Unless required by applicable law or agreed to in writing, software
15#  distributed under the License is distributed on an "AS IS" BASIS,
16#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17#  See the License for the specific language governing permissions and
18#  limitations under the License.
19#
20
21cwlVersion: v1.2
22class: Workflow
23
24doc: |
25  This workflow executes an SQL statement to connect to the database,
26  display version and list tables. SQL can be overridden
27
28inputs:
29  database:
30    type: File
31    doc: Path to database connection file, usually database.ini
32  connection_name:
33    type: string
34    doc: The name of the section in the database.ini file
35  sql:
36    type: string[]
37    default:
38      - |
39        SELECT '___', version()
40        UNION
41        SELECT table_schema, TABLE_NAME 
42        FROM information_schema.tables WHERE table_schema not in ('pg_catalog', 'information_schema')
43        ORDER BY 1
44        ;
45
46steps:
47  psql:
48    run: alter_database.cwl
49    in:
50      database: database
51      connection_name: connection_name
52      sql: sql
53    out:
54      - log
55      - err
56
57
58outputs:
59  psql_log:
60    type: File
61    outputSource: psql/log
62  psql_err:
63    type: File
64    outputSource: psql/err