Skip to content

[BUG]: Error message on bad "to" relation configuration doesn't show table name #5350

@Itamaram

Description

@Itamaram

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

1.0.0-beta.15-859cf75

What version of drizzle-kit are you using?

1.0.0-beta.15-859cf75

Other packages

No response

Describe the Bug

When defining a relation incorrectly due to the "to" table not matching the expected table eg:

      posts: r.many.post({
        from: r.users.id,
        to: r.blog.id,
      }),

The error thrown looks like:

Uncaught Error: relations -> blogs: { posts: r.many.post(...) }: all "to" columns must belong to table "[object Object]", found column of table "blog"

Note [object Object] where post was expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions