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\usemodule
28 [art01,sqltables]
29
30\setupbodyfont
31 [10pt]
32
33\setupheader
34 [state=high]
35
36\setuptabulate
37 [before={\blank[big,samepage]}]
38
39\starttext
40
41\startluacode
42
43 require("s-sql-tables")
44
45 local arguments = environment.arguments
46
47 local presets = arguments.presets
48 local preloaded = presets and table.load(presets) or { }
49
50 local presets = {
51 host = preloaded.host or arguments.host or "localhost",
52 username = preloaded.username or arguments.username or "root",
53 password = preloaded.password or arguments.password or "",
54 database = preloaded.database or arguments.database or "",
55 }
56
57
58 if arguments.tables then
59 moduledata.sql.tables.showdefined(presets)
60 end
61
62\stopluacode
63
64\stoptext
65 |