AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證The Modern Embedded Database for Go
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
⚡ The Modern SQL Database Engine — Embedded or Standalone Server
MySQL Protocol · SQL + JSON · ACID · MVCC · Encryption · Replication · Pure Go
CobaltDB runs in two modes — use it as an embedded library inside your Go application, or deploy it as a standalone database server that any MySQL client can connect to.
Requirements: Go 1.25+ (toolchain go1.26.5) · Zero CGO runtime dependency檢視完整 README ↗CobaltDB runs in two modes — use it as an embedded library inside your Go application, or deploy it as a standalone database server that any MySQL client can connect to.
┌─────────────────────────────────────────────────────────┐
│ CobaltDB │
│ │
│ ┌─────────────┐ ┌───────────────────────┐ │
│ │ Embedded │ │ Standalone Server │ │
│ │ (Go Library)│ │ (MySQL Protocol) │ │
│ │ │ │ │ │
│ │ db.Query() │ │ mysql -h host -P 4200 │ │
│ │ db.Exec() │ │ Any MySQL client/ORM │ │
│ └─────────────┘ └───────────────────────┘ │
└─────────────────────────────────────────────────────────┘
| Feature | CobaltDB | PostgreSQL | MySQL | SQLite |
|---|---|---|---|---|
| Deployment | Embedded + Server | Server only | Server only | Embedded only |
| Protocol | MySQL wire protocol | PostgreSQL | MySQL | C API |
| Language | Pure Go (Zero CGO) | C | C/C++ | C |
| Query Language | SQL + JSON | SQL + JSON | SQL + JSON | SQL |
| Encryption at Rest | ✅ AES-256-GCM | Plugin | Plugin | ❌ |
| WAL Encryption | ✅ Built-in | ❌ | ❌ | ❌ |
| TLS | ✅ TLS 1.2+ | ✅ | ✅ | ❌ |
| Replication | ✅ Master-Slave | ✅ | ✅ | ❌ |
| Row-Level Security | ✅ Policy-based | ✅ | ❌ | ❌ |
| Audit Logging | ✅ Encrypted | Plugin | Plugin | ❌ |
| Vector Search | ✅ HNSW | pgvector | ❌ | ❌ |
| Temporal Queries | ✅ AS OF | ✅ | ❌ | ❌ |
| Zero Dependencies | ✅ | ❌ | ❌ | ✅ |
| Cross-Compile | ✅ Any OS/Arch | ❌ | ❌ | CGO needed |
| Single Binary | ✅ | ❌ | ❌ | Library |
go get github.com/cobaltdb/cobaltdb
Requirements: Go 1.25+ (toolchain go1.26.5) · Zero CGO runtime dependency
Run core checks locally:
make verify
Run full security/concurrency gate (requires CGO toolchain and gcc for race detector):
make verify-security
If tool commands are missing locally, install:
go install golang.org/x/vuln/cmd/govulncheck@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Start CobaltDB server
./cobaltdb-server -mysql-addr 127.0.0.1:3307 -admin-pass "StrongPass123!" -data ./data
# Connect with standard MySQL client
mysql -h 127.0.0.1 -P 3307 -u admin -p
mysql> CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT);
mysql> INSERT INTO users VALUES (1, 'Alice', '[email protected]');
mysql> SELECT * FROM users;
+----+-------+-------------------+
| id | name | email |
+----+-------+-------------------+
| 1 | Alice | [email protected] |
+----+-------+-------------------+
The MySQL wire-protocol surface is tested in-repo for handshake,
COM_QUERY, result sets, and parameterized prepared statement execution. Validate each production driver or ORM against docs/MYSQL_COMPATIBILITY.md.
Server features: MySQL protocol, TLS 1.2+, authentication (Argon2id), connection pooling, rate limiting, circuit breaker, health checks, encrypted tamper-evident audit logging, and master-slave replication transport.
Production note: CobaltDB is a production-oriented single-node database candidate. Use TLS for non-loopback wire access, keep the MySQL listener private or disabled, and do not treat replication as automatic HA/failover infrastructure. Replication plaintext is now limited to syntactic loopback endpoints for local development; non-loopback replication requires authenticated TLS, with optional mutual TLS and SSLServerName certificate-name override on replicas.
import "github.com/cobaltdb/cobaltdb/pkg/engine"
db, _ := engine.Open(":memory:", &engine.Options{InMemory: true})
defer db.Close()
ctx := context.Background()
db.Exec(ctx, `CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE,
metadata JSON
)`)
db.Exec(ctx, "INSERT INTO users VALUES (?, ?, ?, ?)",
1, "Alice", "[email protected]", `{"role": "admin"}`)
rows, _ := db.Query(ctx, `SELECT name, JSON_EXTRACT(metadata, '$.role') FROM users`)
Zero CGO, zero dependencies. Import and use — no external server needed.
# Interactive shell
./cobaltdb-cli -path ./mydb.db
# Execute SQL directly
./cobaltdb-cli -memory "SELECT * FROM users"
# Server mode uses the MySQL protocol
mysql -h 127.0.0.1 -P 3307 -u admin -p
# Start with Docker Compose (includes Prometheus + Grafana monitoring)
export COBALTDB_ADMIN_PASSWORD='change-this-before-production'
export GRAFANA_ADMIN_PASSWORD='change-this-too'
docker compose up -d
# Or run standalone
docker build -t cobaltdb .
docker run -d \
-p 4200:4200 \
-p 3307:3307 \
-p 8420:8420 \
-e COBALTDB_ADMIN_PASSWORD='change-this-before-production' \
-e COBALTDB_ALLOW_CLEARTEXT_AUTH=true \
-v cobaltdb_data:/data/cobaltdb \
cobaltdb
# Connect to containerized database
mysql -h 127.0.0.1 -P 3307 -u admin -p
See DOCKER.md for detailed Docker setup instructions.
CobaltDB speaks a tested subset of the MySQL wire protocol. Use standard MySQL drivers for validated workflows, and run the compatibility checks for each production driver or ORM.
import (
"database/sql"
_ "github.com/cobaltdb/cobaltdb/sdk/go" // register driver
)
db, _ := sql.Open("cobaltdb", "file://./data/mydb.cb?cache=1024")
db.Exec("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)")
db.Exec("INSERT INTO users VALUES (?, ?)", 1, "Alice")
import "database/sql"
import _ "github.com/go-sql-driver/mysql"
db, _ := sql.Open("mysql", "admin@tcp(127.0.0.1:3307)/")
rows, _ := db.Query("SELECT * FROM users")
import cobaltdb # sdk/python
conn = cobaltdb.connect(host='127.0.0.1', port=3307, user='admin')
cursor = conn.execute("SELECT * FROM users")
for row in cursor.fetchall():
print(row)
const cobaltdb = require('./sdk/js');
const conn = await cobaltdb.connect({ host: '127.0.0.1', port: 3307 });
const [rows] = await conn.execute('SELECT * FROM users');
console.log(rows);
import com.cobaltdb.sdk.CobaltDB;
Connection conn = CobaltDB.connect("127.0.0.1", 3307, "admin", "");
ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM users");
mysql -h 127.0.0.1 -P 3307 -u admin -e "SELECT * FROM users"
See docs/MYSQL_COMPATIBILITY.md before relying on a specific ORM or advanced MySQL protocol feature in production.
Test Environment: AMD Ryzen 9 9950X3D · Go 1.26 · Windows 11
| Operation | Latency | Throughput |
|---|---|---|
| PUT | ~641 ns | 1.56M ops/sec |
| PUT (Sequential) | ~694 ns | 1.44M ops/sec |
| GET (Point Lookup) | ~64 ns | 15.7M ops/sec |
| UPDATE | ~153 ns | 6.5M ops/sec |
| DELETE | ~197 ns | 5.1M ops/sec |
| SCAN (1K range) | ~270 µs | 3.7K ops/sec |
| Operation | Latency | Detail |
|---|---|---|
| INSERT | ~2.0 µs | Single row with SQL parsing |
| Point Lookup | ~2.1 µs | WHERE id = ? (indexed) |
| Full Scan (1K) | ~598 µs | Custom fast decoder, no reflection |
| Full Scan (10K) | ~8.8 ms | 130K allocs (42% less than json.Unmarshal) |
| SUM/AVG | ~5.0 ms | Byte-level fast path, no JSON decode |
| COUNT(*) | ~4.4 ms | Fast path, skip row decode |
| LIMIT 100 OFFSET 1K | ~3.7 ms | Early termination |
| WHERE (10K) | ~10.3 ms | Custom decoder + expression eval |
| Index vs No Index | 458 µs vs 8.7 ms | 19x faster with index |
| Inner JOIN (1K) | ~724 µs | Hash join |
| 3-Way JOIN (1K×3) | ~2.0 ms | Hash join |
| Recursive CTE | ~3.6 µs | 1000 nodes |
| Simple CTE | ~584 µs | View-based resolution |
| Concurrent Read (×20) | ~669 ns | Parallel goroutines |
| Transaction | ~347 µs | Single statement |
| Rollback | ~167 µs | 100 statements |
| Window (RowNumber) | ~10.0 ms | OVER (ORDER BY) on 10K rows |
| DELETE (bulk) | ~998 µs | WHERE age < 50 on 1K rows |
| UPDATE (bulk) | ~9.2 ms | WHERE age < 50 on 10K rows |
| Component | Operation | Latency | Throughput |
|---|---|---|---|
| SQL Parser | Parse SELECT | ~826 ns | 1.2M ops/sec |
| SQL Parser | Parse INSERT | ~1.0 µs | 960K ops/sec |
| SQL Parser | Parse Complex Query | ~4.7 µs | 214K ops/sec |
| Lexer | Tokenize | ~499 ns | 2.0M ops/sec |
| Buffer Pool | Get Page | ~27 ns | 36.5M ops/sec |
| Buffer Pool | Memory Read | ~34 ns | 29.4M ops/sec |
| WAL | Append | ~192 µs | 5.2K ops/sec |
💡 In-memory benchmarks. Disk persistence adds ~20-40% overhead depending on storage.
CobaltDB provides enterprise-grade security features:
import "github.com/cobaltdb/cobaltdb/pkg/storage"
// Generate encryption key
key, _ := storage.GenerateSecureKey()
// Open encrypted database
db, _ := engine.Open("encrypted.db", &engine.Options{
EncryptionKey: key,
})
import "github.com/cobaltdb/cobaltdb/pkg/server"
config := &server.Config{
Address: ":4200",
TLS: &server.TLSConfig{
Enabled: true,
GenerateSelfSigned: true, // Auto-generate certs
// Or provide your own:
// CertFile: "server.crt",
// KeyFile: "server.key",
},
}
srv, _ := server.New(db, config)
srv.Listen(":4200", config.TLS)
import "github.com/cobaltdb/cobaltdb/pkg/audit"
auditConfig := &audit.Config{
Enabled: true,
LogFile: "audit.log",
LogFormat: "json", // or "text"
}
db, _ := engine.Open("audited.db", &engine.Options{
AuditConfig: auditConfig,
})
audit.VerifyLogFileimport "github.com/cobaltdb/cobaltdb/pkg/security"
// Enable RLS
db, _ := engine.Open("secure.db", &engine.Options{
EnableRLS: true,
})
// Create policies via SQL
// CREATE POLICY tenant_isolation ON users
// USING (tenant_id = current_tenant());
CobaltDB includes enterprise-grade production features for resilience, observability, and high availability:
import "github.com/cobaltdb/cobaltdb/pkg/engine"
config := &engine.CircuitBreakerConfig{
MaxFailures: 5,
MinSuccesses: 3,
ResetTimeout: 30 * time.Second,
MaxConcurrency: 100,
HalfOpenMaxRequests: 1,
}
cb := engine.NewCircuitBreaker(config)
if err := cb.Allow(); err != nil {
return err // Circuit open
}
defer cb.Release()
err := doOperation()
if err != nil {
cb.ReportFailure()
} else {
cb.ReportSuccess()
}
config := &engine.RetryConfig{
MaxAttempts: 3,
InitialDelay: 100 * time.Millisecond,
MaxDelay: 30 * time.Second,
Multiplier: 2.0,
Jitter: 0.1, // 10% randomization
}
err := engine.Retry(ctx, config, func() error {
return db.Query("SELECT * FROM users")
})
// Or with result
result, err := engine.RetryWithResult(ctx, config, func() (string, error) {
return fetchData()
})
import "github.com/cobaltdb/cobaltdb/pkg/server"
config := &server.RateLimiterConfig{
RPS: 1000,
Burst: 100,
PerClient: true,
CleanupInterval: 5 * time.Minute,
MaxClients: 10000,
}
rl := server.NewRateLimiter(config)
defer rl.Stop()
if !rl.Allow("client-id") {
return errors.New("rate limit exceeded")
}
config := &server.SQLProtectionConfig{
Enabled: true,
BlockOnDetection: true,
MaxQueryLength: 10000,
MaxORConditions: 10,
MaxUNIONCount: 5,
SuspiciousThreshold: 3,
}
sp := server.NewSQLProtector(config)
result := sp.CheckSQL(sql)
if !result.Allowed {
return errors.New("SQL injection detected")
}
// Generate request ID
ctx = server.ContextWithRequestID(ctx, server.NewRequestContext().ID)
// Extract from context
requestID := server.RequestIDFromContext(ctx)
# Liveness probe (Kubernetes)
curl http://localhost:8420/health
# Readiness probe (Kubernetes)
curl http://localhost:8420/ready
# Detailed health status
curl http://localhost:8420/healthz
# Circuit breaker statistics
curl http://localhost:8420/circuit-breakers
# Rate limiter statistics
curl http://localhost:8420/rate-limits
# System statistics
curl http://localhost:8420/stats
config := &server.ProductionConfig{
Lifecycle: &server.LifecycleConfig{
ShutdownTimeout: 30 * time.Second,
DrainTimeout: 10 * time.Second,
},
EnableCircuitBreaker: true,
CircuitBreaker: engine.DefaultCircuitBreakerConfig(),
EnableRetry: true,
Retry: engine.DefaultRetryConfig(),
EnableRateLimiter: true,
EnableSQLProtection: true,
EnableHealthServer: true,
HealthAddr: "127.0.0.1:8420",
}
ps := server.NewProductionServer(db, config)
if err := ps.Start(); err != nil {
log.Fatal(err)
}
ps.Wait() // Wait for shutdown signal
cobaltdb/
├── 📂 cmd/ # Command-line tools
│ ├── cobaltdb-server/ # Production server
│ ├── cobaltdb-cli/ # Interactive CLI
│ ├── cobaltdb-migrate/ # Migration tool
│ ├── cobaltdb-bench/ # Benchmark tool
│ └── demo*/ # Demo applications
│
├── 📂 pkg/ # Core packages
│ ├── engine/ # Database engine (CB, retry)
│ ├── catalog/ # SQL execution layer
│ │ ├── catalog_core.go # Core types & helpers
│ │ ├── catalog_insert.go # INSERT operations
│ │ ├── catalog_update.go # UPDATE operations
│ │ ├── catalog_delete.go # DELETE operations
│ │ ├── catalog_select.go # SELECT & JOIN
│ │ ├── catalog_aggregate.go # GROUP BY & aggregates
│ │ ├── catalog_window.go # Window functions
│ │ ├── catalog_cte.go # CTE operations
│ │ ├── catalog_ddl.go # DDL operations
│ │ ├── catalog_txn.go # Transactions
│ │ ├── catalog_eval.go # Expression evaluation
│ │ ├── catalog_index.go # Index operations
│ │ ├── catalog_rls.go # Row-Level Security
│ │ └── ...
│ ├── query/ # SQL parser & optimizer
│ ├── btree/ # B+Tree storage engine
│ ├── storage/ # Storage layer (WAL, buffer pool)
│ ├── server/ # Network server (TLS, auth)
│ ├── security/ # RLS & security
│ ├── audit/ # Audit logging
│ ├── auth/ # Authentication
│ ├── protocol/ # MySQL protocol
│ ├── metrics/ # Metrics collection
│ └── txn/ # Transaction manager
│
├── 📂 test/ # Integration tests (5,000+)
├── 📂 docs/ # Documentation
├── 📂 scripts/ # Utility scripts
│
├── 📂 sdk/ # Multi-language SDKs
│ ├── go/ # Go SDK (database/sql driver)
│ ├── python/ # Python SDK (mysql-connector wrapper)
│ ├── js/ # Node.js SDK (mysql2 wrapper)
│ └── java/ # Java SDK (JDBC wrapper)
│
└── 📂 website/ # Project website
| Package | Purpose | Lines of Code |
|---|---|---|
pkg/catalog | SQL execution (18 files) | ~8,500 |
pkg/query | SQL parser & optimizer | ~6,000 |
pkg/btree | B+Tree storage | ~1,500 |
pkg/storage | Storage layer | ~2,500 |
pkg/server | Network & production | ~3,500 |
pkg/engine | Resilience (CB, retry) | ~800 |
-- DDL: Schema Definition
CREATE TABLE products (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
price REAL CHECK (price > 0),
category TEXT,
tags JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_category ON products(category);
CREATE VIEW expensive_products AS
SELECT * FROM products WHERE price > 100;
-- DML: Data Manipulation
INSERT INTO products (name, price, category, tags)
VALUES ('MacBook Pro', 1999.99, 'Electronics', '["laptop", "apple"]');
-- Complex SELECT with JOINs, Aggregates, Window Functions
SELECT
p.category,
COUNT(*) as total,
AVG(p.price) as avg_price,
MAX(p.price) as max_price,
ROW_NUMBER() OVER (PARTITION BY p.category ORDER BY p.price DESC) as rank
FROM products p
LEFT JOIN orders o ON p.id = o.product_id
WHERE p.price BETWEEN 100 AND 500
GROUP BY p.category
HAVING COUNT(*) > 5
ORDER BY avg_price DESC
LIMIT 10;
Window Functions
SELECT
name,
salary,
AVG(salary) OVER (PARTITION BY dept) as dept_avg,
RANK() OVER (ORDER BY salary DESC) as salary_rank,
LAG(salary) OVER (ORDER BY salary) as prev_salary
FROM employees;
JSON Operations
-- Extract nested values
SELECT JSON_EXTRACT(metadata, '$.user.address.city') FROM users;
-- Modify JSON
UPDATE users SET metadata = JSON_SET(metadata, '$.last_login', '2026-03-02');
-- Array operations
SELECT * FROM products WHERE JSON_ARRAY_LENGTH(tags) > 2;
Transactions (ACID)
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
-- Atomic transfer
COMMIT;
-- Or ROLLBACK on error
Triggers & Procedures
-- Audit logging trigger
CREATE TRIGGER audit_log
AFTER INSERT ON users
BEGIN
INSERT INTO audit (table_name, action, record_id, created_at)
VALUES ('users', 'INSERT', NEW.id, CURRENT_TIMESTAMP);
END;
-- Stored procedure
CREATE PROCEDURE transfer_funds(from_id INT, to_id INT, amount REAL)
BEGIN
UPDATE accounts SET balance = balance - amount WHERE id = from_id;
UPDATE accounts SET balance = balance + amount WHERE id = to_id;
END;
CALL transfer_funds(1, 2, 100.00);
┌─────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ Go SDK · CLI · TCP/Wire Protocol · REST API │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────────┐
│ SQL QUERY ENGINE │
│ Parser → Planner → Optimizer → Executor (Iterator Model) │
└─────────────────────────────┬───────────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────────┐
│ TRANSACTION MANAGER (MVCC) │
│ Snapshot Isolation · Conflict Detection │
└─────────────────────────────┬───────────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────────┐
│ STORAGE ENGINE │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ B+Tree │ │ Index Mgr │ │ Buffer Pool │ │
│ │ (Row Store) │ │ (Secondary) │ │ (LRU Cache) │ │
│ └──────────────┘ └──────────────┘ └──────────────────┘ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Page Manager · WAL (Write-Ahead Log) · Free Page List │ │
│ └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────────┐
│ I/O LAYER │
│ Disk Backend · Memory Backend │
└─────────────────────────────────────────────────────────────┘
| Component | Technology | Purpose |
|---|---|---|
| Storage | B+Tree | Efficient range queries, ordered iteration |
| Buffer Pool | LRU | Page caching, reduces disk I/O |
| WAL | Write-Ahead Log | Durability, crash recovery |
| Transactions | MVCC | Lock-free reads, snapshot isolation |
| JSON | Native Parser | Document storage without external deps |
| Type | Description | Example |
|---|---|---|
INTEGER | 64-bit signed integer | 42, -17 |
REAL | 64-bit floating point | 3.14159, -0.001 |
TEXT | Variable-length string | 'hello', "world" |
BOOLEAN | True/False | TRUE, FALSE |
JSON | Native JSON document | '{"key": "value"}' |
VECTOR(n) | n-dimensional vector | VECTOR(128) for embeddings |
DATE | Date only | '2026-03-02' |
TIMESTAMP | Date + Time | '2026-03-02 14:30:00' |
String: LENGTH, UPPER, LOWER, TRIM, SUBSTR, CONCAT, REPLACE, INSTR
Numeric: ABS, ROUND, FLOOR, CEIL
Aggregate: COUNT, SUM, AVG, MIN, MAX
JSON: JSON_EXTRACT, JSON_SET, JSON_REMOVE, JSON_VALID, JSON_ARRAY_LENGTH, JSON_MERGE
Window: ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, FIRST_VALUE, LAST_VALUE
Date/Time: DATE, TIME, DATETIME, STRFTIME
Utility: COALESCE, IFNULL, NULLIF, CAST
-- DDL
CREATE TABLE ... [PRIMARY KEY] [NOT NULL] [UNIQUE] [CHECK] [FOREIGN KEY]
CREATE INDEX ... ON ...
CREATE VIEW ... AS SELECT ...
CREATE TRIGGER ... BEFORE|AFTER INSERT|UPDATE|DELETE
CREATE PROCEDURE ...
DROP TABLE|INDEX|VIEW|TRIGGER|PROCEDURE ... [IF EXISTS]
-- DML
INSERT INTO ... VALUES (...)
INSERT INTO ... SELECT ...
UPDATE ... SET ... WHERE ...
DELETE FROM ... WHERE ...
SELECT ... FROM ... [JOIN ... ON ...] [WHERE ...] [GROUP BY ...] [HAVING ...] [ORDER BY ...] [LIMIT ...] [OFFSET ...]
-- DCL
BEGIN | COMMIT | ROLLBACK
CALL procedure_name(...)
# Clone the repository
git clone https://github.com/cobaltdb/cobaltdb.git
cd cobaltdb
# Run tests
go test ./... -v
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
# Run benchmarks
go test -bench=. -benchtime=2s ./test/...
# Build CLI
go build -o cobaltdb-cli ./cmd/cobaltdb-cli
# Build Server
go build -o cobaltdb-server ./cmd/cobaltdb-server
# Run demo
go run cmd/demo/main.go
| Package | Coverage | Package | Coverage |
|---|---|---|---|
pkg/logger | 100.0% ✅ | pkg/pool | 97.5% ✅ |
pkg/advisor | 96.8% ✅ | pkg/auth | 96.8% ✅ |
pkg/wire | 94.7% ✅ | pkg/metrics | 94.3% ✅ |
pkg/fdw | 93.9% ✅ | pkg/optimizer | 93.8% ✅ |
pkg/security | 93.2% ✅ | pkg/query | 91.7% ✅ |
pkg/parallel | 91.2% ✅ | pkg/cache | 90.9% ✅ |
pkg/audit | 90.7% ✅ | pkg/server | 90.6% ✅ |
pkg/storage | 88.4% ⚠️ | pkg/replication | 88.3% ⚠️ |
pkg/backup | 88.2% ⚠️ | pkg/txn | 87.8% ⚠️ |
pkg/catalog | 84.8% ⚠️ | pkg/wasm | 84.4% ⚠️ |
pkg/protocol | 82.7% ⚠️ | pkg/engine | 80.8% ⚠️ |
pkg/btree | 78.2% ⚠️ |
7,100+ test functions across 600+ test files, all passing. Current
pkg/...coverage is 86.3%; several production-critical packages remain below the 90% package target.
| Document | Description |
|---|---|
| DOCUMENTATION.md | Comprehensive reference (2,125 lines) — architecture, every package, security, production, SDKs, deployment, SQL reference |
| CHANGELOG.md | Version history, all changes |
| COVERAGE_GUIDE.md | Test coverage analysis and targets |
| FEATURES.md | Feature status - what works 100% vs partially |
| docs/PRODUCTION.md | Production features guide (Circuit Breaker, Retry, Rate Limiting) |
| docs/ARCHITECTURE_FULL.md | System design & components |
| docs/API.md | Go SDK documentation |
| docs/SQL.md | Complete SQL syntax |
| docs/BENCHMARKS.md | Performance benchmarks |
| docs/GETTING_STARTED.md | Getting started guide |
pkg packages passing; 86.3% current pkg/... coveragepkg/... coverage currently measures 86.3% overallPERCENT_RANK/CUME_DIST, window
functions in expressions/derived tables, STDDEV/VARIANCE, ON CONFLICT
upserts, CREATE TABLE AS SELECT, TRUNCATE, composite UNIQUE, qualified
star (table.*), EXTRACT/POSITION, bitwise & <=> operatorsint64 (>2^53)START TRANSACTION (db.Begin()), @@variables,
VERSION()/DATABASE(), SHOW INDEX, prepared statements & transactions verified
end-to-end over a real go-sql-driver connectiongovulncheck,
gosec, and staticcheck all cleanMIT License - see LICENSE file.