Bug on custom type inference? Maybe I'm doing something wrong.

export const timez = customType<
  {
    data: Date;
    driverData: string;
    config: { precision?: number };
  }
>({
  dataType(config) {
    const precision = typeof config?.precision !== 'undefined'
      ? ` (${config.precision})`
      : '';
    return `time${precision} with time zone`;
  },
  fromDriver(value: string): Date {
    return new Date(value);
  },
});


Then if I:

endTime: timez("end_time"),

// I get from inference

type Type = {
    endTime?: any;
}


The type on endTime should be Date not any

I'm using drizzle-orm 0.28.5
Was this page helpful?