"""UUIDv7 generation. Postgres 16 has no built-in uuidv7() function (that lands in PG 18) and we deliberately don't want random UUIDv4 for primary keys — v7 is time-ordered, which keeps btree index locality sane and lets a future client generate its own row IDs offline (see docs/PLAN.md, streams/offline outbox design). So IDs are generated in application code, not by the database. """ from uuid import UUID from uuid6 import uuid7 def new_id() -> UUID: return uuid7()