QQL includes a converter that translates Qdrant REST API JSON payloads to native QQL statements. Use it to migrate from the REST API or the Python qdrant-client SDK.
qql-go convert
Section titled “qql-go convert”From a file:
qql-go convert payload.jsonFrom stdin:
echo '{"points":[{"id":1,"payload":{"text":"hi"}}]}' | qql-go convertcat payload.json | qql-go convertValidate Output
Section titled “Validate Output”qql-go convert --validate payload.jsonRuns the generated QQL through EXPLAIN to verify it parses correctlySection titled “Runs the generated QQL through EXPLAIN to verify it parses correctly”JSON Output
Section titled “JSON Output”qql-go convert --json payload.jsonQuiet Output (QQL Only)
Section titled “Quiet Output (QQL Only)”qql-go convert --quiet payload.jsonOutputs only the QQL statements, no headers or decorationSection titled “Outputs only the QQL statements, no headers or decoration”Supported Operations
Section titled “Supported Operations”The converter auto-detects the operation type from the JSON structure:
| REST Operation | QQL Output |
|---|---|
| Create collection | CREATE COLLECTION |
| Create field index | CREATE INDEX ON |
| Upsert points | INSERT INTO ... VALUES (including vector data) |
| Search points | QUERY ... FROM |
| Query points (with prefetch/formula/fusion) | WITH ... QUERY ... PREFETCH ... FUSION |
| Recommend points | QUERY RECOMMEND WITH (...) |
| Discover points | QUERY DISCOVER TARGET ... |
| Scroll points | SCROLL FROM |
| Get points | SELECT * FROM ... WHERE id = ... |
| Delete points | DELETE FROM ... WHERE |
| Set payload | UPDATE ... SET PAYLOAD = {...} |
Gateway Convert RPC
Section titled “Gateway Convert RPC”The gateway exposes a Convert RPC for remote conversion:
curl -X POST http://localhost:50051/qql.QQL/Convert-H "Content-Type: application/json"-d '{"json_payload": "{"points":[{"id":1,"payload":{"text":"hello"}}]}"}'Response:
{ "ok": true, "statements": [ "INSERT INTO <collection> VALUES {'id': 1, 'text': 'hello'}" ]}Python SDK Interceptor
Section titled “Python SDK Interceptor”Migrate from the qdrant-client Python SDK by intercepting HTTP calls and converting them to QQL.
uv venv .venv && source .venv/bin/activate && uv pip install qdrant-clientRun Interceptor
Section titled “Run Interceptor”Print converted QQL to stdoutSection titled “Print converted QQL to stdout”python3 sdks/python/qql_intercept.py your_script.pySave to fileSection titled “Save to file”python3 sdks/python/qql_intercept.py your_script.py -o output.qqlThe interceptor wraps QdrantClient at the HTTP layer, captures all REST JSON requests, and pipes them through qql-go convert. The result is a .qql file of your script's Qdrant operations.
Example
Section titled “Example”Given my_script.py:
from qdrant_client import QdrantClientclient = QdrantClient("localhost", port=6333)client.upsert("docs", points=[PointStruct(id=1, payload={"text": "hello"}, vector=[0.1, 0.2, 0.3])])client.search("docs", query_vector=[0.1, 0.2, 0.3], limit=5)Running the interceptor:
python3 sdks/python/qql_intercept.py my_script.py -o out.qqlProduces out.qql:
INSERT INTO docs VALUES {'id': 1, 'text': 'hello', 'vector': {'': [0.1, 0.2, 0.3]}}QUERY [0.1, 0.2, 0.3] FROM docs LIMIT 5Workflow: Full Migration
Section titled “Workflow: Full Migration”Step 1: Run interceptor against your existing scriptSection titled “Step 1: Run interceptor against your existing script”python3 sdks/python/qql_intercept.py ingest.py -o ingest.qqlStep 2: Validate the outputSection titled “Step 2: Validate the output”qql-go convert --validate ingest.qqlStep 3: Review and edit the .qql file as neededSection titled “Step 3: Review and edit the .qql file as needed”Step 4: Execute with qql-goSection titled “Step 4: Execute with qql-go”qql-go execute ingest.qql