drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[drizzle-valibot]: Update for valibot 0.31.0+

Open camflan opened this issue 1 year ago • 5 comments

This PR picks up from #2481, brings it up to the latest main changes to resolve issues with Valibot 0.31.0+

Fixes #2521

Also addresses,

  • failing lint on drizzle-orm. This was caused by an invalid comment symbol in the command, used to disable another command. (Was // # lint instead of # lint)
  • failing build step on typebox, valibot, and zod validation adapters. The build commands were using an older version of tsx specified by local deps, not the version of tsx which is specified at the top-level package.json

camflan avatar Aug 27 '24 18:08 camflan

Happy to help if there are any questions about Valibot!

fabian-hiller avatar Aug 27 '24 18:08 fabian-hiller

Would love some eyes on this @drizzle-team @dankochetov @AndriiSherman @AlexBlokh

camflan avatar Aug 28 '24 16:08 camflan

Is this something we can just use to patch drizzle? :)

CestDiego avatar Sep 09 '24 03:09 CestDiego

I tried patching but was getting some errors when using forwarding such as...

const itemSchema = v.pipe(
  v.omit(
    v.object({
      ...createInsertSchema(items, {
        groups: v.optional(v.array(group), [])
      }).entries,
      tags: v.optional(v.array(tagSchema), [])
    }),
    ['createdAt', 'updatedAt']
  ),
  v.forward(
    v.partialCheck(
      [
        ['groups']
      ],
      (input) => new Set(input.groups.map((p) => p.label)).size === input.groups.length,
      'Group labels must be unique'
    )
  )
);

saturnonearth avatar Sep 12 '24 23:09 saturnonearth

Any progress on this? It's been idle for a while

Hugos68 avatar Sep 26 '24 12:09 Hugos68

@Hugos68 good question

@drizzle-team Just rebased on main, would be great for some feedback here 😅

camflan avatar Dec 05 '24 22:12 camflan

I've been following #3508 that overhaul all validation packages. That one also comes with a number of utility functions for more advanced use-cases, this PR could get canceled in favor of that one.

sandros94 avatar Dec 05 '24 23:12 sandros94

#3508 was merged.

fabian-hiller avatar Dec 07 '24 02:12 fabian-hiller