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 a schema 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 the migration tools 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 the migration tools to apply pending changes.
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 the most recently applied migration(s).
zeeb_rollback_migration(steps?, project_id) → str
Arguments:
| Name | Type | Description |
|---|---|---|
steps | int? | Number of migrations to roll back (default: 1) |
project_id | string | UUID of the target project |
zeeb_seed_data
Generate a seed script and (by default) run it to populate the database with sample data.
zeeb_seed_data(app, model, count?, field_defaults?, run?, 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"}) |
run | bool? | Execute the generated script immediately (default: true) |
project_id | string | UUID of the target project |
Creates apps/<app>/seed.py and, with run=true, executes it in the project runtime — the result reports executed plus the script's output. There is no separate seed management command; to re-run later, call the tool again (regeneration is idempotent).
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 |
zeeb_run_queryis read-only: onlySELECTqueries are accepted.INSERT,UPDATE,DELETE, and DDL statements are rejected — use the migration and seed tools to change schema or data.
Example prompt: "Show me the 10 most recent posts from the database"
Notes
- Migrations use the framework's schema-migration engine under the hood.
zeeb_run_migrationsmust be called after everyzeeb_create_migrationto apply changes.zeeb_seed_dataruns its generated script by default (run=true); there is noseedmanagement command.