mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
pg.d.ts: add support to pg-types
This commit is contained in:
+5
-1
@@ -1,7 +1,11 @@
|
||||
/// <reference path="pg.d.ts" />
|
||||
import pg = require("pg");
|
||||
import * as pg from "pg";
|
||||
|
||||
var conString = "postgres://username:password@localhost/database";
|
||||
|
||||
// https://github.com/brianc/node-pg-types
|
||||
pg.types.setTypeParser(20, (val) => Number(val));
|
||||
|
||||
// Client pooling
|
||||
pg.connect(conString, (err, client, done) => {
|
||||
if (err) {
|
||||
|
||||
Vendored
+4
@@ -85,4 +85,8 @@ declare module "pg" {
|
||||
public on(event: "error", listener: (err: Error, client: Client) => void): this;
|
||||
public on(event: string, listener: Function): this;
|
||||
}
|
||||
|
||||
namespace types {
|
||||
function setTypeParser(oid: number, fn: (val: string) => any): void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user