Documentation
    Preparing search index...

    Type Alias CustomTypeValues

    type CustomTypeValues = {
        config?: Record<string, any>;
        configRequired?: boolean;
        data: unknown;
        default?: boolean;
        driverData?: unknown;
        notNull?: boolean;
    }
    Index

    Properties

    config?: Record<string, any>

    What config type should be used for CustomTypeParams dataType generation

    configRequired?: boolean

    Whether the config argument should be required or not

    false
    
    data: unknown

    Required type for custom column, that will infer proper type model

    Examples:

    If you want your column to be string type after selecting/or on inserting - use data: string. Like text, varchar

    If you want your column to be number type after selecting/or on inserting - use data: number. Like integer

    default?: boolean

    If your custom data type has default you can use default: true

    const customSerial = customType<{ data: number, notNull: true, default: true }>({
    dataType() {
    return 'serial';
    },
    });
    driverData?: unknown

    Type helper, that represents what type database driver is accepting for specific database data type

    notNull?: boolean

    If your custom data type should be notNull by default you can use notNull: true

    const customSerial = customType<{ data: number, notNull: true, default: true }>({
    dataType() {
    return 'serial';
    },
    });