CodeVetter · Repo Unpack · Behavior traces
SeaQL/sea-orm
The inspected traces follow application startup, database writes and reads, CLI generation, migrations, authorization, and file-backed conversion. Each sequence identifies its relevant functions and branches. These are source-derived execution paths, not observed runtime traces.
- Actix startup proceeds from the binary main to actix_example_api::main, start, environment loading, Database::connect, Migrator::up, Tera loading, AppState creation, route registration, listener adoption or bind, and server.run.
- POST / calls create, extracts post::Model, and invokes Mutation::create_post; the service sets title/text and calls save, which takes the missing-primary-key insert branch, runs before_save, executes insertion with model retrieval, runs after_save, and returns an HTTP redirect.
- GET / calls list, defaults page to 1 and page size to 5, then find_posts_in_page builds an ID-ordered paginator, counts pages, and fetches page-1; fetch_page applies LIMIT/OFFSET, queries and decodes rows, and the handler renders index.html.tera.
- Entity generation runs binary main → CLI main/Cli::parse → run_generate_command → backend sqlx_connect/SchemaDiscovery → EntityTransformer::transform → EntityWriter::generate → file writes → rustfmt; preservation fallback can make the final command return an error after writing output.
- sea migrate up launches cargo run against the migration manifest; the template calls run_cli, which constructs the connection and dispatches up. MigratorTrait::up creates SchemaManager, exec_up installs tracking and selects pending migrations, and exec_up_with runs each migration and records its version, optionally within a transaction.
- Nested ActiveModelEx::save calls generated action(Save), begins a transaction, performs prerequisite relation actions, persists the parent when changed or genuinely new, performs subsequent relation actions, and commits; unchanged existing parents skip the scalar write.
- RBAC use proceeds through load_rbac → load_rbac_from → RbacEngine::load_from → replace, then restricted_for(user); structured execution calls user_can_run and audits every request, while raw SQL calls return RbacError without forwarding.
- The synchronous Parquet example converts generated ActiveModels with to_arrow, writes ArrowWriter output, reads Parquet RecordBatches, restores models with from_arrow, compares rows, recreates a SQLite target, applies the entity schema, and executes insert_many.