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:

NameTypeDescription
namestring?Optional migration name (e.g. create_posts)
project_idstringUUID 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:

NameTypeDescription
targetstring?Target revision (default: head — latest)
project_idstringUUID 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:

NameTypeDescription
stepsint?Number of migrations to roll back (default: 1)
project_idstringUUID 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:

NameTypeDescription
appstringApp name
modelstringModel class name
countintNumber of records to seed (default: 10)
field_defaultsdict?Fixed field values (e.g. {"status": "active"})
runbool?Execute the generated script immediately (default: true)
project_idstringUUID 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:

NameTypeDescription
sqlstringSQL query to execute
project_idstringUUID of the target project

zeeb_run_query is read-only: only SELECT queries 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_migrations must be called after every zeeb_create_migration to apply changes.
  • zeeb_seed_data runs its generated script by default (run=true); there is no seed management command.