tsdb(1) Query Language
The tsdb(1) retrieval frontend interpretes an improper subset of SQL
(the Standard Query Language); following is the tsdb(1) query syntax in
extended Backus-Naur form:
- <query> :==
{ <info> | <set> |
<retrieve> | <insert> } `.'
- <info> :== `info'
- { `all' | `relations' | <relation> |
<tsdb constant> | <tsdb variable> }
- <set> :== `set'
- <tsdb variable>
{ <integer> | <string> }
- <tsdb constant> :==
- { `home' | `tsdb_home'
| `relations-file' | `tsdb_relations_file'
| `data-path' | `tsdb_data_path' }
- <tsdb variable> :==
- { `result-path' | `tsdb_result_path'
| `result-prefix' | `tsdb_result_prefix'
| `max-results' | `tsdb_max_results' }
- <retrieve> :== `retrieve'
- { <attribute>+ | `*' }
[ `from' <relation>+ ]
[ `where' <condition> ]
[ `report' <format string> ]
- <insert> :== `insert' `into'
- <relation> [ <attribute>+ ]
`values' { <integer> |
<string> | <date> }+
- <relation> :== <identifier>
- <attribute> :== <identifier>
- <condition> :==
- { <attribute name>
{ `=' | `!=' | `~' |
`!~' } <string>
| <attribute name>
{ `=' | `!=' | `<' |
`>' | `<=' |
`>=' } <integer>
| <attribute name>
{ `=' | `!=' | `<' |
`>' | `<=' |
`>=' } <date>
| <condition>
{ `&' | `&&' | `and' }
<condition>
| <condition>
{ `|' | `||' | `or' }
<condition>
| { `!' | `not' } <condition>
| `(' <condition> `)'
- <integer> :==
[ { `+' | `-' } ] <digit>+
- <digit> :== { `0' | `1' | ... | `9' }
- <string> :==
- { `"' <any character except `"'>*
`"'
| ``' <any character except `''>*
`'' }
- <date> :==
- { [ <day> `-' ]
<month> `-' <year>
[ [ `(' ] <time> [ `)' ] ]
| `:today' | `:now' }
- <day> :== [ <digit> ] <digit>
- <month> :== [ <digit> ] <digit>
- <year> :==
[ <digit> <digit> ]
<digit> <digit>
- <time> :==
<digit> <digit> `:'
<digit> <digit>
[ `:' <digit> <digit> ]
- <identifier> :==
<character>
{ <character> | <digit> |
`-' | `_'}*
- <character> :==
{ `A' | `B' | ... | `Z' |
`a' | `b' | ... | `z' }
[new query]
[sample queries]
[query statistics]
[tsdb(1) relations]
[TSNLP home]