Statement Quick Reference

Statement

Purpose

create bucket <name> (<schema>)

Create a bucket; error if it already exists.

create unique bucket <name> (<schema>)

Create a bucket only if it does not already exist.

create forced bucket <name> (<schema>)

Always create the bucket, dropping any existing one.

create forced unique bucket <name> (<schema>)

Drop and recreate if exists; create if not.

create ... bucket <name> from csv("<file>")

Create and populate a bucket from a CSV file.

truncate <bucket>

Remove all records; preserve schema.

drop <field> from <bucket>

Permanently remove a field from the schema and all records.

describe <bucket>

Print the bucket’s field schema.

show buckets

List all buckets.

insert into <bucket> (<values>)

Insert a single record (positional or named).

insert into <bucket> ([...], [...])

Insert multiple records in one statement.

get <fields> from <bucket>

Retrieve records, with optional projection, filtering, and ordering.

get head(<n>) from <bucket>

Retrieve the first n records.

get tail(<n>) from <bucket>

Retrieve the last n records.

set <bucket> (<assignments>) where <cond>

Update all matching records.

delete from <bucket> where <cond>

Delete all matching records.

export <bucket> to csv("<file>")

Export all records to a CSV file.

analyze <bucket> <field> stream(<n>)

Sliding-window real-time metrics.

analyze <bucket> <field> timeseries

Trend detection, forecasting, and anomaly detection.

analyze <bucket> <field> statistics

Comprehensive descriptive statistics.

analyze <bucket> <field> correlation(<field2>)

Pearson correlation between two fields.

analyze <bucket> <field> percentile(<n>)

The n-th percentile value.

analyze <bucket> <field> window(<func>, <n>)

Per-row window function (row_number, rank, dense_rank, percent_rank).

begin!

Begin an explicit transaction block.

commit!

Commit the current transaction (explicit or implicit).

rollback!

Roll back all changes in the current explicit transaction block.

print "<message>"

Write a string to standard output.