velesdb-cli-0.8.2 is not a library.
VelesDB CLI
Interactive CLI and REPL for VelesDB with VelesQL support.
Installation
From crates.io
From source
Usage
Interactive REPL
# Start interactive REPL with default data directory (./data)
# Or specify a data directory
Single Query Execution
# Execute a query directly
# Output as JSON
Database Info
List Collections
# List all collections
# Output as JSON
Show Collection Details
# Show collection schema and stats
# Show with sample records
Import/Export
# Export collection to JSON
# Export without vectors (metadata only)
# Import from JSONL file
# Import from CSV
VelesQL Queries
Vector Search
-- Vector similarity search (uses collection's metric)
SELECT * FROM documents
WHERE VECTOR NEAR [0.15, 0.25, ...]
LIMIT 5;
-- With parameter (for API usage)
SELECT * FROM documents
WHERE VECTOR NEAR $query_vector
LIMIT 10;
ℹ️ Note: The distance metric is defined at collection creation time and cannot be changed per-query. All 5 metrics (Cosine, Euclidean, DotProduct, Hamming, Jaccard) are supported.
Metadata Filtering
Metadata is stored as JSON. Query any field with SQL operators:
-- Equality
SELECT * FROM docs WHERE category = 'tech' LIMIT 10;
-- Numeric comparisons
SELECT * FROM docs WHERE views > 1000 LIMIT 10;
SELECT * FROM docs WHERE price >= 50 AND price <= 200 LIMIT 10;
-- String patterns
SELECT * FROM docs WHERE title LIKE '%rust%' LIMIT 10;
-- IN list
SELECT * FROM docs WHERE status IN ('published', 'featured') LIMIT 10;
-- BETWEEN range
SELECT * FROM docs WHERE score BETWEEN 0.5 AND 1.0 LIMIT 10;
-- NULL checks
SELECT * FROM docs WHERE author IS NOT NULL LIMIT 10;
-- Full-text search (BM25)
SELECT * FROM docs WHERE content MATCH 'rust programming' LIMIT 10;
Combined Queries (Vector + Metadata + Text)
-- Vector search + metadata filter
SELECT * FROM documents
WHERE VECTOR NEAR [0.15, 0.25, ...]
AND category = 'tech'
AND views > 100
LIMIT 5;
-- Hybrid search (vector + full-text)
SELECT * FROM documents
WHERE VECTOR NEAR $query
AND content MATCH 'rust'
LIMIT 5;
-- Complex conditions
SELECT * FROM products
WHERE VECTOR NEAR COSINE [0.1, 0.2, ...]
AND (category = 'electronics' OR category = 'gadgets')
AND price BETWEEN 100 AND 500
AND in_stock = true
LIMIT 10;
Available Filter Operators
| Operator | Syntax | Example |
|---|---|---|
| Equal | = |
status = 'active' |
| Not Equal | !=, <> |
type != 'draft' |
| Greater | > |
views > 1000 |
| Greater/Equal | >= |
rating >= 4 |
| Less | < |
price < 100 |
| Less/Equal | <= |
age <= 30 |
| IN | IN (...) |
tag IN ('a', 'b') |
| BETWEEN | BETWEEN...AND |
score BETWEEN 0 AND 1 |
| LIKE | LIKE |
name LIKE '%john%' |
| IS NULL | IS NULL |
email IS NULL |
| IS NOT NULL | IS NOT NULL |
phone IS NOT NULL |
| Full-text | MATCH |
body MATCH 'search' |
Dot Commands
| Command | Description |
|---|---|
.help |
Show help |
.quit / .exit |
Exit REPL |
.collections / .tables |
List collections |
.schema <name> |
Show collection schema |
.describe <name> |
Show detailed collection info |
.count <name> |
Show point count |
.timing on/off |
Toggle query timing |
.format table/json |
Set output format |
.clear |
Clear screen |
Features
- VelesQL Support: SQL-like syntax for vector operations
- Tab Completion: Auto-complete collection names and keywords
- Command History: Arrow keys to navigate history
- Colored Output: Easy-to-read formatted results
- Timing: Query execution time display
Examples
Semantic Search
-- Search with metadata filter
SELECT id, score, payload->title FROM articles
WHERE VECTOR NEAR $query_embedding
AND category = 'technology'
LIMIT 5;
-- Search with multiple conditions
SELECT * FROM documents
WHERE VECTOR NEAR [0.1, 0.2, 0.3, ...]
AND status = 'published'
AND views > 1000
LIMIT 10;
Binary Vector Search
-- Find similar binary vectors (fingerprints, hashes)
SELECT * FROM images
WHERE VECTOR NEAR [1.0, 0.0, 1.0, 1.0, 0.0, ...]
LIMIT 10;
Creating Collections (via Rust API)
Collections are created programmatically, not via VelesQL:
use ;
let db = open?;
db.create_collection?;
db.create_collection?;
License
Elastic License 2.0 (ELv2)
See LICENSE for details.