Skip to content
Dmitry Kochin edited this page Jul 11, 2018 · 5 revisions

You can communicate with Ties.DB node directly via Ties.DB protocol. However it is not always convinient. That is why Ties.DB clients support TiQL (Ties.DB query language).

TiQL is a SQL-like query language supported by Ties.DB clients. As of Alpha release TiQL only supports SELECT queries. Data modification queries are going to be added in future releases and should be made with API for now.

Synopsis

SELECT * | select_expression[::type], ...
FROM [keyspace_name.] table_name 
[WHERE filter_condition
   [AND filter_condition...] 

select_expression

Sets the column to retrieve from each row in a comma separated list. At least one expression is required.

  • * - Returns all column values
  • aggregate(arguments) - Returns the selected column values and executes the aggregate to return a single result row. You can use the following aggregates: COUNT(), MIN(), MAX(), SUM(), AVG().
  • function(arguments) - Executes a native Cassandra function on each target value in the returned set.
  • ::type - you can specify Ties.DB type to cast the selection result to should there be any ambiguity. The list of Ties.DB types can be found here.

AS alias

Replaces the column name in the result set to the alias name.

column_name AS alias

filter_condition

A logical expression. Ties.DB returns only those rows that return true for each relation. A relation can consist of:

column_name operator term
| column_name IN ( term , term [,  term ] . . .]

operator

The logical symbol that specifies the relationship between the two sides of the relation. Casandra supports the following operators:

= | < | > | <= | >=

term

  • a constant: string, number, uuid, boolean, hex
  • a function

Clone this wiki locally