Skip to content
WeftKitBeta

API Reference

This reference documents every WeftKit engine's connection interface, supported query operations, configuration parameters, and error responses. All examples use standard drivers — no proprietary SDK required.


WeftKitRel — Relational / SQL

WeftKitRel speaks the PostgreSQL v3 wire protocol. Any PostgreSQL-compatible driver connects natively.

Connection Parameters

| Parameter | Default | Description | |---|---|---| | host | localhost | Hostname or IP address | | port | 5432 | TCP port | | database | weftkit | Database name | | user | — | Username (required) | | password | — | Password (required) | | sslmode | prefer | TLS mode: disable, require, verify-ca, verify-full | | connect_timeout | 10 | Connection timeout in seconds | | application_name | — | Identifies your app in server logs |

Connection string format:

postgresql://USER:PASS@HOST:5432/DATABASE?sslmode=require

Supported SQL

WeftKitRel supports a broad subset of PostgreSQL SQL:

DDL (Data Definition Language)

sql
-- Tables
CREATE TABLE orders (
  id          BIGSERIAL PRIMARY KEY,
  customer_id BIGINT    NOT NULL,
  total       NUMERIC(10,2),
  status      TEXT      DEFAULT 'pending',
  created_at  TIMESTAMPTZ DEFAULT NOW()
);

ALTER TABLE orders ADD COLUMN notes TEXT;
DROP TABLE orders;

-- Indexes
CREATE INDEX CONCURRENTLY idx_orders_customer ON orders (customer_id);
CREATE UNIQUE INDEX idx_orders_ref ON orders (reference_number);

-- Sequences
CREATE SEQUENCE invoice_seq START 1000 INCREMENT 1;

DML (Data Manipulation Language)

sql
-- Insert
INSERT INTO orders (customer_id, total) VALUES ($1, $2)
  RETURNING id, created_at;

-- Bulk insert
INSERT INTO products (name, price)
  SELECT name, price FROM staging_products WHERE active = true;

-- Update
UPDATE orders SET status = $1 WHERE id = $2 AND status != 'completed';

-- Delete
DELETE FROM sessions WHERE expires_at < NOW();

-- Upsert
INSERT INTO user_settings (user_id, theme)
VALUES ($1, $2)
ON CONFLICT (user_id) DO UPDATE SET theme = EXCLUDED.theme;

Queries

sql
-- Basic select with filtering
SELECT id, name, price FROM products
WHERE category = $1 AND price < $2
ORDER BY price ASC
LIMIT 50 OFFSET 100;

-- Joins
SELECT o.id, c.name, o.total
FROM orders o
JOIN customers c ON c.id = o.customer_id
WHERE o.status = 'pending';

-- Aggregates
SELECT category, COUNT(*) as count, AVG(price) as avg_price
FROM products
GROUP BY category
HAVING COUNT(*) > 10;

-- Window functions
SELECT id, name, salary,
  RANK() OVER (PARTITION BY department ORDER BY salary DESC) as rank
FROM employees;

-- CTEs (Common Table Expressions)
WITH recent_orders AS (
  SELECT * FROM orders WHERE created_at > NOW() - INTERVAL '7 days'
)
SELECT customer_id, COUNT(*) FROM recent_orders GROUP BY customer_id;

-- JSON operators
SELECT data->>'name' AS name, data->'address'->>'city' AS city
FROM customers WHERE data->>'active' = 'true';

Transactions

sql
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;

-- With isolation level
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT * FROM inventory FOR UPDATE;
UPDATE inventory SET quantity = quantity - 1 WHERE sku = 'ABC';
COMMIT;

-- Savepoints
BEGIN;
INSERT INTO audit_log (event) VALUES ('start');
SAVEPOINT sp1;
UPDATE accounts SET balance = 0;  -- risky operation
ROLLBACK TO SAVEPOINT sp1;        -- undo just this step
COMMIT;

Supported Data Types

| Type | Notes | |---|---| | BIGINT, INTEGER, SMALLINT | 64-bit, 32-bit, 16-bit integers | | BIGSERIAL, SERIAL | Auto-incrementing integers | | NUMERIC(p,s) | Arbitrary precision decimal | | REAL, DOUBLE PRECISION | IEEE 754 floating point | | TEXT, VARCHAR(n) | Variable-length text | | BOOLEAN | true / false | | DATE, TIME, TIMESTAMP, TIMESTAMPTZ | Temporal types | | INTERVAL | Duration type | | UUID | 128-bit identifier | | BYTEA | Binary data | | JSON, JSONB | JSON documents (JSONB is indexed) | | TEXT[], INTEGER[] | Arrays |

Functions Reference

sql
-- String functions
UPPER(text), LOWER(text), LENGTH(text)
TRIM(text), LTRIM(text), RTRIM(text)
SUBSTRING(text FROM start FOR length)
REPLACE(text, from, to)
CONCAT(text, ...), text || text
REGEXP_MATCH(text, pattern)

-- Numeric functions
ABS(n), CEIL(n), FLOOR(n), ROUND(n, decimals)
MOD(a, b), POWER(base, exp), SQRT(n)
GREATEST(a, b, ...), LEAST(a, b, ...)

-- Date/time functions
NOW(), CURRENT_DATE, CURRENT_TIME
DATE_TRUNC('day', ts), DATE_PART('year', ts)
ts + INTERVAL '1 day'
AGE(ts1, ts2)
TO_CHAR(ts, 'YYYY-MM-DD')

-- JSON functions
jsonb_set(doc, '{key}', '"value"')
jsonb_array_elements(array_column)
to_jsonb(row), row_to_json(row)

WeftKitDoc — Document Store

WeftKitDoc speaks the MongoDB Wire Protocol. Any MongoDB driver connects natively.

Connection Parameters

| Parameter | Default | Description | |---|---|---| | host | localhost | Hostname or IP address | | port | 27017 | TCP port | | database | — | Database name | | username | — | Username | | password | — | Password | | authSource | admin | Authentication database | | tls | false | Enable TLS | | connectTimeoutMS | 10000 | Connection timeout | | serverSelectionTimeoutMS | 30000 | Server selection timeout |

Connection string format:

mongodb://USER:PASS@HOST:27017/DATABASE?authSource=admin

Collection Operations

Insert

javascript
// Insert one
await db.collection('users').insertOne({
  name: 'Alice',
  email: 'alice@example.com',
  age: 30,
  tags: ['admin', 'verified'],
  address: { city: 'Austin', country: 'US' }
})

// Insert many
await db.collection('products').insertMany([
  { name: 'Widget A', price: 9.99, stock: 100 },
  { name: 'Widget B', price: 14.99, stock: 50 },
])

Query Operators

javascript
// Comparison
{ age: { $gt: 18 } }          // greater than
{ price: { $lte: 100 } }      // less than or equal
{ status: { $ne: 'deleted' } } // not equal
{ category: { $in: ['a', 'b'] } } // in array
{ score: { $nin: [0, -1] } }  // not in array

// Logical
{ $and: [{ active: true }, { age: { $gte: 18 } }] }
{ $or: [{ role: 'admin' }, { role: 'moderator' }] }
{ $not: { status: 'banned' } }

// Array
{ tags: 'verified' }          // array contains value
{ tags: { $all: ['a', 'b'] } } // array contains all values
{ items: { $size: 3 } }       // array has exact length

// Element
{ phone: { $exists: true } }  // field exists
{ age: { $type: 'number' } }  // field type

// Text search
{ $text: { $search: 'database performance' } }

// Regex
{ name: { $regex: '^Alice', $options: 'i' } }

Find & Filter

javascript
const users = await db.collection('users').find({
  active: true,
  'address.country': 'US',
  age: { $gte: 21 }
}, {
  projection: { name: 1, email: 1, _id: 0 },
  sort: { name: 1 },
  limit: 100,
  skip: 0
}).toArray()

Update

javascript
// Update one
await db.collection('users').updateOne(
  { _id: userId },
  {
    $set: { name: 'Alice Smith', updatedAt: new Date() },
    $inc: { loginCount: 1 },
    $push: { tags: 'premium' },
    $unset: { tempField: '' }
  }
)

// Update many
await db.collection('orders').updateMany(
  { status: 'pending', createdAt: { $lt: cutoff } },
  { $set: { status: 'expired' } }
)

// Upsert
await db.collection('sessions').updateOne(
  { sessionId: 'abc123' },
  { $set: { userId: 42, lastSeen: new Date() } },
  { upsert: true }
)

Aggregation Pipeline

javascript
await db.collection('orders').aggregate([
  { $match: { status: 'completed' } },
  { $group: {
    _id: '$customerId',
    totalSpent: { $sum: '$amount' },
    orderCount: { $count: {} }
  }},
  { $sort: { totalSpent: -1 } },
  { $limit: 10 },
  { $lookup: {
    from: 'customers',
    localField: '_id',
    foreignField: '_id',
    as: 'customerInfo'
  }},
  { $project: { name: { $arrayElemAt: ['$customerInfo.name', 0] }, totalSpent: 1 } }
]).toArray()

Indexes

javascript
// Single field
await db.collection('users').createIndex({ email: 1 }, { unique: true })

// Compound
await db.collection('orders').createIndex({ customerId: 1, createdAt: -1 })

// Text search
await db.collection('products').createIndex({ name: 'text', description: 'text' })

// TTL (auto-expire documents)
await db.collection('sessions').createIndex(
  { expiresAt: 1 },
  { expireAfterSeconds: 0 }
)

WeftKitKV — Key-Value Store

WeftKitKV speaks the DynamoDB REST API. AWS SDK clients and boto3 connect natively.

Connection Parameters

| Parameter | Default | Description | |---|---|---| | endpoint_url | — | WeftKit server URL (e.g., http://localhost:8000) | | region_name | us-east-1 | Any non-empty value | | aws_access_key_id | — | Any non-empty value | | aws_secret_access_key | — | Any non-empty value |

Operations

Basic CRUD

python
import boto3

client = boto3.client(
    'dynamodb',
    endpoint_url='http://localhost:8000',
    region_name='us-east-1',
    aws_access_key_id='any',
    aws_secret_access_key='any'
)

# Put item
client.put_item(
    TableName='sessions',
    Item={
        'sessionId': {'S': 'abc123'},
        'userId':    {'N': '42'},
        'data':      {'S': '{"theme":"dark"}'},
        'ttl':       {'N': str(int(time.time()) + 3600)}  # expires in 1 hour
    }
)

# Get item
response = client.get_item(
    TableName='sessions',
    Key={'sessionId': {'S': 'abc123'}}
)
item = response.get('Item')

# Delete item
client.delete_item(
    TableName='sessions',
    Key={'sessionId': {'S': 'abc123'}}
)

# Query by partition key
response = client.query(
    TableName='orders',
    KeyConditionExpression='customerId = :cid',
    ExpressionAttributeValues={':cid': {'N': '42'}}
)

Batch Operations

python
# Batch write (up to 25 items)
client.batch_write_item(RequestItems={
    'sessions': [
        {'PutRequest': {'Item': {'sessionId': {'S': 'x1'}, 'data': {'S': '{}'}}}},
        {'DeleteRequest': {'Key': {'sessionId': {'S': 'old123'}}}},
    ]
})

# Batch get (up to 100 items)
response = client.batch_get_item(RequestItems={
    'sessions': {
        'Keys': [
            {'sessionId': {'S': 'x1'}},
            {'sessionId': {'S': 'x2'}},
        ]
    }
})

TTL Configuration

python
# Enable TTL on a table
client.update_time_to_live(
    TableName='sessions',
    TimeToLiveSpecification={
        'Enabled': True,
        'AttributeName': 'ttl'  # Unix timestamp field
    }
)

WeftKitGraph — Graph Database

WeftKitGraph speaks the Bolt protocol (Neo4j). Neo4j drivers connect natively.

Connection Parameters

| Parameter | Default | Description | |---|---|---| | uri | bolt://localhost:7687 | Bolt URI | | auth | — | Tuple: ("username", "password") | | encrypted | false | Enable TLS | | max_connection_pool_size | 100 | Driver connection pool size |

Cypher Query Language

Nodes and Relationships

cypher
-- Create nodes
CREATE (alice:Person {name: 'Alice', age: 30})
CREATE (bob:Person {name: 'Bob', age: 25})
CREATE (acme:Company {name: 'Acme Corp'})

-- Create relationships
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:KNOWS {since: 2020}]->(b)

MATCH (p:Person {name: 'Alice'}), (c:Company {name: 'Acme Corp'})
CREATE (p)-[:WORKS_AT {role: 'Engineer', since: 2019}]->(c)

-- Find nodes
MATCH (p:Person) WHERE p.age > 25 RETURN p.name, p.age

-- Traverse relationships
MATCH (p:Person)-[:KNOWS]->(friend:Person)
WHERE p.name = 'Alice'
RETURN friend.name

-- Variable-length paths
MATCH (a:Person)-[:KNOWS*1..3]->(b:Person)
WHERE a.name = 'Alice'
RETURN DISTINCT b.name

-- Shortest path
MATCH path = shortestPath(
  (a:Person {name: 'Alice'})-[*]-(b:Person {name: 'Charlie'})
)
RETURN path

Aggregation

cypher
-- Count connections
MATCH (p:Person)-[:KNOWS]->(friend)
RETURN p.name, COUNT(friend) AS friendCount
ORDER BY friendCount DESC

-- Collect into list
MATCH (p:Person)-[:WORKS_AT]->(c:Company)
RETURN c.name, COLLECT(p.name) AS employees

Indexes

cypher
-- Create index
CREATE INDEX person_name FOR (p:Person) ON (p.name)
CREATE INDEX person_age FOR (p:Person) ON (p.age)

-- Full-text index
CALL db.index.fulltext.createNodeIndex(
  'personSearch', ['Person'], ['name', 'bio']
)
CALL db.index.fulltext.queryNodes('personSearch', 'Alice') YIELD node

WeftKitMem — In-Memory Store

WeftKitMem speaks the Redis RESP3 protocol. Any Redis client connects natively.

Connection Parameters

| Parameter | Default | Description | |---|---|---| | host | localhost | Hostname | | port | 6379 | TCP port | | password | — | AUTH password | | db | 0 | Database index (0–15) | | ssl | false | Enable TLS |

Connection string format:

redis://:PASSWORD@HOST:6379/0
rediss://:PASSWORD@HOST:6379/0   # TLS

Commands Reference

Strings

SET key value [EX seconds] [PX milliseconds] [NX|XX]
GET key
MSET key1 val1 key2 val2
MGET key1 key2
INCR key          → integer
INCRBY key amount → integer
DECR key
APPEND key value
STRLEN key
GETSET key newvalue   → old value
SETNX key value       → 1 if set, 0 if existed
GETEX key EX seconds  → value + refresh TTL
DEL key [key ...]
EXISTS key [key ...]
TTL key               → seconds remaining (-1=no TTL, -2=not found)
EXPIRE key seconds
PERSIST key           → remove TTL

Hashes (field-value maps)

HSET key field value [field value ...]
HGET key field
HMGET key field1 field2
HGETALL key           → all fields + values
HDEL key field [field ...]
HEXISTS key field
HINCRBY key field amount
HKEYS key / HVALS key / HLEN key

Lists (ordered, allows duplicates)

LPUSH key value [value ...]   → push to head
RPUSH key value [value ...]   → push to tail
LPOP key [count]
RPOP key [count]
LRANGE key start stop         → 0 to -1 = full list
LLEN key
LSET key index value
LINSERT key BEFORE|AFTER pivot value
LMOVE src dst LEFT|RIGHT LEFT|RIGHT
BLPOP key [key ...] timeout   → blocking pop

Sets (unordered, unique)

SADD key member [member ...]
SREM key member [member ...]
SISMEMBER key member          → 0 or 1
SMEMBERS key                  → all members
SCARD key                     → count
SUNION key [key ...]
SINTER key [key ...]
SDIFF key [key ...]
SMOVE src dst member
SRANDMEMBER key [count]

Sorted Sets (scored)

ZADD key score member [score member ...]
ZRANGE key start stop [WITHSCORES] [REV]
ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
ZRANGEBYLEX key min max
ZRANK key member            → 0-based rank
ZSCORE key member           → float score
ZREM key member [member ...]
ZCARD key
ZCOUNT key min max
ZINCRBY key amount member
ZUNIONSTORE dst numkeys key [key ...]
ZINTERSTORE dst numkeys key [key ...]

Pub/Sub

SUBSCRIBE channel [channel ...]
PSUBSCRIBE pattern [pattern ...]   → e.g. "events.*"
PUBLISH channel message
UNSUBSCRIBE [channel ...]
PUNSUBSCRIBE [pattern ...]

Streams

XADD stream * field value [field value ...]  → append entry
XREAD COUNT n STREAMS stream id              → read from offset
XRANGE stream start end [COUNT n]
XLEN stream
XGROUP CREATE stream group id [MKSTREAM]
XREADGROUP GROUP group consumer COUNT n STREAMS stream >
XACK stream group id [id ...]

Server

PING [message]
INFO [section]
DBSIZE                     → key count
KEYS pattern               → matching keys (avoid in production)
SCAN cursor [MATCH pattern] [COUNT hint]
FLUSHDB [ASYNC]
SELECT db                  → switch database (0–15)

WeftKitVec — Vector Search

WeftKitVec exposes a gRPC API. Download the .proto file from your WeftKit distribution package.

Connection Parameters

| Parameter | Default | Description | |---|---|---| | target | localhost:50051 | gRPC server address | | tls | false | Enable TLS | | token | — | Bearer token for Authorization metadata |

gRPC Service Definition

protobuf
service VectorService {
  rpc UpsertVectors (UpsertRequest) returns (UpsertResponse);
  rpc SearchVectors (SearchRequest) returns (SearchResponse);
  rpc DeleteVectors (DeleteRequest) returns (DeleteResponse);
  rpc GetVector    (GetRequest)    returns (GetResponse);
  rpc ListCollections (Empty)      returns (CollectionsResponse);
  rpc CreateCollection (CreateCollectionRequest) returns (CreateCollectionResponse);
}

Operations

Create Collection

python
import grpc
from weftkit_vec_pb2 import CreateCollectionRequest
from weftkit_vec_pb2_grpc import VectorServiceStub

channel = grpc.insecure_channel('localhost:50051')
stub = VectorServiceStub(channel)

stub.CreateCollection(CreateCollectionRequest(
    name='product_embeddings',
    dimensions=1536,      # e.g., OpenAI ada-002 dimensions
    distance='cosine',    # 'cosine' | 'euclidean' | 'dot_product'
    hnsw_m=16,            # HNSW M parameter (higher = better recall, more RAM)
    ef_construction=200   # HNSW build-time search depth
))

Upsert Vectors

python
from weftkit_vec_pb2 import UpsertRequest, Vector

stub.UpsertVectors(UpsertRequest(
    collection='product_embeddings',
    vectors=[
        Vector(id='prod-001', values=[0.1, 0.2, ...], metadata={'name': 'Widget A', 'category': 'tools'}),
        Vector(id='prod-002', values=[0.3, 0.4, ...], metadata={'name': 'Widget B', 'category': 'tools'}),
    ]
))

Search (ANN)

python
from weftkit_vec_pb2 import SearchRequest

response = stub.SearchVectors(SearchRequest(
    collection='product_embeddings',
    vector=[0.15, 0.25, ...],   # query embedding
    top_k=10,
    ef_search=100,              # runtime recall tuning (higher = better recall, slower)
    filter={'category': 'tools'} # optional metadata filter
))

for match in response.matches:
    print(f"{match.id}: score={match.score:.4f}, meta={match.metadata}")

Delete

python
from weftkit_vec_pb2 import DeleteRequest

stub.DeleteVectors(DeleteRequest(
    collection='product_embeddings',
    ids=['prod-001', 'prod-002']
))

Distance Metrics

| Metric | Best For | |---|---| | cosine | NLP embeddings, semantic similarity (most common) | | euclidean | Image embeddings, spatial data | | dot_product | Normalized vectors, recommendation systems |


WeftKitMD — Markdown / Structured Text

WeftKitMD exposes a REST API on port 8080.

Base URL

http://HOST:8080/v1

Authentication

Authorization: Bearer YOUR_TOKEN

Endpoints

| Method | Path | Description | |---|---|---| | POST | /collections | Create a collection | | GET | /collections | List all collections | | PUT | /collections/{name}/documents/{id} | Create or replace a document | | GET | /collections/{name}/documents/{id} | Get a document | | PATCH | /collections/{name}/documents/{id} | Update fields | | DELETE | /collections/{name}/documents/{id} | Delete a document | | GET | /collections/{name}/documents | List documents | | POST | /collections/{name}/search | Full-text search |

Create document

bash
curl -X PUT http://localhost:8080/v1/collections/wiki/documents/getting-started \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Getting Started",
    "content": "# Getting Started\n\nWelcome to WeftKit...",
    "tags": ["guide", "intro"],
    "author": "alice"
  }'

Search

bash
curl -X POST http://localhost:8080/v1/collections/wiki/search \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "getting started", "limit": 10}'

WeftKitFile — Binary File / Blob Storage

WeftKitFile exposes a REST API on port 8081, compatible with S3 path-style addressing.

Base URL

http://HOST:8081/v1

Endpoints

| Method | Path | Description | |---|---|---| | POST | /buckets | Create a bucket | | GET | /buckets | List buckets | | PUT | /buckets/{bucket}/objects/{key} | Upload a file | | GET | /buckets/{bucket}/objects/{key} | Download a file | | HEAD | /buckets/{bucket}/objects/{key} | Get metadata only | | DELETE | /buckets/{bucket}/objects/{key} | Delete a file | | GET | /buckets/{bucket}/objects | List objects | | POST | /buckets/{bucket}/objects/{key}/multipart | Start multipart upload |

Upload a file

bash
curl -X PUT http://localhost:8081/v1/buckets/avatars/objects/user-42.png \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: image/png" \
  --data-binary @/path/to/avatar.png

Download a file

bash
curl http://localhost:8081/v1/buckets/avatars/objects/user-42.png \
  -H "Authorization: Bearer TOKEN" \
  -o avatar.png

List objects

bash
curl "http://localhost:8081/v1/buckets/avatars/objects?prefix=user-&limit=100" \
  -H "Authorization: Bearer TOKEN"

Configuration Reference (weftkit.toml)

toml
# Server identity
[server]
name = "my-weftkit-node"
data_dir = "/var/lib/weftkit"
log_level = "info"   # "trace" | "debug" | "info" | "warn" | "error"

# Authentication
[auth]
method     = "password"         # "password" | "jwt" | "mtls"
jwt_secret = "env:JWT_SECRET"

[[auth.users]]
username = "app"
password = "env:APP_DB_PASSWORD"
roles    = ["read", "write"]

[[auth.users]]
username = "readonly"
password = "env:READONLY_PASSWORD"
roles    = ["read"]

# TLS
[tls]
enabled   = true
cert_file = "/etc/weftkit/server.crt"
key_file  = "/etc/weftkit/server.key"
ca_file   = "/etc/weftkit/ca.crt"   # mTLS only

# Per-engine settings
[relational]
enabled          = true
port             = 5432
max_connections  = 10000
max_memory_bytes = 4294967296   # 4 GB
wal_fsync        = true

[document]
enabled = true
port    = 27017

[keyvalue]
enabled = true
port    = 8000

[graph]
enabled = true
port    = 7687

[inmemory]
enabled          = true
port             = 6379
max_memory_bytes = 1073741824   # 1 GB
eviction_policy  = "lru"        # "lru" | "lfu" | "noeviction"

[vector]
enabled         = true
port            = 50051
max_index_bytes = 8589934592    # 8 GB

[markdown]
enabled = true
port    = 8080

[filestore]
enabled  = true
port     = 8081
storage  = "/var/lib/weftkit/files"
max_size = "100GB"

# Replication (Distribution)
[distribution]
enabled = false
role    = "primary"    # "primary" | "replica"
peers   = [
  "replica1.internal:9000",
  "replica2.internal:9000"
]

# CDC (Change Data Capture)
[cdc]
enabled = false
emitter = "kafka"      # "kafka" | "redis" | "webhook" | "nats"
topic   = "weftkit.changes"
broker  = "kafka:9092"

Error Codes

WeftKit returns standard protocol error codes for each engine:

WeftKitRel (PostgreSQL SQLSTATE codes)

| Code | Name | Description | |---|---|---| | 08000 | connection_exception | Connection could not be established | | 28000 | invalid_authorization_specification | Wrong username or password | | 42P01 | undefined_table | Table does not exist | | 23505 | unique_violation | Duplicate value violates unique constraint | | 23503 | foreign_key_violation | Foreign key constraint failed | | 40001 | serialization_failure | Serializable transaction conflict — retry | | 57014 | query_canceled | Statement timeout exceeded | | 53300 | too_many_connections | Max connections reached | | 42501 | insufficient_privilege | User lacks required permission |

WeftKitMem (Redis error strings)

| Error | Description | |---|---| | WRONGTYPE | Command called on wrong data type | | OOM | Out of memory — max_memory_bytes reached | | NOAUTH | Authentication required | | NOPERM | Permission denied for command | | BUSYGROUP | Consumer group already exists |

WeftKitVec / WeftKitMD / WeftKitFile (HTTP status codes)

| Code | Description | |---|---| | 400 Bad Request | Invalid request parameters | | 401 Unauthorized | Missing or invalid token | | 403 Forbidden | Token valid but lacks permission | | 404 Not Found | Collection, document, or object not found | | 409 Conflict | Collection already exists | | 413 Payload Too Large | Upload exceeds size limit | | 429 Too Many Requests | Rate limit exceeded | | 500 Internal Server Error | Unexpected server error — check logs | | 503 Service Unavailable | Engine not enabled or not ready |