Circular Dependency Hell

Is it just me or does using the relations API result in a bunch of circular deps that aren't lazily instantiated. For example, a foreign key reference is a function.
workspaceId: cuid2('workspace_id')
  .notNull()
  .references(() => workspace.id)


For relations, it's something like this: workspace: one(workspace),.

I feel like everything needs to be lazily instantiated because I'm eating alive by: Cannot read properties of undefined (reading 'Symbol(drizzle:Name)'). I've spent 20-30 hours fighting it and I think I'm just going to delete the relations API although even though I like the DX.
Was this page helpful?