You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v5.1.2
Node v20.12.2
System macOS (arm64)
Package Manager bun
Output static
Adapter none
Integrations @astrojs/tailwind
astro:db
@astrojs/db/file-url
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
createInsertSchema accepts a Table type from Drizzle. It appears the Table type created by defineTable is not compatible with drizzle zod.
It would be nice to be able to create or infer zod (i guess Valibot and others too) schemas either natively in Astro DB or be able to use the utilities like the drizzle-zod package.
// db/config.tsconstCharacter=defineTable({columns: {id: column.number({primaryKey: true}),name: column.text(),age: column.number(),occupation: column.text(),createdAt: column.date({default: newDate()}),},})// db/schema.tsimport{Character}from'astro:db'import{z}from'zod'import{createInsertSchema}from'drizzle-zod'exportconstCharacterSchema=createInsertSchema(Character)// CharacterSchema.shape has no propertiesexporttypeCharacter=z.infer<typeofCharacterSchema>// type Character = {}
What's the expected result?
Character should contain the expected columns and their types.
Link to Minimal Reproducible Example
see description
Participation
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
createInsertSchema
accepts aTable
type from Drizzle. It appears theTable
type created bydefineTable
is not compatible with drizzle zod.It would be nice to be able to create or infer zod (i guess Valibot and others too) schemas either natively in Astro DB or be able to use the utilities like the drizzle-zod package.
What's the expected result?
Character should contain the expected columns and their types.
Link to Minimal Reproducible Example
see description
Participation
The text was updated successfully, but these errors were encountered: