SchemaField defines a single schema field structure.

Hierarchy

Implemented by

Methods

  • ColDefinition returns the field db column type definition as string.

    Returns string

  • InitOptions initializes the current field options based on its type.

    Returns error on unknown field type.

    Returns void

  • MarshalJSON implements the [json.Marshaler] interface.

    Returns string | number[]

  • PrepareValue returns normalized and properly formatted field value.

    Parameters

    • value: any

    Returns any

  • PrepareValueWithModifier returns normalized and properly formatted field value by "merging" baseValue with the modifierValue based on the specified modifier (+ or -).

    Parameters

    • baseValue: any
    • modifier: string
    • modifierValue: any

    Returns any

  • String serializes and returns the current field as string.

    Returns string

  • UnmarshalJSON implements the [json.Unmarshaler] interface.

    The schema field options are auto initialized on success.

    Parameters

    • data: string | number[]

    Returns void

  • Validate makes SchemaField validatable by implementing [validation.Validatable] interface.

    Returns void

Properties

id: string
name: string
options: any
presentable: boolean

Presentable indicates whether the field is suitable for visualization purposes (eg. in the Admin UI relation views).

required: boolean
system: boolean
type: string
unique: boolean

Deprecated: This field is no-op and will be removed in future versions. Please use the collection.Indexes field to define a unique constraint.

Generated using TypeDoc