QQL supports multi-statement script files for automating setup, migrations, and operational workflows.
Script Format
Section titled “Script Format”Scripts are plain text files with .qql extension. Statements are separated by newlines. Comments start with --.
-- my-workflow.qql
-- Setup collectionCREATE COLLECTION docs HYBRID WITH HNSW (m = 32, ef_construct = 100) WITH QUANTIZATION (type = 'scalar')
-- Create indexesCREATE INDEX ON docs FOR category TYPE keywordCREATE INDEX ON docs FOR year TYPE integer
-- Insert dataINSERT INTO docs VALUES {'id': 1, 'text': 'First document', 'category': 'tech', 'year': 2024} USING HYBRIDINSERT INTO docs VALUES {'id': 2, 'text': 'Second document', 'category': 'science', 'year': 2025} USING HYBRID
-- VerifySHOW COLLECTION docsSCROLL FROM docs LIMIT 5Execute a Script
Section titled “Execute a Script”qql-go execute my-workflow.qqlStop on first error (recommended for setup scripts)Section titled “Stop on first error (recommended for setup scripts)”qql-go execute --stop-on-error my-workflow.qqlStructured JSON outputSection titled “Structured JSON output”qql-go execute --quiet --json my-workflow.qqlCollection Dump
Section titled “Collection Dump”Export a collection as a runnable QQL script:
qql-go dump docs backup.qqlControl batch size (default: 100 points per INSERT statement)Section titled “Control batch size (default: 100 points per INSERT statement)”qql-go dump --batch-size 500 docs backup.qqlJSON outputSection titled “JSON output”qql-go dump --quiet --json docs backup.qqlThe dump output includes:
CREATE COLLECTIONstatement with all config (HNSW, quantization, named vectors)CREATE INDEXstatements for all payload indexesINSERT INTO ... VALUESstatements for all points (batched)
REPL Shortcuts
Section titled “REPL Shortcuts”From the interactive REPL:
\e <file> Execute a .qql file \dump <collection> <file> Dump a collection to a .qql fileExample sessionSection titled “Example session”qql-go repl\e setup.qql \dump docs backup.qqlUse Cases
Section titled “Use Cases”| Script | Purpose |
|---|---|
create-collection.qql | Provision a collection with indexes |
seed-data.qql | Insert test or seed data |
backup.qql | Full collection export (from dump) |
migration.qql | Schema or data migration |
regression.qql | CI smoke test queries |
cleanup.qql | Drop collections after testing |
CI Integration
Section titled “CI Integration”- name: Run QQL smoke tests run: | qql-go connect --url ${{ secrets.QDRANT_URL }} --secret ${{ secrets.QDRANT_SECRET }} qql-go execute --stop-on-error --quiet --json examples/release-validation/validate.qqlScript from Go SDK
Section titled “Script from Go SDK”// Run a script file via ExecBatchlines := readLines("workflow.qql") // strip comments, split by newlineresults, err := qql.ExecBatch(ctx, client, lines, true)