pub struct Field {
pub name: String,
pub ty: Ty,
pub required: bool,
pub flexible: bool,
pub default: Option<String>,
pub description: Option<String>,
pub constraints: Constraints,
}Expand description
Fields§
§name: StringField name.
ty: TyField type.
required: boolWhether the field is required. false maps to the target’s optional
form (Rust Option<T>, TS ?:, Zod .optional(), SurrealQL option<T>).
flexible: boolWhether an object-typed field is schemaless (flexible=#true). Only
meaningful for Ty::Primitive(Prim::Json); emitted by the
SurrealQL target as FLEXIBLE TYPE object.
default: Option<String>An optional default value, as written in the KDL default="..."
property. Carried verbatim; emitters quote / render it per target.
description: Option<String>An optional documentation string, from the KDL description="..."
property. Emitted as a doc comment (Rust ///, TS /** */ JSDoc,
Zod .describe(...), SurrealQL COMMENT '...').
constraints: ConstraintsValue constraints, from the KDL min / max / min_length /
max_length / pattern properties. Emitted only by the Zod and
SurrealQL targets — the Rust / TypeScript type system cannot express
them.