Database Support
Complete reference of database systems supported by DgiDgi AI agents.
Fully Supported Databases
PostgreSQL
Primary database with full executor support.
| Tool | Description |
|---|---|
database.query | Execute SQL with parameterized queries |
database.migrate | Run migrations with transaction support |
database.schema | Apply schema changes |
Features:
- Row-Level Security (RLS) enforcement
- Multi-tenant isolation via
app.tenant_id - Transaction-wrapped operations
- Dangerous query detection
- Connection pooling
Example:
-- Queries automatically respect tenant isolation
SELECT * FROM projects WHERE tenant_id = current_setting('app.tenant_id')
MongoDB
Full document database support.
| Tool | Description |
|---|---|
mongodb.insert_one | Insert single document |
mongodb.insert_many | Bulk insert |
mongodb.find | Query documents |
mongodb.find_one | Find single document |
mongodb.update_one | Update single document |
mongodb.update_many | Bulk update |
mongodb.delete_one | Delete single document |
mongodb.delete_many | Bulk delete |
mongodb.aggregate | Aggregation pipeline |
mongodb.count | Count documents |
mongodb.distinct | Get distinct values |
mongodb.create_index | Create index |
mongodb.list_indexes | List indexes |
mongodb.drop_index | Drop index |
mongodb.create_collection | Create collection |
mongodb.list_collections | List collections |
mongodb.drop_collection | Drop collection |
mongodb.collection_stats | Collection statistics |
mongodb.bulk_write | Bulk operations |
Redis
In-memory data store with 50+ operations.
String Operations
| Tool | Description |
|---|---|
redis.get | Get string value |
redis.set | Set string value |
redis.mget | Get multiple values |
redis.mset | Set multiple values |
redis.incr | Increment integer |
redis.decr | Decrement integer |
redis.append | Append to string |
Hash Operations
| Tool | Description |
|---|---|
redis.hget | Get hash field |
redis.hset | Set hash field |
redis.hmget | Get multiple fields |
redis.hmset | Set multiple fields |
redis.hgetall | Get all fields |
redis.hdel | Delete field |
redis.hincrby | Increment field |
List Operations
| Tool | Description |
|---|---|
redis.lpush | Push to head |
redis.rpush | Push to tail |
redis.lpop | Pop from head |
redis.rpop | Pop from tail |
redis.lrange | Get range |
redis.llen | Get length |
redis.lindex | Get by index |
Set Operations
| Tool | Description |
|---|---|
redis.sadd | Add member |
redis.srem | Remove member |
redis.smembers | Get all members |
redis.sismember | Check membership |
redis.scard | Get cardinality |
redis.sdiff | Set difference |
redis.sinter | Set intersection |
redis.sunion | Set union |
Sorted Set Operations
| Tool | Description |
|---|---|
redis.zadd | Add with score |
redis.zrem | Remove member |
redis.zrange | Get range by rank |
redis.zscore | Get score |
redis.zrank | Get rank |
redis.zincrby | Increment score |
Pub/Sub
| Tool | Description |
|---|---|
redis.publish | Publish message |
redis.subscribe | Subscribe to channel |
Streams
| Tool | Description |
|---|---|
redis.xadd | Add to stream |
redis.xread | Read from stream |
redis.xrange | Get range |
redis.xlen | Get length |
Transactions
| Tool | Description |
|---|---|
redis.multi | Start transaction |
redis.exec | Execute transaction |
redis.watch | Watch keys |
Key Operations
| Tool | Description |
|---|---|
redis.keys | Find keys by pattern |
redis.exists | Check existence |
redis.del | Delete key |
redis.expire | Set TTL |
redis.ttl | Get TTL |
redis.type | Get type |
redis.scan | Iterate keys |
Cassandra
Wide-column store support.
| Tool | Description |
|---|---|
cassandra.query | Execute CQL query |
cassandra.create_keyspace | Create keyspace |
cassandra.use_keyspace | Switch keyspace |
cassandra.describe_keyspace | Describe keyspace |
cassandra.create_table | Create table |
cassandra.describe_table | Describe table |
cassandra.truncate_table | Truncate table |
cassandra.drop_table | Drop table |
Provisioning Support
Databases that can be provisioned but have limited query support.
| Provider | Type | Features |
|---|---|---|
| Supabase | PostgreSQL + Auth | Full provisioning, connection strings |
| Neon | Serverless PostgreSQL | Branching, scaling |
| PlanetScale | MySQL compatible | Branching, schema changes |
Planned Database Support
High Priority
| Database | Type | Use Case |
|---|---|---|
| MySQL/MariaDB | Relational | Most common web database |
| SQLite | Embedded | Local/mobile apps |
| Elasticsearch | Search | Full-text search, analytics |
Medium Priority
| Database | Type | Use Case |
|---|---|---|
| SQL Server | Enterprise | Microsoft ecosystem |
| Oracle | Enterprise | Legacy systems |
| DynamoDB | Document/KV | AWS serverless |
| Firebase/Firestore | Document | Mobile/web apps |
Specialized
| Database | Type | Use Case |
|---|---|---|
| Neo4j | Graph | Relationships, networks |
| InfluxDB | Time-series | Metrics, IoT |
| CockroachDB | Distributed SQL | Global scale |
| Snowflake | Data warehouse | Analytics |
| ClickHouse | Analytics | Real-time analytics |
| Pinecone | Vector | AI embeddings |
| Weaviate | Vector | Semantic search |
| Qdrant | Vector | ML applications |
ORM Support
Currently Used
| ORM | Language | Status |
|---|---|---|
| Drizzle | TypeScript | Internal use |
Planned Integration
| ORM | Language | Status |
|---|---|---|
| Prisma | TypeScript | Planned |
| TypeORM | TypeScript | Planned |
| SQLAlchemy | Python | Planned |
| Django ORM | Python | Planned |
| GORM | Go | Planned |
| Diesel | Rust | Planned |
Connection Security
Supported Features
| Feature | Status |
|---|---|
| SSL/TLS connections | Supported |
| Connection pooling | Supported |
| Credential rotation | Supported |
| Secret management | Supported |
Multi-Tenant Isolation
// PostgreSQL RLS enforcement
await client.query("SELECT set_config('app.tenant_id', $1, true)", [tenantId]);
await client.query("SELECT set_config('app.user_id', $1, true)", [userId]);
Database Migrations
PostgreSQL Migrations
# Migrations stored in supabase/migrations/
supabase/migrations/
├── 20240101000000_initial.sql
├── 20240102000000_add_users.sql
└── 20240103000000_add_projects.sql
Features:
- Transaction-wrapped execution
- Rollback on failure
- Migration tracking table
- Idempotent operations
Query Safety
Dangerous Query Detection
The following patterns require explicit allowDangerous: true:
-- Blocked by default
DROP DATABASE ...
TRUNCATE ...
DELETE FROM table -- (without WHERE)
Parameterized Queries
// Safe: parameterized
await database.query({
query: "SELECT * FROM users WHERE id = $1",
params: [userId]
});
// Unsafe: string interpolation (rejected)
await database.query({
query: `SELECT * FROM users WHERE id = '${userId}'` // DON'T DO THIS
});