Skip to content

Scripts and errors

QQL scripts are for repeatable provisioning, migrations, fixtures, and batched operations. Parse a script once, retain its statements, apply any trusted rewrite, and then plan or execute the result.

Statements are separated by one semicolon; a final semicolon is optional. Empty separators, adjacent unseparated statements, and scripts over 256 statements are rejected.

QQLProvision a catalog and query itTry in playground
CREATE COLLECTION catalog (
dense VECTOR(384, COSINE)
);
CREATE INDEX ON COLLECTION catalog
FOR category
TYPE keyword;
UPSERT INTO catalog VALUES {
id: 1,
text: 'red chair',
category: 'furniture'
};
QUERY TEXT 'chair'
FROM catalog
USING dense
LIMIT 5;
APIContract
Parser::parseOne complete statement only
Parser::parse_allOne complete semicolon-delimited script
SDK parseHost-language statement handles or objects
compile / explainOffline plan inspection
Executor or client executeOne statement, a script, or host array input

Host arrays are independent inputs. A semicolon-delimited script is one input that the runtime parses together, which matters when batching compatible operations.

Errors carry a stable code, kind, message, and optional zero-based UTF-8 byte span. Message text is not normative — match on the code. The stable codes are grouped by their prefix; see Error codes for the full list with meanings.

Code prefixFamilyExamples
QQL-LEX-*Lexical failuresQQL-LEX-STRING
QQL-PARSE-*Syntax, clause order, and value-range failuresQQL-PARSE-STATEMENT, QQL-PARSE-CLAUSE-ORDER, QQL-PARSE-DUPLICATE-KEY, QQL-PARSE-POSITIVE-INTEGER
QQL-VALIDATION-*Semantic validation of a parsed programQQL-VALIDATION-FROM, QQL-VALIDATION-UPSERT-ID, QQL-VALIDATION-MMR
QQL-PLAN-*, QQL-MISSING-*, QQL-UNKNOWN-*, QQL-VECTOR-KINDPlanning and schema resolutionQQL-PLAN-VECTOR-KIND, QQL-MISSING-USING, QQL-UNKNOWN-VECTOR
QQL-EMBEDDING-*UPSERT embedding inferenceQQL-EMBEDDING-TOPOLOGY, QQL-EMBEDDING-TARGET
QQL-EDGE-*In-process edge backend capability and runtime failuresQQL-EDGE-UNSUPPORTED-GROUP-BY, QQL-EDGE-INVALID-POINT-ID
Transport / backendNetwork and Qdrant response failures during executionQQL-* from the transport layer

A code already asserted by a v1 invalid fixture cannot change before v2. New codes may only refine previously unspecified cases.

SituationExample code familyWhat to do
Syntax or clause orderQQL-PARSE-*Show the span and preserve the user source
Missing required query structureQQL-VALIDATION-*Add the required FROM, PREFETCH, or valid parameter
Vector-role conflictQQL-PLAN-VECTOR-KINDAlign the query role with the collection topology
Service policy cannot be appliedpolicy errorReject the request rather than weakening the predicate

The Playground shows the same source, AST, compiled route, and explanation without connecting to Qdrant until you choose to run it.