brianc / node-postgres

PostgreSQL client for node.js.

Home Page:https://node-postgres.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module '"pg"' has no exported member 'escapeLiteral'

cesco69 opened this issue · comments

import { escapeLiteral  } from 'pg';

Module '"pg"' has no exported member 'escapeLiteral'

{
  "pg": "^8.11.3"
}

The type seems to be missing from the corresponding types library: #3099

The fix hasn't been merged yet: DefinitelyTyped/DefinitelyTyped#68112

ok, this is a workaround for the users come here

// types.d.ts
declare module 'pg' {
    export function escapeIdentifier(str: string): string;
    export function escapeLiteral(str: string): string;
}

This is fixed in the latest version of @types/pg (8.11.0). I think this issue can be closed.