Skip to content

Couchbase SQL Parser Support in GSP

Explore the Couchbase SQL Parser product page

This page documents the SQL syntax support for Couchbase N1QL in the General SQL Parser.

Syntax Coverage Corpus

GSP tests Couchbase syntax against 38 documented constructs grouped into 16 categories, each cross-referenced to the documentation that defines it (36 distinct source pages).

Parse coverage

Measured against GSP Java 4.2.8 on 2026-08-31 (UTC) (artifact sha256 1117856ef134). Each construct below carries the complete set of examples from the Couchbase documentation; a construct counts as fully covered only when every one of its examples parses. Percentages are pass rates over this documented-example corpus — not a percentage of the entire SQL dialect.

Constructs fully parsed Individual statements parsed
All constructs 30 of 38 (79%) 208 of 233 (89%)
SELECT (queries) 11 of 14 (79%) 97 of 108 (90%)
DML (INSERT / UPDATE / DELETE / MERGE) 6 of 6 (100%) 39 of 39 (100%)
Stored procedures

Statements are split using the parser's own statement splitter, so multi-statement examples and procedure bodies are counted correctly. The SELECT, DML and stored-procedure rows classify each statement by its parsed statement type: a construct is counted in a row when its examples contain at least one statement of that class, and is fully parsed when all of them parse. Stored procedures covers CREATE PROCEDURE / FUNCTION / PACKAGE / TRIGGER definitions and anonymous blocks.

Machine-readable: dialect data (JSON) · all-dialect matrix · coverage matrix overview

All 38 constructs

Construct Category Parses Specified in
ALTER INDEX ALTER 0 of 4 Couchbase docs
BUILD INDEX BUILD INDEX all 2 Couchbase docs
Adaptive Index CREATE INDEX all 17 Couchbase docs
Array Indexing CREATE INDEX all 10 Couchbase docs
Covering Indexes CREATE INDEX all 4 Couchbase docs
CREATE INDEX CREATE INDEX all 4 Couchbase docs
CREATE PRIMARY INDEX CREATE INDEX all 2 Couchbase docs
Index Partitioning CREATE INDEX 20 of 21 Couchbase docs
Indexing Metadata Information CREATE INDEX all 3 Couchbase docs
DELETE DELETE all 6 Couchbase docs
DROP INDEX DROP INDEX all 1 Couchbase docs
DROP PRIMARY INDEX DROP INDEX all 1 Couchbase docs
EXECUTE EXECUTE all 1 Couchbase docs
EXPLAIN EXPLAIN all 2 Couchbase docs
GRANT GRANT 0 of 6 Couchbase docs
INFER INFER all 1 Couchbase docs
INSERT INSERT all 6 Couchbase docs
Insert Select INSERT all 8 Couchbase docs
Insert Values INSERT all 8 Couchbase docs
MERGE MERGE all 3 Couchbase docs
PREPARE PREPARE all 3 Couchbase docs
REVOKE REVOKE 0 of 2 Couchbase docs
FROM Clause SELECT all 8 Couchbase docs
GROUP BY clause SELECT all 5 Couchbase docs
JOIN Clause SELECT 25 of 32 Couchbase docs
LET clause SELECT all 3 Couchbase docs
LIMIT clause SELECT 1 of 2 Couchbase docs
NEST Clause SELECT 5 of 8 Couchbase docs
OFFSET clause SELECT all 1 Couchbase docs
ORDER BY clause SELECT all 2 Couchbase docs
Overview SELECT all 17 Couchbase docs
SELECT Clause SELECT all 13 Couchbase docs
UNION, INTERSECT, and EXCEPT SELECT all 4 Couchbase docs
UNNEST clause SELECT all 5 Couchbase docs
USE Clause SELECT all 4 Couchbase docs
WHERE clause SELECT all 4 Couchbase docs
UPDATE UPDATE all 9 Couchbase docs
UPSERT UPSERT 0 of 1 Couchbase docs

Key Features Supported

  • Standard SQL operations (SELECT, INSERT, UPDATE, DELETE)
  • N1QL-specific functions and data types
  • JSON document operations
  • Window functions and analytical queries
  • Array and object manipulations
  • Full-text search integration