Skip to content

[FEATURE]: comparison functions included in columns #4908

@marcospgp

Description

@marcospgp

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

  userById: trpc.procedure.input(z.string()).query(async ({ input }) =>
    db.query.userProfiles.findFirst({
      where: (profile, { eq }) => eq(profile.userId, input),
    }),
  ),

to use something like eq, one has to either import it from drizzle-orm or receive it as a parameter

but wouldn't it be cleaner if comparison functions were simply part of the column types? so one could just do:

where: (profile) => profile.userId.eq(input)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions