Tools Reference
Tools: Data & Migrations
Data tools manage database schema migrations, seed data, and direct database inspection and querying.
zeeb_create_migration
Auto-detect model changes and generate an Alembic migration file.
zeeb_create_migration(name?, project_id) → str
Arguments:
| Name | Type | Description |
|---|---|---|
name | string? | Optional migration name (e.g. create_posts) |
project_id | string | UUID of the target project |
Runs zeeb-manage makemigrations inside the project. Detects all pending model changes across apps.
Example prompt: "Create a migration for the blog app changes"
zeeb_run_migrations
Apply all pending migrations to bring the database schema up to date.
zeeb_run_migrations(target?, project_id) → str
Arguments:
| Name | Type | Description |
|---|---|---|
target | string? | Target revision (default: head — latest) |
project_id | string | UUID of the target project |
Runs zeeb-manage migrate.
zeeb_get_migration_status
Show applied and pending migrations.
zeeb_get_migration_status(project_id) → str
Returns: List of all migrations with their applied/pending status.
zeeb_rollback_migration
Roll back to a specific migration revision.
zeeb_rollback_migration(target: str, project_id) → str
Arguments:
| Name | Type | Description |
|---|---|---|
target | string | Target revision to roll back to |
project_id | string | UUID of the target project |
zeeb_seed_data
Generate a seed.py script that populates the database with sample data.
zeeb_seed_data(app, model, count?, field_defaults?, project_id) → str
Arguments:
| Name | Type | Description |
|---|---|---|
app | string | App name |
model | string | Model class name |
count | int | Number of records to seed (default: 10) |
field_defaults | dict? | Fixed field values (e.g. {"status": "active"}) |
project_id | string | UUID of the target project |
Creates <app>/seed.py with a runnable seed script.
zeeb_list_tables
List all database tables in the project.
zeeb_list_tables(project_id) → str
Returns: Array of table names currently in the database.
zeeb_describe_table
Get the column schema for a specific table.
zeeb_describe_table(table_name: str, project_id) → str
Returns: Column names, types, nullability, defaults, and constraints.
zeeb_run_query
Execute a raw SQL query against the project database.
zeeb_run_query(sql: str, project_id) → str
Arguments:
| Name | Type | Description |
|---|---|---|
sql | string | SQL query to execute |
project_id | string | UUID of the target project |
⚠️ Destructive queries (
DROP,TRUNCATE,DELETEwithoutWHERE) are allowed — use with care.
Example prompt: "Show me the 10 most recent posts from the database"
Notes
- Migrations use Alembic under the hood via
zeeb_orm. zeeb_run_migrationsmust be called after everyzeeb_create_migrationto apply changes.zeeb_seed_datagenerates a script file; to run it, usezeeb_run_management_commandwithseed <app>.