-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The surql-gen tool currently lacks support for generating Zod schemas that enforce a field's value to be within a specific set of numbers (numeric enums). This is essential for cases where a SurrealDB field is restricted to specific numeric values.
Problem Example:
SurrealDB Definition:
DEFINE FIELD myNumberField ON TABLE myTable TYPE int
ASSERT $value IN [1, 2, 3, 4, 5];Expected Zod Schema:
const myTableInputSchema = z.object({
myNumberField: z.union([
z.literal(1),
z.literal(2),
z.literal(3),
z.literal(4),
z.literal(5)
])
});It would be amazing if there was support for generating numeric enums in Zod schemas when the SurrealDB schema defines a field with an IN or INSIDE clause that specifies a set of numbers.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request