ðïļ zoey-storage-sql
SQL storage adapters for ZoeyAI
SQLite and PostgreSQL implementations of the IDatabaseAdapter trait from zoey-core. The default choice for most deployments.
Installation
Add to your Cargo.toml:
[]
= "0.1"
= "0.1"
Features
- ðŠķ SQLite - Zero-config, embedded database (perfect for local/edge)
- ð PostgreSQL - Production-ready with full SQL capabilities
- ð Vector Search - pgvector support for PostgreSQL
- ð Migrations - Automatic schema management
Quick Start
SQLite (Recommended for Development)
use ;
use SqliteAdapter;
use Arc;
async
PostgreSQL (Recommended for Production)
use ;
use PostgresAdapter;
use Arc;
async
Configuration
Environment Variables
# SQLite
ZOEY_DB_PATH=./zoey.db
# PostgreSQL
DATABASE_URL=postgres://user:password@localhost:5432/zoey
Connection Pooling (PostgreSQL)
let adapter = new_with_pool_size;
Vector Search
PostgreSQL with pgvector
-- Enable pgvector (run once)
CREATE EXTENSION IF NOT EXISTS vector;
SQLite
SQLite uses a simple cosine similarity implementation for vector search. For production vector workloads, consider PostgreSQL with pgvector or zoey-storage-vector.
When to Use Which?
| Scenario | Recommended |
|---|---|
| Local development | SQLite |
| Edge/embedded deployment | SQLite |
| Production web service | PostgreSQL |
| High-volume vector search | PostgreSQL + pgvector |
| Serverless | Supabase or SQLite |
Related Crates
| Crate | Description |
|---|---|
zoey-core |
Core runtime and IDatabaseAdapter trait |
zoey-storage-mongo |
MongoDB adapter |
zoey-storage-supabase |
Supabase adapter |
zoey-storage-vector |
Local vector storage |
License
MIT License - See LICENSE for details.