| 1 | export type Mode = 'text' | 'binary';
|
|---|
| 2 | export type MessageName = 'parseComplete' | 'bindComplete' | 'closeComplete' | 'noData' | 'portalSuspended' | 'replicationStart' | 'emptyQuery' | 'copyDone' | 'copyData' | 'rowDescription' | 'parameterDescription' | 'parameterStatus' | 'backendKeyData' | 'notification' | 'readyForQuery' | 'commandComplete' | 'dataRow' | 'copyInResponse' | 'copyOutResponse' | 'authenticationOk' | 'authenticationMD5Password' | 'authenticationCleartextPassword' | 'authenticationSASL' | 'authenticationSASLContinue' | 'authenticationSASLFinal' | 'error' | 'notice';
|
|---|
| 3 | export interface BackendMessage {
|
|---|
| 4 | name: MessageName;
|
|---|
| 5 | length: number;
|
|---|
| 6 | }
|
|---|
| 7 | export declare const parseComplete: BackendMessage;
|
|---|
| 8 | export declare const bindComplete: BackendMessage;
|
|---|
| 9 | export declare const closeComplete: BackendMessage;
|
|---|
| 10 | export declare const noData: BackendMessage;
|
|---|
| 11 | export declare const portalSuspended: BackendMessage;
|
|---|
| 12 | export declare const replicationStart: BackendMessage;
|
|---|
| 13 | export declare const emptyQuery: BackendMessage;
|
|---|
| 14 | export declare const copyDone: BackendMessage;
|
|---|
| 15 | interface NoticeOrError {
|
|---|
| 16 | message: string | undefined;
|
|---|
| 17 | severity: string | undefined;
|
|---|
| 18 | code: string | undefined;
|
|---|
| 19 | detail: string | undefined;
|
|---|
| 20 | hint: string | undefined;
|
|---|
| 21 | position: string | undefined;
|
|---|
| 22 | internalPosition: string | undefined;
|
|---|
| 23 | internalQuery: string | undefined;
|
|---|
| 24 | where: string | undefined;
|
|---|
| 25 | schema: string | undefined;
|
|---|
| 26 | table: string | undefined;
|
|---|
| 27 | column: string | undefined;
|
|---|
| 28 | dataType: string | undefined;
|
|---|
| 29 | constraint: string | undefined;
|
|---|
| 30 | file: string | undefined;
|
|---|
| 31 | line: string | undefined;
|
|---|
| 32 | routine: string | undefined;
|
|---|
| 33 | }
|
|---|
| 34 | export declare class DatabaseError extends Error implements NoticeOrError {
|
|---|
| 35 | readonly length: number;
|
|---|
| 36 | readonly name: MessageName;
|
|---|
| 37 | severity: string | undefined;
|
|---|
| 38 | code: string | undefined;
|
|---|
| 39 | detail: string | undefined;
|
|---|
| 40 | hint: string | undefined;
|
|---|
| 41 | position: string | undefined;
|
|---|
| 42 | internalPosition: string | undefined;
|
|---|
| 43 | internalQuery: string | undefined;
|
|---|
| 44 | where: string | undefined;
|
|---|
| 45 | schema: string | undefined;
|
|---|
| 46 | table: string | undefined;
|
|---|
| 47 | column: string | undefined;
|
|---|
| 48 | dataType: string | undefined;
|
|---|
| 49 | constraint: string | undefined;
|
|---|
| 50 | file: string | undefined;
|
|---|
| 51 | line: string | undefined;
|
|---|
| 52 | routine: string | undefined;
|
|---|
| 53 | constructor(message: string, length: number, name: MessageName);
|
|---|
| 54 | }
|
|---|
| 55 | export declare class CopyDataMessage {
|
|---|
| 56 | readonly length: number;
|
|---|
| 57 | readonly chunk: Buffer;
|
|---|
| 58 | readonly name = "copyData";
|
|---|
| 59 | constructor(length: number, chunk: Buffer);
|
|---|
| 60 | }
|
|---|
| 61 | export declare class CopyResponse {
|
|---|
| 62 | readonly length: number;
|
|---|
| 63 | readonly name: MessageName;
|
|---|
| 64 | readonly binary: boolean;
|
|---|
| 65 | readonly columnTypes: number[];
|
|---|
| 66 | constructor(length: number, name: MessageName, binary: boolean, columnCount: number);
|
|---|
| 67 | }
|
|---|
| 68 | export declare class Field {
|
|---|
| 69 | readonly name: string;
|
|---|
| 70 | readonly tableID: number;
|
|---|
| 71 | readonly columnID: number;
|
|---|
| 72 | readonly dataTypeID: number;
|
|---|
| 73 | readonly dataTypeSize: number;
|
|---|
| 74 | readonly dataTypeModifier: number;
|
|---|
| 75 | readonly format: Mode;
|
|---|
| 76 | constructor(name: string, tableID: number, columnID: number, dataTypeID: number, dataTypeSize: number, dataTypeModifier: number, format: Mode);
|
|---|
| 77 | }
|
|---|
| 78 | export declare class RowDescriptionMessage {
|
|---|
| 79 | readonly length: number;
|
|---|
| 80 | readonly fieldCount: number;
|
|---|
| 81 | readonly name: MessageName;
|
|---|
| 82 | readonly fields: Field[];
|
|---|
| 83 | constructor(length: number, fieldCount: number);
|
|---|
| 84 | }
|
|---|
| 85 | export declare class ParameterDescriptionMessage {
|
|---|
| 86 | readonly length: number;
|
|---|
| 87 | readonly parameterCount: number;
|
|---|
| 88 | readonly name: MessageName;
|
|---|
| 89 | readonly dataTypeIDs: number[];
|
|---|
| 90 | constructor(length: number, parameterCount: number);
|
|---|
| 91 | }
|
|---|
| 92 | export declare class ParameterStatusMessage {
|
|---|
| 93 | readonly length: number;
|
|---|
| 94 | readonly parameterName: string;
|
|---|
| 95 | readonly parameterValue: string;
|
|---|
| 96 | readonly name: MessageName;
|
|---|
| 97 | constructor(length: number, parameterName: string, parameterValue: string);
|
|---|
| 98 | }
|
|---|
| 99 | export declare class AuthenticationMD5Password implements BackendMessage {
|
|---|
| 100 | readonly length: number;
|
|---|
| 101 | readonly salt: Buffer;
|
|---|
| 102 | readonly name: MessageName;
|
|---|
| 103 | constructor(length: number, salt: Buffer);
|
|---|
| 104 | }
|
|---|
| 105 | export declare class BackendKeyDataMessage {
|
|---|
| 106 | readonly length: number;
|
|---|
| 107 | readonly processID: number;
|
|---|
| 108 | readonly secretKey: number;
|
|---|
| 109 | readonly name: MessageName;
|
|---|
| 110 | constructor(length: number, processID: number, secretKey: number);
|
|---|
| 111 | }
|
|---|
| 112 | export declare class NotificationResponseMessage {
|
|---|
| 113 | readonly length: number;
|
|---|
| 114 | readonly processId: number;
|
|---|
| 115 | readonly channel: string;
|
|---|
| 116 | readonly payload: string;
|
|---|
| 117 | readonly name: MessageName;
|
|---|
| 118 | constructor(length: number, processId: number, channel: string, payload: string);
|
|---|
| 119 | }
|
|---|
| 120 | export declare class ReadyForQueryMessage {
|
|---|
| 121 | readonly length: number;
|
|---|
| 122 | readonly status: string;
|
|---|
| 123 | readonly name: MessageName;
|
|---|
| 124 | constructor(length: number, status: string);
|
|---|
| 125 | }
|
|---|
| 126 | export declare class CommandCompleteMessage {
|
|---|
| 127 | readonly length: number;
|
|---|
| 128 | readonly text: string;
|
|---|
| 129 | readonly name: MessageName;
|
|---|
| 130 | constructor(length: number, text: string);
|
|---|
| 131 | }
|
|---|
| 132 | export declare class DataRowMessage {
|
|---|
| 133 | length: number;
|
|---|
| 134 | fields: any[];
|
|---|
| 135 | readonly fieldCount: number;
|
|---|
| 136 | readonly name: MessageName;
|
|---|
| 137 | constructor(length: number, fields: any[]);
|
|---|
| 138 | }
|
|---|
| 139 | export declare class NoticeMessage implements BackendMessage, NoticeOrError {
|
|---|
| 140 | readonly length: number;
|
|---|
| 141 | readonly message: string | undefined;
|
|---|
| 142 | constructor(length: number, message: string | undefined);
|
|---|
| 143 | readonly name = "notice";
|
|---|
| 144 | severity: string | undefined;
|
|---|
| 145 | code: string | undefined;
|
|---|
| 146 | detail: string | undefined;
|
|---|
| 147 | hint: string | undefined;
|
|---|
| 148 | position: string | undefined;
|
|---|
| 149 | internalPosition: string | undefined;
|
|---|
| 150 | internalQuery: string | undefined;
|
|---|
| 151 | where: string | undefined;
|
|---|
| 152 | schema: string | undefined;
|
|---|
| 153 | table: string | undefined;
|
|---|
| 154 | column: string | undefined;
|
|---|
| 155 | dataType: string | undefined;
|
|---|
| 156 | constraint: string | undefined;
|
|---|
| 157 | file: string | undefined;
|
|---|
| 158 | line: string | undefined;
|
|---|
| 159 | routine: string | undefined;
|
|---|
| 160 | }
|
|---|
| 161 | export {};
|
|---|