without making changes to the db schema, run drizzle-kit introspect.
expected behavior:
no diff in generated schema.ts or relations.ts files
actual behavior
relations & table definitions are reordered arbitrarily each time the command is run.
Expected behavior
schema & relations definitions should be defined one of alphabetical, creation, or dependency order.
said differently, I expect drizzle-kit introspect to be idempotent. for any single given input schema, the generated output should be identical, no matter how many times the command is run.
I do not have a strong preference or intuition behind one or the other, but alphabetical is easy to reason about verify at a glance.
What version of
drizzle-orm
are you using?0.31.1
What version of
drizzle-kit
are you using?0.22.2
Describe the Bug
drizzle-kit introspect
.expected behavior:
schema.ts
orrelations.ts
filesactual behavior
Expected behavior
schema & relations definitions should be defined one of alphabetical, creation, or dependency order.
said differently, I expect
drizzle-kit introspect
to be idempotent. for any single given input schema, the generated output should be identical, no matter how many times the command is run.I do not have a strong preference or intuition behind one or the other, but alphabetical is easy to reason about verify at a glance.
https://github.com/drizzle-team/drizzle-orm/issues/1306 appears loosely related, but materially distinct enough that I wanted to raise a dedicated issue. please feel free to recategorize as you wish.
Environment & setup
running Bun 1.1.13 on macOS 14.5, connecting to a postgres 16 db through Neon's serverless client.
here's our
drizzle.config.js
: