v3.0.0
Major Changes
-
30feb15: v3 — codegen + customizable tables (cross-version drizzle safety + naming flexibility).
Why
Two pain points v3 solves:
-
Drizzle cross-version type breakage. v2 exported table objects typed against drizzle-orm 0.45. Consumers on drizzle-orm 1.0-rc hit TS errors at
db.select().from(runs)because the embeddedPgTableshape didn't match their drizzle. v3 ships no drizzle-typed values; consumers generate their own via the CLI and use their drizzle's types throughout. -
No naming flexibility. v2 hardcoded
workflow.runs,workflow.steps, etc. Consumers couldn't rename tables, change thepgSchemaname, or add custom columns. v3 lets you customize all of it.
What changed (breaking)
iterativeflow/schemasubpath export removed. Previouslyimport { runs } from "iterativeflow/schema"worked; now runnpx iterativeflow generate-schemaand import from your own project file.iterativeflow/relationssubpath removed (same reason).flowSchema,runs,steps,signals,timers,eventsare no longer exported anywhere on the public surface. They moved entirely into a generated file the consumer owns.
What's new
npx iterativeflow generate-schema— emits./iterativeflow-schema.tsat the project root (override with--out). Typed against yourdrizzle-orm, sodb.select().from(flowTables.runs)works on any drizzle version.createEngine({ tables })— optional. PassflowTablesfrom your generated file only if you customize (renamed tables, custompgSchemaname, added columns the engine should see). The defaultcreateEngine({ db, pool })works against the unmodified generated file.applyFlowSchema(db)/dropFlowSchema(db)are now re-exported from the mainiterativeflowentry. UseapplyFlowSchemato install the workflow tables programmatically without drizzle-kit; it reads the bundledmigrations/0000_init.sqldirectly (nodrizzle-kit/apiruntime dependency).
What stayed the same
- The SQL —
migrations/0000_init.sqlis unchanged.psql -f node_modules/iterativeflow/migrations/0000_init.sqlstill works. - Wire-level contracts —
pg_notifychannel names (flow_terminal,flow_progress), cursor key scheme, replay semantics — all unchanged. - Constants and error vocabulary —
RUN_STATUSES,STEP_STATUSES,EVENT_TYPES,FLOW_ERROR_CODES, the derivedRunStatus/StepStatus/EventType/FlowErrorCodetypes, and theFlowErrorinterface stay on the mainiterativeflowentry.
Migration
# 1. Generate the consumer-side schema file npx iterativeflow generate-schema # → wrote ./iterativeflow-schema.ts # 2. Update your drizzle.config.ts # BEFORE: schema: [require.resolve("iterativeflow/schema")] # AFTER: schema: ["./iterativeflow-schema.ts"] # 3. Replace any imports from "iterativeflow/schema" # BEFORE: import { runs } from "iterativeflow/schema" # AFTER: import { flowTables } from "./iterativeflow-schema" # // then: flowTables.runs # 4. If you customize (renamed tables, custom pgSchema, added columns): # pass tables to createEngine: # createEngine({ db, pool, tables: flowTables }) # Otherwise nothing to do — `createEngine({ db, pool })` works as-is.
Same SQL, same column names by default, same wire shape.
Stability discipline
etc/iterativeflow.api.md(tracked vianpm run api:check) gates every change to the public surface. The library's public TS is now ORM-type-free — constants, error types, plain interfaces, and the engine's runtime API only. -