1 /*
2  * Copyright (C) 2019, HuntLabs
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 module hunt.database.driver.postgresql.impl.codec.PgProtocolConstants;
18 
19 /**
20  * @author <a href="mailto:emad.albloushi@gmail.com">Emad Alblueshi</a>
21  */
22 class PgProtocolConstants {
23 
24     enum int AUTHENTICATION_TYPE_OK = 0;
25     enum int AUTHENTICATION_TYPE_KERBEROS_V5 = 2;
26     enum int AUTHENTICATION_TYPE_CLEARTEXT_PASSWORD = 3;
27     enum int AUTHENTICATION_TYPE_MD5_PASSWORD = 5;
28     enum int AUTHENTICATION_TYPE_SCM_CREDENTIAL = 6;
29     enum int AUTHENTICATION_TYPE_GSS = 7;
30     enum int AUTHENTICATION_TYPE_GSS_CONTINUE = 8;
31     enum int AUTHENTICATION_TYPE_SSPI = 9;
32 
33     enum byte ERROR_OR_NOTICE_SEVERITY = 'S';
34     enum byte ERROR_OR_NOTICE_CODE = 'C';
35     enum byte ERROR_OR_NOTICE_MESSAGE = 'M';
36     enum byte ERROR_OR_NOTICE_DETAIL = 'D';
37     enum byte ERROR_OR_NOTICE_HINT = 'H';
38     enum byte ERROR_OR_NOTICE_POSITION = 'P';
39     enum byte ERROR_OR_NOTICE_INTERNAL_POSITION = 'p';
40     enum byte ERROR_OR_NOTICE_INTERNAL_QUERY = 'q';
41     enum byte ERROR_OR_NOTICE_WHERE = 'W';
42     enum byte ERROR_OR_NOTICE_FILE = 'F';
43     enum byte ERROR_OR_NOTICE_LINE = 'L';
44     enum byte ERROR_OR_NOTICE_ROUTINE = 'R';
45     enum byte ERROR_OR_NOTICE_SCHEMA = 's';
46     enum byte ERROR_OR_NOTICE_TABLE = 't';
47     enum byte ERROR_OR_NOTICE_COLUMN = 'c';
48     enum byte ERROR_OR_NOTICE_DATA_TYPE = 'd';
49     enum byte ERROR_OR_NOTICE_CONSTRAINT = 'n';
50 
51     enum byte MESSAGE_TYPE_BACKEND_KEY_DATA = 'K';
52     enum byte MESSAGE_TYPE_AUTHENTICATION = 'R';
53     enum byte MESSAGE_TYPE_ERROR_RESPONSE = 'E';
54     enum byte MESSAGE_TYPE_NOTICE_RESPONSE = 'N';
55     enum byte MESSAGE_TYPE_NOTIFICATION_RESPONSE = 'A';
56     enum byte MESSAGE_TYPE_COMMAND_COMPLETE = 'C';
57     enum byte MESSAGE_TYPE_PARAMETER_STATUS = 'S';
58     enum byte MESSAGE_TYPE_READY_FOR_QUERY = 'Z';
59     enum byte MESSAGE_TYPE_PARAMETER_DESCRIPTION = 't';
60     enum byte MESSAGE_TYPE_ROW_DESCRIPTION = 'T';
61     enum byte MESSAGE_TYPE_DATA_ROW = 'D';
62     enum byte MESSAGE_TYPE_PORTAL_SUSPENDED = 's';
63     enum byte MESSAGE_TYPE_NO_DATA = 'n';
64     enum byte MESSAGE_TYPE_EMPTY_QUERY_RESPONSE = 'I';
65     enum byte MESSAGE_TYPE_PARSE_COMPLETE = '1';
66     enum byte MESSAGE_TYPE_BIND_COMPLETE = '2';
67     enum byte MESSAGE_TYPE_CLOSE_COMPLETE = '3';
68     enum byte MESSAGE_TYPE_FUNCTION_RESULT = 'V';
69     enum byte MESSAGE_TYPE_SSL_YES = 'S';
70     enum byte MESSAGE_TYPE_SSL_NO = 'N';
71 }