0
|
1 <?xml version="1.0"?>
|
|
2 <tool id="sqlite_to_tabular" name="SQLite to tabular" version="0.0.1">
|
2
|
3 <description>for SQL query</description>
|
|
4 <stdio>
|
|
5 <exit_code range="1:" level="fatal" description="Error" />
|
|
6 </stdio>
|
|
7 <configfiles>
|
|
8 <configfile name="query_file">
|
|
9 $sqlquery
|
|
10 </configfile>
|
|
11 </configfiles>
|
|
12
|
|
13 <command interpreter="python">
|
|
14 sqlite_to_tabular.py
|
|
15 --sqlitedb="$sqlitedb"
|
|
16 --query_file="$query_file"
|
|
17 $no_header
|
|
18 --output="$query_results"
|
|
19 </command>
|
|
20 <inputs>
|
|
21 <param name="sqlitedb" type="data" format="sqlite" label="SQLite Database"/>
|
|
22 <param name="sqlquery" type="text" area="True" size="120x20" label="SQL query">
|
|
23 <validator type="regex">^(?im)\s*SELECT\s.*\sFROM\s.*$</validator>
|
|
24 <sanitizer sanitize="False"/>
|
|
25 </param>
|
|
26 <param name="no_header" type="boolean" truevalue="-n" falsevalue="" checked="False" label="Omit column headers"/>
|
|
27 </inputs>
|
|
28 <outputs>
|
|
29 <data name="query_results" format="tabular" />
|
|
30 </outputs>
|
|
31 <tests>
|
|
32 <test>
|
|
33 <param name="sqlitedb" ftype="sqlite" value="testdb.sqlite" />
|
|
34 <param name="sqlquery" value="SELECT first_name, last_name, age FROM contacts WHERE first_name = 'Sam'" />
|
|
35 <output name="query_results">
|
|
36 <assert_contents>
|
|
37 <has_text text="Smith" />
|
|
38 <not_has_text text="Doe" />
|
|
39 </assert_contents>
|
|
40 </output>
|
|
41 </test>
|
|
42 </tests>
|
|
43 <help>
|
|
44 Outputs the results of a query on a SQLite Database as a tabular file.
|
|
45 </help>
|
0
|
46 </tool>
|