hediet / ts-typed-sql

A fully typed sql builder. Not maintained anymore, use it for your inspiration.
https://hediet.github.io/ts-typed-sql/
54 stars 4 forks source link

Timestamptz type #9

Open phiresky opened 7 years ago

phiresky commented 7 years ago
class TimestampTZType extends s.Type<Date, Date, "date"> {
    name = 'timestamptz';
    serialize(arg: Date): string | number | boolean {
        return arg as any;
    }

    deserialize(arg: string | number | boolean): Date {
        return new Date("" + arg);
    }
}
export const timestamptz = new TimestampTZType;