1KYUA-DB-EXEC(1)           BSD General Commands Manual          KYUA-DB-EXEC(1)
2

NAME

4     kyua db-exec — Executes a SQL statement in a results file
5

SYNOPSIS

7     kyua db-exec [--no-headers] [--results-file file] statement
8

DESCRIPTION

10     The kyua db-exec command provides a way to execute an arbitrary SQL
11     statement within the database.  This command is mostly intended to aid in
12     debugging, but can also be used to extract information from the database
13     when the current interfaces do not provide the desired functionality.
14
15     The input database must exist.  It makes no sense to use kyua db-exec on
16     an non-existent or empty database.
17
18     The kyua db-exec command takes one or more arguments, all of which are
19     concatenated to form a single SQL statement.  Once the statement is exe‐
20     cuted, kyua db-exec prints the resulting table on the screen, if any.
21
22     The following subcommand options are recognized:
23
24     --no-headers
25         Avoids printing the headers of the table in the output of the com‐
26         mand.
27
28     --results-file path, -s path
29         Specifies the results file to operate on.  Defaults to ‘LATEST’,
30         which causes kyua db-exec to automatically load the latest results
31         file from the current test suite.
32
33         The following values are accepted:
34
35         ‘LATEST’
36             Requests the load of the latest results file available for the
37             test suite rooted at the current directory.
38
39         Directory
40             Requests the load of the latest results file available for the
41             test suite rooted at the given directory.
42
43         Test suite name
44             Requests the load of the latest results file available for the
45             given test suite.
46
47         Results identifier
48             Requests the load of a specific results file.
49
50         Explicit file name (aka everything else)
51             Load the specified results file.
52
53         See Results files for more details.
54
55   Results files
56     Results files contain, as their name implies, the results of the execu‐
57     tion of a test suite.  Each test suite executed by kyua-test(1) generates
58     a new results file, and such results files can be loaded later on by
59     inspection commands such as kyua-report(1) to analyze their contents.
60
61     Results files support identifier-based lookups and also path name
62     lookups.  The differences between the two are described below.
63
64     The default naming scheme for the results files provides simple support
65     for identifier-based lookups and historical recording of test suite runs.
66     Each results file is given an identifier derived from the test suite that
67     generated it and the time the test suite was run.  Kyua can later look up
68     results files by these fileds.
69
70     The identifier follows this pattern:
71
72           <test_suite>.<YYYYMMDD>-<HHMMSS>-<uuuuuu>
73
74     where ‘test_suite’ is the path to the root of the test suite that was run
75     with all slashes replaced by underscores and ‘YYYYMMDD-HHMMSS-uuuuuu’ is
76     a timestamp with microsecond resolution.
77
78     When using the default naming scheme, results files are stored in the
79     ~/.kyua/store/ subdirectory and each file holds a name of the form:
80
81           ~/.kyua/store/results.<identifier>.db
82
83     Results files are simple SQLite databases with the schema described in
84     the /usr/share/kyua/store/schema_v?.sql files.  For details on the
85     schema, please refer to the heavily commented SQL file.
86

EXIT STATUS

88     The kyua db-exec command returns 0 on success or 1 if the SQL statement
89     is invalid or fails to run.
90
91     Additional exit codes may be returned as described in kyua(1).
92

SEE ALSO

94     kyua(1), kyua-test(1)
95
96BSD                            October 13, 2014                            BSD
Impressum