Skip to main content

Module flush

Module flush 

Source
Expand description

Flush operation ordering and batching for SQLModel Session.

This module handles writing pending changes to the database in the correct order:

  • DELETE child-first (to respect FK constraints)
  • INSERT parent-first (to respect FK constraints)
  • UPDATE any order (no circular FK assumed)

Operations are batched by table for performance.

Structs§

FlushOrderer
Builds a dependency graph and orders operations for flush.
FlushPlan
A plan for executing flush operations.
FlushResult
Result of a flush operation.

Enums§

LinkTableOp
A pending link table operation (for many-to-many relationships).
PendingOp
A pending database operation.

Functions§

execute_link_table_ops
Execute a batch of link table operations.