Skip to content

Commit

Permalink
Revert "🤖 Merge PR #51183 Use NoticeMessage type for pg.Client 'notic…
Browse files Browse the repository at this point in the history
…e' event. by @groner"

This reverts commit 630502c.
  • Loading branch information
groner committed Mar 5, 2021
1 parent abb6bc6 commit b478d10
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions types/pg/index.d.ts
Expand Up @@ -9,7 +9,6 @@
import events = require('events');
import stream = require('stream');
import pgTypes = require('pg-types');
import { NoticeMessage } from 'pg-protocol/dist/messages';

import { ConnectionOptions } from 'tls';

Expand Down Expand Up @@ -249,8 +248,7 @@ export class ClientBase extends events.EventEmitter {
escapeLiteral(str: string): string;

on(event: 'drain', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'notice', listener: (notice: NoticeMessage) => void): this;
on(event: 'error' | 'notice', listener: (err: Error) => void): this;
on(event: 'notification', listener: (message: Notification) => void): this;
// tslint:disable-next-line unified-signatures
on(event: 'end', listener: () => void): this;
Expand Down
3 changes: 1 addition & 2 deletions types/pg/package.json
@@ -1,7 +1,6 @@
{
"private": true,
"dependencies": {
"pg-types": "^2.2.0",
"pg-protocol": "^1.2.0"
"pg-types": "^2.2.0"
}
}
2 changes: 0 additions & 2 deletions types/pg/pg-tests.ts
@@ -1,6 +1,5 @@
import { types, Client, CustomTypesConfig, QueryArrayConfig, Pool } from 'pg';
import TypeOverrides = require('pg/lib/type-overrides');
import { NoticeMessage } from 'pg-protocol/dist/messages';

// https://github.com/brianc/node-pg-types
// tslint:disable-next-line no-unnecessary-callback-wrapper
Expand All @@ -22,7 +21,6 @@ const host: string = client.host;
const password: string | undefined = client.password;
const ssl: boolean = client.ssl;

client.on('notice', (notice: NoticeMessage) => console.warn(`${notice.severity}: ${notice.message}`));
client.connect(err => {
if (err) {
console.error('Could not connect to postgres', err);
Expand Down

0 comments on commit b478d10

Please sign in to comment.