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