-
Notifications
You must be signed in to change notification settings - Fork 92
/
message_code.ts
45 lines (38 loc) · 941 Bytes
/
message_code.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// https://www.postgresql.org/docs/14/protocol-message-formats.html
export const ERROR_MESSAGE = "E";
export const AUTHENTICATION_TYPE = {
CLEAR_TEXT: 3,
GSS_CONTINUE: 8,
GSS_STARTUP: 7,
MD5: 5,
NO_AUTHENTICATION: 0,
SASL_CONTINUE: 11,
SASL_FINAL: 12,
SASL_STARTUP: 10,
SCM: 6,
SSPI: 9,
} as const;
export const INCOMING_QUERY_BIND_MESSAGES = {} as const;
export const INCOMING_QUERY_PARSE_MESSAGES = {} as const;
export const INCOMING_AUTHENTICATION_MESSAGES = {
AUTHENTICATION: "R",
BACKEND_KEY: "K",
PARAMETER_STATUS: "S",
READY: "Z",
} as const;
export const INCOMING_TLS_MESSAGES = {
ACCEPTS_TLS: "S",
NO_ACCEPTS_TLS: "N",
} as const;
export const INCOMING_QUERY_MESSAGES = {
BIND_COMPLETE: "2",
COMMAND_COMPLETE: "C",
DATA_ROW: "D",
EMPTY_QUERY: "I",
NOTICE_WARNING: "N",
NO_DATA: "n",
PARAMETER_STATUS: "S",
PARSE_COMPLETE: "1",
READY: "Z",
ROW_DESCRIPTION: "T",
} as const;