-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpretty-sql-print.xml
62 lines (58 loc) · 1.72 KB
/
pretty-sql-print.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<joblist>
<job>
<defaultTab>output</defaultTab>
<description></description>
<executionEnabled>true</executionEnabled>
<group>MultilinesRegex</group>
<loglevel>INFO</loglevel>
<name>pretty-sql-print</name>
<nodeFilterEditable>false</nodeFilterEditable>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<plugins>
<LogFilter type='key-value-data-multilines'>
<config>
<hideOutput>true</hideOutput>
<logData>false</logData>
<name>sql</name>
<regex>^.*name\s*(.+)$</regex>
</config>
</LogFilter>
</plugins>
<script><![CDATA[mysql -h mysqlserver --username=username --password=password -e "listprojects.sql"]]></script>
<scriptargs />
</command>
<command>
<fileExtension>.py</fileExtension>
<plugins>
<LogFilter type='render-datatype'>
<config>
<datatype>text/html</datatype>
</config>
</LogFilter>
</plugins>
<script><![CDATA[sallist="""@data.sql@"""
print("<table class='table table-striped'>")
print("<tr>")
print("<th>id</th>")
print("<th>name</th>")
print("<th>data created</th>")
print("<th>description</th>")
print("</tr>")
for line in sallist.splitlines():
column=line.split("\t")
print("<tr>")
print("<th>%s</th>" % column[0])
print("<td>%s</td>" % column[5])
print("<td>%s</td>" % column[2])
print("<td>%s</td>" % column[3])
print("</tr>")
print("</table>")
]]></script>
<scriptargs />
<scriptinterpreter>python</scriptinterpreter>
</command>
</sequence>
</job>
</joblist>