Skip to content

Commit

Permalink
add support postgre timestamp (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal authored Dec 17, 2024
1 parent fa9f8e9 commit 311f623
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions electron/drivers/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import BaseDriver, { ColumnType, Result } from "./base";
import pg, { type ConnectionConfig, type FieldDef, type PoolClient } from "pg";
import { transformArrayBasedResult } from "./transformer";

pg.types.setTypeParser(pg.types.builtins.TIME, (timeStr) => timeStr);
pg.types.setTypeParser(pg.types.builtins.TIMESTAMP, (timeStr) => timeStr);
pg.types.setTypeParser(pg.types.builtins.TIMESTAMPTZ, (timeStr) => timeStr);
pg.types.setTypeParser(pg.types.builtins.DATE, (timeStr) => timeStr);
pg.types.setTypeParser(pg.types.builtins.TIME, (timeStr) => timeStr);

export default class PostgresDriver extends BaseDriver {
protected db: pg.Pool;

Expand Down

0 comments on commit 311f623

Please sign in to comment.