Provider Reference Provider-specific behaviors, limitations, and configuration options.
Key-Value Providers Redis import "github.com/zoobz-io/grub/redis"
Constructor func New ( client * redis . Client ) * Provider
Accepts *redis.Client, *redis.ClusterClient, or any client implementing the required interface.
client := goredis . NewClient ( & goredis . Options {
Addr : "localhost:6379" ,
Password : "" ,
DB : 0 ,
})
provider := redis . New ( client )
Behaviors Operation Implementation Get GET command Set SET with EX option Delete DEL command Exists EXISTS command List SCAN with MATCH GetBatch MGET command SetBatch Pipelined SET
Features Feature Support TTL Full (native) Batch atomicity No (pipelined) Distributed Yes
Error Mapping Redis Error Grub Error redis.NilErrNotFound
Notes List uses SCAN, which is safe for production (non-blocking) SetBatch uses pipelining (each SET is independent) Cluster mode supported via *redis.ClusterClient BadgerDB import "github.com/zoobz-io/grub/badger"
Constructor func New ( db * badger . DB ) * Provider
opts := badgerdb . DefaultOptions ( "./data" )
opts . Logger = nil
db , _ := badgerdb . Open ( opts )
provider := badger . New ( db )
Behaviors Operation Implementation Get View transaction Set Update transaction with Entry Delete Update transaction Exists View transaction List Iterator with prefix GetBatch View transaction SetBatch WriteBatch
Features Feature Support TTL Full (Entry.WithTTL) Batch atomicity Yes (WriteBatch) Embedded Yes Encryption Yes (Badger native)
Error Mapping Badger Error Grub Error badger.ErrKeyNotFoundErrNotFound
Configuration Options opts := badgerdb . DefaultOptions ( path )
opts . Logger = nil // Silence logs
opts . ValueLogFileSize = 64 << 20 // 64MB value log
opts . NumMemtables = 2 // Memory tables
opts . NumLevelZeroTables = 2 // L0 tables
In-Memory Mode opts := badgerdb . DefaultOptions ( "" ). WithInMemory ( true )
BoltDB import "github.com/zoobz-io/grub/bolt"
Constructor func New ( db * bbolt . DB , bucket string ) * Provider
bucket is the BoltDB bucket name for data storage.
db , _ := bbolt . Open ( "my.db" , 0600 , nil )
provider := bolt . New ( db , "sessions" )
Behaviors Operation Implementation Get View transaction Set Update transaction Delete Update transaction Exists View transaction List Cursor iteration GetBatch View transaction SetBatch Single Update transaction
Features Feature Support TTL Not supported Batch atomicity Yes Embedded Yes Multiple stores Yes (via bucket name)
Error Mapping Condition Grub Error Key not in bucket ErrNotFoundTTL > 0 ErrTTLNotSupported
Notes TTL is not supported. Set with ttl > 0 returns ErrTTLNotSupportedMultiple stores can share one DB file using different bucket names Auto-creates bucket on first write Multiple Buckets db , _ := bbolt . Open ( "app.db" , 0600 , nil )
sessions := grub . NewStore [ Session ]( bolt . New ( db , "sessions" ))
configs := grub . NewStore [ Config ]( bolt . New ( db , "configs" ))
Blob Storage Providers AWS S3 import "github.com/zoobz-io/grub/s3"
Constructor func New ( client * s3 . Client , bucket string ) * Provider
cfg , _ := config . LoadDefaultConfig ( ctx )
client := awss3 . NewFromConfig ( cfg )
provider := s3 . New ( client , "my-bucket" )
Behaviors Operation Implementation Get GetObject Put PutObject Delete HeadObject + DeleteObject Exists HeadObject List ListObjectsV2
Features Feature Support Metadata Yes ContentType Yes ETag Yes (from response)
Error Mapping S3 Error Grub Error NoSuchKeyErrNotFound
Notes Delete checks Exists first (S3 DeleteObject succeeds on missing keys) List uses continuation tokens for pagination Metadata preserved in ObjectInfo Custom Endpoint (LocalStack) client := awss3 . NewFromConfig ( cfg , func ( o * awss3 . Options ) {
o . BaseEndpoint = aws . String ( "http://localhost:4566" )
o . UsePathStyle = true
})
MinIO import "github.com/zoobz-io/grub/minio"
Constructor func New ( client * minio . Client , bucket string ) * Provider
client , _ := minio . New ( "localhost:9000" , & minio . Options {
Creds : credentials . NewStaticV4 ( "minioadmin" , "minioadmin" , "" ),
Secure : false ,
})
provider := grubminio . New ( client , "my-bucket" )
Behaviors Operation Implementation Get GetObject + Stat Put PutObject Delete StatObject + RemoveObject Exists StatObject List ListObjects (channel)
Features Feature Support Metadata Yes (UserMetadata) ContentType Yes ETag Yes (from stat)
Error Mapping MinIO Error Grub Error ErrorResponse.Code == "NoSuchKey"ErrNotFound
Notes Delete checks Exists first (RemoveObject succeeds on missing keys) List uses channel-based iteration with recursive option Uses minio-go/v7 — lighter dependency than aws-sdk-go-v2 Metadata mapped via ObjectInfo.UserMetadata Google Cloud Storage import "github.com/zoobz-io/grub/gcs"
Constructor func New ( client * storage . Client , bucket string ) * Provider
client , _ := storage . NewClient ( ctx )
provider := gcs . New ( client , "my-bucket" )
Behaviors Operation Implementation Get NewReader + ReadAll Put NewWriter Delete Delete Exists Attrs List Objects iterator
Features Feature Support Metadata Yes ContentType Yes (writer.ContentType) ETag Yes (Etag from attrs)
Error Mapping GCS Error Grub Error storage.ErrObjectNotExistErrNotFound
Azure Blob Storage import "github.com/zoobz-io/grub/azure"
Constructor func New ( client * azblob . Client , containerName string ) * Provider
cred , _ := azidentity . NewDefaultAzureCredential ( nil )
client , _ := azblob . NewClient ( "https://account.blob.core.windows.net/" , cred , nil )
provider := azure . New ( client , "my-container" )
Behaviors Operation Implementation Get DownloadStream Put UploadBuffer Delete Delete Exists GetProperties List NewListBlobsFlatPager
Features Feature Support Metadata Yes (may need GetProperties) ContentType Yes ETag Yes (from properties)
Error Mapping Azure Error Grub Error bloberror.BlobNotFoundErrNotFound
Notes Metadata may require separate GetProperties call after download Azure uses map[string]*string for metadata (converted internally) SQL Driver Modules Thin wrappers that register database drivers.
PostgreSQL import _ "github.com/zoobz-io/grub/postgres"
Registers github.com/lib/pq driver.
import (
_ "github.com/zoobz-io/grub/postgres"
"github.com/zoobz-io/astql/postgres"
)
db , _ := sqlx . Connect ( "postgres" , dsn )
users , _ := grub . NewDatabase [ User ]( db , "users" , postgres . New ())
MariaDB import _ "github.com/zoobz-io/grub/mariadb"
Registers github.com/go-sql-driver/mysql driver (MariaDB uses MySQL wire protocol).
import (
_ "github.com/zoobz-io/grub/mariadb"
"github.com/zoobz-io/astql/mariadb"
)
db , _ := sqlx . Connect ( "mysql" , dsn )
SQLite import _ "github.com/zoobz-io/grub/sqlite"
Registers modernc.org/sqlite driver (pure Go, no CGO).
import (
_ "github.com/zoobz-io/grub/sqlite"
"github.com/zoobz-io/astql/sqlite"
)
db , _ := sqlx . Connect ( "sqlite" , "./data.db" )
In-Memory db , _ := sqlx . Connect ( "sqlite" , ":memory:" )
SQL Server import _ "github.com/zoobz-io/grub/mssql"
Registers github.com/microsoft/go-mssqldb driver.
import (
_ "github.com/zoobz-io/grub/mssql"
"github.com/zoobz-io/astql/mssql"
)
db , _ := sqlx . Connect ( "sqlserver" , dsn )
Provider Comparison Key-Value Features Feature Redis Badger Bolt TTL ✓ ✓ ✗ Batch atomicity ✗ ✓ ✓ Embedded ✗ ✓ ✓ Distributed ✓ ✗ ✗ Encryption ✗ ✓ ✗ In-memory mode ✗ ✓ ✗
Blob Features Feature S3 MinIO GCS Azure Metadata ✓ ✓ ✓ ✓ ContentType ✓ ✓ ✓ ✓ ETag ✓ ✓ ✓ ✓ Versioning ✓ ✓ ✓ ✓
Error Semantics All providers map their native errors to grub semantic errors:
Semantic Error Meaning ErrNotFoundKey/object doesn't exist ErrTTLNotSupportedProvider can't handle TTL ErrOperatorNotSupportedVector provider doesn't support filter operator ErrInvalidQueryFilter contains validation errors ErrFilterNotSupportedVector provider doesn't support metadata-only filtering
Context Cancellation Provider Cancellation Support Redis All operations Badger Iteration Bolt Iteration S3 All operations MinIO All operations GCS All operations Azure All operations Qdrant All operations Pinecone All operations Milvus All operations Weaviate All operations
Vector Providers Qdrant import "github.com/zoobz-io/grub/qdrant"
Constructor func New ( client * qdrant . Client , config Config ) * Provider
client , _ := qdrant . NewClient ( & qdrant . Config {
Host : "localhost" ,
Port : 6334 ,
})
provider := qdrant . New ( client , qdrant . Config {
Collection : "documents" ,
})
Config type Config struct {
Collection string // Required: Qdrant collection name
}
Behaviors Operation Implementation Upsert Points Upsert Get Points Get Delete Points Delete Search Points Search Query Points Search with Filter Filter Points Scroll with Filter List Points Scroll
Features Feature Support Filter operators All ID handling String → uint64 (FNV-1a hash) Distance Configured at collection level
Error Mapping Qdrant Error Grub Error Point not found ErrNotFound
Notes String IDs are hashed to uint64 using FNV-1a Original string ID stored in payload Collection must exist before use Pinecone import "github.com/zoobz-io/grub/pinecone"
Constructor func New ( conn * pinecone . IndexConnection , config Config ) * Provider
client , _ := pinecone . NewClient ( pinecone . NewClientParams {
ApiKey : os . Getenv ( "PINECONE_API_KEY" ),
})
indexConn , _ := client . Index ( pinecone . NewIndexConnParams {
Host : "your-index.svc.environment.pinecone.io" ,
})
provider := pinecone . New ( indexConn , pinecone . Config {
Namespace : "default" ,
})
Config type Config struct {
Namespace string // Optional: Pinecone namespace
}
Behaviors Operation Implementation Upsert Upsert Get Fetch Delete Delete Search Query with TopK Query Query with metadata filter Filter Not supported (returns ErrFilterNotSupported) List ListVectors
Features Feature Support Filter operators Limited (see below) ID handling Native string Managed service Yes
Filter Operator Support Operator Support Eq ✓ Ne ✓ In ✓ Nin ✓ Gt/Gte/Lt/Lte ✗ Like ✗ Contains ✗
Unsupported operators return ErrOperatorNotSupported.
Error Mapping Pinecone Error Grub Error Vector not found ErrNotFound
Milvus import "github.com/zoobz-io/grub/milvus"
Constructor func New ( client client . Client , config Config ) * Provider
milvusClient , _ := client . NewClient ( ctx , client . Config {
Address : "localhost:19530" ,
})
provider := milvus . New ( milvusClient , milvus . Config {
Collection : "documents" ,
IDField : "id" ,
VectorField : "embedding" ,
MetadataField : "metadata" ,
})
Config type Config struct {
Collection string // Required: Milvus collection name
IDField string // ID field name (default: "id")
VectorField string // Vector field name (default: "embedding")
MetadataField string // Metadata field name (default: "metadata")
}
Behaviors Operation Implementation Upsert Insert with delete-if-exists Get Query by ID Delete Delete by ID Search Search with expression Query Search with translated filter Filter Query with expression List Query all IDs
Features Feature Support Filter operators All ID handling Native string Configurable fields Yes
Error Mapping Milvus Error Grub Error Entity not found ErrNotFound
Notes Collection must exist with appropriate schema Uses Milvus expression language for filters Requires collection to be loaded Weaviate import "github.com/zoobz-io/grub/weaviate"
Constructor func New ( client * weaviate . Client , config Config ) * Provider
cfg := weaviate . Config {
Host : "localhost:8080" ,
Scheme : "http" ,
}
client , _ := weaviate . NewClient ( cfg )
provider := weaviate . New ( client , weaviate . Config {
Class : "Document" ,
Properties : [] string { "category" , "score" , "tags" },
})
Config type Config struct {
Class string // Required: Weaviate class name
Properties [] string // Metadata property names to retrieve in searches
}
Behaviors Operation Implementation Upsert Data Creator/Updater Get Data ObjectsGetter Delete Data Deleter Search GraphQL NearVector Query GraphQL with Where filter Filter GraphQL Get with Where filter List GraphQL Get
Features Feature Support Filter operators All ID handling String → deterministic UUID (SHA1) GraphQL queries Yes Properties config Required for metadata
Error Mapping Weaviate Error Grub Error 404 / not found ErrNotFound
Notes String IDs converted to deterministic UUIDs via SHA1 Original string ID stored in _grub_id property Properties must be configured to retrieve metadata in search resultsClass/schema must exist before use Uses GraphQL for search operations