annotate sqlite_to_tabular.xml @ 20:ab27c4bd14b9 draft

Uploaded
author jjohnson
date Fri, 14 Jul 2017 11:39:27 -0400
parents
children 357fe86f245d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
1 <?xml version="1.0"?>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
2 <tool id="sqlite_to_tabular" name="SQLite to tabular" version="5.0.0">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
3 <description>for SQL query</description>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
4
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
5 <macros>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
6 <import>macros.xml</import>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
7 </macros>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
8
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
9 <stdio>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
10 <exit_code range="1:" level="fatal" description="Error" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
11 </stdio>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
12 <command><![CDATA[
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
13 python $__tool_directory__/sqlite_to_tabular.py
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
14 --sqlitedb="$sqlitedb"
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
15 --query_file="$query_file"
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
16 $no_header
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
17 --output="$query_results"
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
18 ]]></command>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
19 <configfiles>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
20 <configfile name="query_file">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
21 $sqlquery
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
22 </configfile>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
23 </configfiles>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
24 <inputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
25 <param name="sqlitedb" type="data" format="sqlite" label="SQLite Database"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
26 <param name="sqlquery" type="text" area="True" size="120x20" label="SQL query">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
27 <validator type="regex">(?ims)^\s*SELECT\s.*\sFROM\s.*$</validator>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
28 <sanitizer sanitize="False"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
29 </param>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
30 <param name="no_header" type="boolean" truevalue="-n" falsevalue="" checked="False" label="Omit column headers"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
31 </inputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
32 <outputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
33 <data name="query_results" format="tabular" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
34 </outputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
35 <tests>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
36 <test>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
37 <param name="sqlitedb" ftype="sqlite" value="testdb.sqlite" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
38 <param name="sqlquery" value="SELECT first_name, last_name, age FROM contacts WHERE first_name = 'Sam'" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
39 <output name="query_results">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
40 <assert_contents>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
41 <has_text text="Smith" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
42 <not_has_text text="Doe" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
43 </assert_contents>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
44 </output>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
45 </test>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
46 </tests>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
47 <help><![CDATA[
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
48 =================
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
49 SQLite to Tabular
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
50 =================
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
51
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
52 **Inputs**
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
53
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
54 An existing SQLite_ data base.
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
55
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
56
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
57 **Outputs**
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
58
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
59 The results of a SQL query are output to the history as a tabular file.
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
60
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
61
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
62
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
63 @QUERY_HELP@
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
64
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
65 ]]></help>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
66 </tool>