Skip to content

fix(valibot): Array columns type inference in valibot schema#5530

Open
ZatTwilight wants to merge 1 commit intodrizzle-team:betafrom
ZatTwilight:fix/vali-pg-array-type-inference
Open

fix(valibot): Array columns type inference in valibot schema#5530
ZatTwilight wants to merge 1 commit intodrizzle-team:betafrom
ZatTwilight:fix/vali-pg-array-type-inference

Conversation

@ZatTwilight
Copy link

Summary

Fixing the inferred type of array columns for generated valibot schemas.
Currently a generated schema type will just provide the base type of the column. i.e. text("my_array").array() would just have a type of string rather than string[].
This limits its usability where the validator is used to validate data and then also infer the type from that hence providing the wrong type to typescript despite having the correct array validator.

This should hopefully align with the zod and arktype methods for determining and returning array types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant