Toshihiko
    Preparing search index...

    Interface Field<Definition>

    The runtime representation of one compiled schema entry.

    interface Field<
        Definition extends SchemaFieldDefinition = SchemaFieldDefinition,
    > {
        allowNull: boolean;
        autoIncrement: boolean;
        column: string;
        default: FieldDefinitionValue<Definition> | undefined;
        equal: (
            left: FieldDefinitionValue<Definition>,
            right: FieldDefinitionValue<Definition>,
        ) => boolean;
        name: Definition["name"];
        options: Readonly<Definition>;
        primaryKey: boolean;
        type: FieldTypeFromDefinition<Definition>;
        validators: readonly FieldValidator<
            FieldTypeValue<FieldTypeFromDefinition<Definition>>,
        >[];
        get defaultValue(): FieldDefinitionValue<Definition> | undefined;
        get needQuotes(): boolean;
        parse(
            value: ReturnType<FieldTypeFromDefinition<Definition>["restore"]>,
        ): FieldDefinitionValue<Definition>;
        restore(
            value: FieldDefinitionValue<Definition>,
        ): ReturnType<FieldTypeFromDefinition<Definition>["restore"]>;
        toJSON(
            value: FieldDefinitionValue<Definition>,
        ): FieldDefinitionJsonValue<Definition>;
    }

    Type Parameters

    Index
    allowNull: boolean

    Whether the field accepts null.

    autoIncrement: boolean

    Whether the storage backend generates this field.

    column: string

    Storage column name used by Adapters.

    default: FieldDefinitionValue<Definition> | undefined

    Resolved schema or Field Type default.

    equal: (
        left: FieldDefinitionValue<Definition>,
        right: FieldDefinitionValue<Definition>,
    ) => boolean

    Compares two application values using the Field Type or strict equality.

    name: Definition["name"]

    Logical property name exposed on Yukari rows.

    options: Readonly<Definition>

    Normalized field options.

    primaryKey: boolean

    Whether the field participates in row locators.

    type: FieldTypeFromDefinition<Definition>

    Field Type used for parsing, restoring, comparison, and JSON conversion.

    validators: readonly FieldValidator<
        FieldTypeValue<FieldTypeFromDefinition<Definition>>,
    >[]

    Normalized validator list.

    • get needQuotes(): boolean

      Whether SQL adapters should quote the restored value.

      Returns boolean

    • Converts a storage value into its application representation.

      Parameters

      • value: ReturnType<FieldTypeFromDefinition<Definition>["restore"]>

        Value returned by the storage backend.

      Returns FieldDefinitionValue<Definition>

      Parsed application value.

    • Converts an application value into its storage representation.

      Parameters

      • value: FieldDefinitionValue<Definition>

        Current Yukari field value.

      Returns ReturnType<FieldTypeFromDefinition<Definition>["restore"]>

      Value ready for the Adapter.