For AI Agents & Developers: Use this guide to choose between SupabasePrimitive and SQLitePrimitive
graph TD
A[What are you building?] --> B{Multiple users?}
B -->|No| C[SQLitePrimitive]
B -->|Yes| D{Need real-time updates?}
D -->|No| E[SupabasePrimitive]
D -->|Yes| F[SupabasePrimitive with real-time]
C --> G{Need to deploy?}
G -->|No| H[β
SQLitePrimitive - Perfect]
G -->|Yes| I[β οΈ Consider SupabasePrimitive instead]
E --> J{Budget?}
J -->|Free tier OK| K[β
SupabasePrimitive - Start free]
J -->|Need more| L[β
SupabasePrimitive - Paid plan]
| Feature | SQLitePrimitive | SupabasePrimitive |
|---|---|---|
| Best For | Local apps, prototypes, single-user | Multi-user apps, production, cloud |
| Setup Difficulty | β Easy (no config) | ββ Medium (API keys) |
| Cost | π° Free (always) | π° Free tier β Paid |
| Deployment | β οΈ Complex (file-based) | β Easy (cloud-hosted) |
| Real-time | β No | β Yes |
| Multi-user | β No (file locks) | β Yes |
| Scalability | β οΈ Limited | β Excellent |
| Privacy | β 100% local | β οΈ Cloud-hosted |
| Backup | β οΈ Manual | β Automatic |
"""Local task manager using SQLitePrimitive"""
from tta_dev_primitives.integrations import SQLitePrimitive, SQLiteRequest
from tta_dev_primitives.core.base import WorkflowContext
import asyncio
async def main():
# Create primitive (uses local file)
db = SQLitePrimitive(database="tasks.db")
context = WorkflowContext(workflow_id="task-manager")
# Create table
create_table = SQLiteRequest(
query="""
CREATE TABLE IF NOT EXISTS tasks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
completed BOOLEAN DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
""",
fetch="none"
)
await db.execute(create_table, context)
# Add task
add_task = SQLiteRequest(
query="INSERT INTO tasks (title) VALUES (?)",
parameters=("Build my first app",),
fetch="none"
)
await db.execute(add_task, context)
# Get all tasks
get_tasks = SQLiteRequest(
query="SELECT * FROM tasks ORDER BY created_at DESC",
fetch="all"
)
response = await db.execute(get_tasks, context)
print(f"Tasks: {response.data}")
if __name__ == "__main__":
asyncio.run(main())
When to use: Personal task manager, no deployment needed, 100% local.
"""Team task manager using SupabasePrimitive"""
from tta_dev_primitives.integrations import SupabasePrimitive, SupabaseRequest
from tta_dev_primitives.core.base import WorkflowContext
import asyncio
import os
async def main():
# Create primitive (uses cloud database)
db = SupabasePrimitive(
url=os.getenv("SUPABASE_URL"),
key=os.getenv("SUPABASE_KEY")
)
context = WorkflowContext(workflow_id="team-tasks")
# Add task (table already exists in Supabase)
add_task = SupabaseRequest(
operation="insert",
table="tasks",
data={
"title": "Review PR #123",
"assigned_to": "alice@example.com",
"team_id": "team-001"
}
)
await db.execute(add_task, context)
# Get team's tasks
get_tasks = SupabaseRequest(
operation="select",
table="tasks",
filters={"team_id": {"eq": "team-001"}},
columns="id,title,assigned_to,completed"
)
response = await db.execute(get_tasks, context)
print(f"Team tasks: {response.data}")
# Update task status
update_task = SupabaseRequest(
operation="update",
table="tasks",
data={"completed": True},
filters={"id": {"eq": 1}}
)
await db.execute(update_task, context)
if __name__ == "__main__":
asyncio.run(main())
When to use: Team collaboration, cloud deployment, real-time updates.
Phase 1: Prototype with SQLite
# Start with SQLitePrimitive for rapid prototyping
db = SQLitePrimitive(database="prototype.db")
Phase 2: Migrate to Supabase
# Switch to SupabasePrimitive when ready to deploy
db = SupabasePrimitive(url=SUPABASE_URL, key=SUPABASE_KEY)
Migration steps:
sqlite3 prototype.db .dump > data.sqlRecommendation: Start with Supabase free tier, upgrade when needed.
packages/tta-dev-primitives/src/tta_dev_primitives/integrations/sqlite_primitive.pypackages/tta-dev-primitives/src/tta_dev_primitives/integrations/supabase_primitive.pypackages/tta-dev-primitives/tests/test_integrations.pyPRIMITIVES_CATALOG.mdLast Updated: October 30, 2025
For: AI Agents & Developers (all skill levels)
Maintained by: TTA.dev Team