diff --git a/doc/cql/CQL.html b/doc/cql/CQL.html new file mode 100644 index 0000000000..499a6b8808 --- /dev/null +++ b/doc/cql/CQL.html @@ -0,0 +1,16 @@ +
Synopsis:
USE <KEYSPACE>;
+A USE statement consists of the USE keyword, followed by a valid keyspace name. Its purpose is to assign the per-connection, current working keyspace. All subsequent keyspace-specific actions will be performed in the context of the supplied value.
Synopsis:
SELECT [FROM] <COLUMN FAMILY> [USING <CONSISTENCY>]
+ WHERE <EXRESSION> [ROWLIMIT N] [COLLIMIT N] [ASC | DESC];
+A SELECT is used to read one or more records from a Cassandra column family. It returns a result-set of rows, where each row consists of a key and a collection of columns corresponding to the query.
SELECT [FROM] <COLUMN FAMILY> ...
+Statements begin with the SELECT keyword followed by a Cassandra column family name. The keyword FROM can be used as a delimiter to improve readability, but is not required.
SELECT ... [USING <CONSISTENCY>] ...
+Following the column family identifier is an optional consistency level specification.
SELECT ... <EXPRESSION>
+SELECT ... [[KEY | COL] [> | >= | = | < | <=] TERM] [[AND ...] ...]
+The expression portion of a CQL SELECT statement consists of one or more relations delimited by the AND keyword. Relations are defined as one of either the KEY or COLUMN keywords, a relational operator (>, >=, =, <, <=), and a term.
NOTE: The keyword COLUMN can be abbreviated as COL.
NOTE: Key and column ranges are always inclusive so the semantics of >= and >, and <= and < are identical. This is subject to change.
SELECT ... <EXPRESSION> [ROWLIMIT N | COLLIMIT N] ...
+Limiting the number of row and/or column results can be achieved by including one or both of the optional ROWLIMIT and COLLIMIT clauses after a SELECT expression.
SELECT ... [[ASC | ASCENDING] | [DESC | DESCENDING]]
+By default, results are returned in the order determined by the column family comparator, this is always considered ascending order. Reversing this sort order is possible by supplying the DESCENDING clause in SELECT statements.
The ASCENDING keyword is also included, both for completeness sake, and to improve statement readability if desired. It has no effect otherwise.
NOTE: The keywords ASC and DESC are valid abbreviations for ASCENDING and DESCENDING respectively.
Synopsis:
UPDATE <COLUMN FAMILY> [USING CONSISTENCY.<CL>] WITH
+ ROW(<KEY>, COL(<NAME>, <VALUE>), ...);
+An UPDATE is used to write one or more records to a Cassandra column family. No results are returned.
UPDATE <COLUMN FAMILY> ...
+Statements begin with the UPDATE keyword followed by a Cassandra column family name.
SELECT ... [USING <CONSISTENCY>] ...
+Following the column family identifier is an optional consistency level specification.
... WITH ROW(<KEY>, COL(<NAME>, <VALUE>), ...)[, ROW(<KEY>, ...)];
+Rows are constructed by creating a parenthesized expression using the ROW keyword. Within the parenthesis, row specifications contain a key term, followed by a comma, and one or more comma delimited column specifications. Columns are in turn a parenthesized expression using the COLUMN keyword, with two comma delimited term arguments, the column name and value respectively. More than one row can be specified by separating them with commas.
NOTE: While there are no isolation guarantees, UPDATE queries are atomic.
... USING <CONSISTENCY> ...
+Consistency level specifications are made up the keyword USING, followed by a consistency level identifier. Valid consistency levels are as follows:
CONSISTENCY.ZEROCONSISTENCY.ONE (default)CONSISTENCY.QUORUMCONSISTENCY.ALLCONSISTENCY.DCQUORUMCONSISTENCY.DCQUORUMSYNCWhere possible, the type of terms are inferred; the following term types are supported:
String literals are any value enclosed in double-quotes, (`"`). String literals are treated as raw bytes; no interpolation is performed.
Integers are any term consisting soley of unquoted numericals, longs are any otherwise valid integer term followed by an upper case “L”, (e.g. 100L). It is an error to specify an integer term that will not fit in 4 bytes unsigned, or a long that will not fit in 8 bytes unsigned.
\ No newline at end of file diff --git a/doc/cql/CQL.textile b/doc/cql/CQL.textile new file mode 100644 index 0000000000..fd1df853b8 --- /dev/null +++ b/doc/cql/CQL.textile @@ -0,0 +1,120 @@ +h1. Cassandra Query Language (CQL) v0.99.0 + +h2. Table of Contents + +{toc} + +h2. SELECT + +__Synopsis:__ + +bc. +SELECT [FROM]