@squiz/db-lib 1.2.1-alpha.95 → 1.2.1-alpha.96
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/lib/AbstractRepository.d.ts +5 -3
- package/lib/PostgresErrorCodes.d.ts +268 -0
- package/lib/assertions/assertAssign.d.ts +4 -0
- package/lib/assertions/assertAssign.spec.d.ts +1 -0
- package/lib/assertions/assertAssignWithDefaultUndefinedValue.d.ts +4 -0
- package/lib/assertions/assertAssignWithDefaultUndefinedValue.spec.d.ts +1 -0
- package/lib/assertions/assertIsDefined.d.ts +1 -0
- package/lib/assertions/assertIsDefined.spec.d.ts +1 -0
- package/lib/assertions/assertIsMapOfStringString.d.ts +3 -0
- package/lib/assertions/assertIsMapOfStringString.spec.d.ts +1 -0
- package/lib/assertions/assertIsObject.d.ts +1 -0
- package/lib/assertions/assertIsObject.spec.d.ts +1 -0
- package/lib/assertions/assertIsString.d.ts +1 -0
- package/lib/assertions/assertIsString.spec.d.ts +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +11912 -1196
- package/lib/index.js.map +3 -3
- package/package.json +6 -5
- package/src/AbstractRepository.ts +11 -7
- package/src/Migrator.ts +13 -9
- package/src/PostgresErrorCodes.ts +270 -0
- package/src/assertions/assertAssign.spec.ts +18 -0
- package/src/assertions/assertAssign.ts +22 -0
- package/src/assertions/assertAssignWithDefaultUndefinedValue.spec.ts +31 -0
- package/src/assertions/assertAssignWithDefaultUndefinedValue.ts +17 -0
- package/src/assertions/assertIsDefined.spec.ts +19 -0
- package/src/assertions/assertIsDefined.ts +7 -0
- package/src/assertions/assertIsMapOfStringString.spec.ts +23 -0
- package/src/assertions/assertIsMapOfStringString.ts +29 -0
- package/src/assertions/assertIsObject.spec.ts +17 -0
- package/src/assertions/assertIsObject.ts +11 -0
- package/src/assertions/assertIsString.spec.ts +16 -0
- package/src/assertions/assertIsString.ts +11 -0
- package/src/index.ts +13 -0
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.2.1-alpha.96](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.96) (2022-08-12)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @squiz/db-lib
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
## [1.2.1-alpha.95](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.95) (2022-08-10)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @squiz/db-lib
|
@@ -14,19 +14,21 @@ export declare abstract class AbstractRepository<T> implements Reader<T>, Writer
|
|
14
14
|
protected repositories: Repositories;
|
15
15
|
protected pool: Pool;
|
16
16
|
protected classRef: {
|
17
|
-
new (): T;
|
17
|
+
new (data?: Record<string, unknown>): T;
|
18
18
|
};
|
19
19
|
protected tableName: string;
|
20
|
+
/** object where the key is the model property name amd the value is sql column name */
|
20
21
|
protected modelPropertyToSqlColumn: {
|
21
22
|
[key in keyof T]: string;
|
22
23
|
};
|
24
|
+
/** object where the key is the sql column name and the value is the model property name */
|
23
25
|
protected sqlColumnToModelProperty: {
|
24
|
-
[key: string]:
|
26
|
+
[key: string]: string;
|
25
27
|
};
|
26
28
|
constructor(repositories: Repositories, pool: Pool, tableName: string, mapping: {
|
27
29
|
[key in keyof T]: string;
|
28
30
|
}, classRef: {
|
29
|
-
new (): T;
|
31
|
+
new (data?: Record<string, unknown>): T;
|
30
32
|
});
|
31
33
|
protected getConnection(): Promise<PoolClient>;
|
32
34
|
create(value: Partial<T>, transactionClient?: PoolClient | null): Promise<T>;
|
@@ -0,0 +1,268 @@
|
|
1
|
+
export declare enum PostgresErrorCode {
|
2
|
+
SUCCESSFUL_COMPLETION = "00000",
|
3
|
+
WARNING = "01000",
|
4
|
+
WARNING_DYNAMIC_RESULT_SETS_RETURNED = "0100C",
|
5
|
+
WARNING_IMPLICIT_ZERO_BIT_PADDING = "01008",
|
6
|
+
WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION = "01003",
|
7
|
+
WARNING_PRIVILEGE_NOT_GRANTED = "01007",
|
8
|
+
WARNING_PRIVILEGE_NOT_REVOKED = "01006",
|
9
|
+
WARNING_STRING_DATA_RIGHT_TRUNCATION = "01004",
|
10
|
+
WARNING_DEPRECATED_FEATURE = "01P01",
|
11
|
+
NO_DATA = "02000",
|
12
|
+
NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED = "02001",
|
13
|
+
SQL_STATEMENT_NOT_YET_COMPLETE = "03000",
|
14
|
+
CONNECTION_EXCEPTION = "08000",
|
15
|
+
CONNECTION_DOES_NOT_EXIST = "08003",
|
16
|
+
CONNECTION_FAILURE = "08006",
|
17
|
+
SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION = "08001",
|
18
|
+
SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION = "08004",
|
19
|
+
TRANSACTION_RESOLUTION_UNKNOWN = "08007",
|
20
|
+
PROTOCOL_VIOLATION = "08P01",
|
21
|
+
TRIGGERED_ACTION_EXCEPTION = "09000",
|
22
|
+
FEATURE_NOT_SUPPORTED = "0A000",
|
23
|
+
INVALID_TRANSACTION_INITIATION = "0B000",
|
24
|
+
LOCATOR_EXCEPTION = "0F000",
|
25
|
+
L_E_INVALID_SPECIFICATION = "0F001",
|
26
|
+
INVALID_GRANTOR = "0L000",
|
27
|
+
INVALID_GRANT_OPERATION = "0LP01",
|
28
|
+
INVALID_ROLE_SPECIFICATION = "0P000",
|
29
|
+
DIAGNOSTICS_EXCEPTION = "0Z000",
|
30
|
+
STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER = "0Z002",
|
31
|
+
CASE_NOT_FOUND = "20000",
|
32
|
+
CARDINALITY_VIOLATION = "21000",
|
33
|
+
DATA_EXCEPTION = "22000",
|
34
|
+
ARRAY_ELEMENT_ERROR = "2202E",
|
35
|
+
ARRAY_SUBSCRIPT_ERROR = "2202E",
|
36
|
+
CHARACTER_NOT_IN_REPERTOIRE = "22021",
|
37
|
+
DATETIME_FIELD_OVERFLOW = "22008",
|
38
|
+
DATETIME_VALUE_OUT_OF_RANGE = "22008",
|
39
|
+
DIVISION_BY_ZERO = "22012",
|
40
|
+
ERROR_IN_ASSIGNMENT = "22005",
|
41
|
+
ESCAPE_CHARACTER_CONFLICT = "2200B",
|
42
|
+
INDICATOR_OVERFLOW = "22022",
|
43
|
+
INTERVAL_FIELD_OVERFLOW = "22015",
|
44
|
+
INVALID_ARGUMENT_FOR_LOG = "2201E",
|
45
|
+
INVALID_ARGUMENT_FOR_NTILE = "22014",
|
46
|
+
INVALID_ARGUMENT_FOR_NTH_VALUE = "22016",
|
47
|
+
INVALID_ARGUMENT_FOR_POWER_FUNCTION = "2201F",
|
48
|
+
INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION = "2201G",
|
49
|
+
INVALID_CHARACTER_VALUE_FOR_CAST = "22018",
|
50
|
+
INVALID_DATETIME_FORMAT = "22007",
|
51
|
+
INVALID_ESCAPE_CHARACTER = "22019",
|
52
|
+
INVALID_ESCAPE_OCTET = "2200D",
|
53
|
+
INVALID_ESCAPE_SEQUENCE = "22025",
|
54
|
+
NONSTANDARD_USE_OF_ESCAPE_CHARACTER = "22P06",
|
55
|
+
INVALID_INDICATOR_PARAMETER_VALUE = "22010",
|
56
|
+
INVALID_PARAMETER_VALUE = "22023",
|
57
|
+
INVALID_PRECEDING_OR_FOLLOWING_SIZE = "22013",
|
58
|
+
INVALID_REGULAR_EXPRESSION = "2201B",
|
59
|
+
INVALID_ROW_COUNT_IN_LIMIT_CLAUSE = "2201W",
|
60
|
+
INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE = "2201X",
|
61
|
+
INVALID_TABLESAMPLE_ARGUMENT = "2202H",
|
62
|
+
INVALID_TABLESAMPLE_REPEAT = "2202G",
|
63
|
+
INVALID_TIME_ZONE_DISPLACEMENT_VALUE = "22009",
|
64
|
+
INVALID_USE_OF_ESCAPE_CHARACTER = "2200C",
|
65
|
+
MOST_SPECIFIC_TYPE_MISMATCH = "2200G",
|
66
|
+
NULL_VALUE_NOT_ALLOWED = "22004",
|
67
|
+
NULL_VALUE_NO_INDICATOR_PARAMETER = "22002",
|
68
|
+
NUMERIC_VALUE_OUT_OF_RANGE = "22003",
|
69
|
+
SEQUENCE_GENERATOR_LIMIT_EXCEEDED = "2200H",
|
70
|
+
STRING_DATA_LENGTH_MISMATCH = "22026",
|
71
|
+
STRING_DATA_RIGHT_TRUNCATION = "22001",
|
72
|
+
SUBSTRING_ERROR = "22011",
|
73
|
+
TRIM_ERROR = "22027",
|
74
|
+
UNTERMINATED_C_STRING = "22024",
|
75
|
+
ZERO_LENGTH_CHARACTER_STRING = "2200F",
|
76
|
+
FLOATING_POINT_EXCEPTION = "22P01",
|
77
|
+
INVALID_TEXT_REPRESENTATION = "22P02",
|
78
|
+
INVALID_BINARY_REPRESENTATION = "22P03",
|
79
|
+
BAD_COPY_FILE_FORMAT = "22P04",
|
80
|
+
UNTRANSLATABLE_CHARACTER = "22P05",
|
81
|
+
NOT_AN_XML_DOCUMENT = "2200L",
|
82
|
+
INVALID_XML_DOCUMENT = "2200M",
|
83
|
+
INVALID_XML_CONTENT = "2200N",
|
84
|
+
INVALID_XML_COMMENT = "2200S",
|
85
|
+
INVALID_XML_PROCESSING_INSTRUCTION = "2200T",
|
86
|
+
DUPLICATE_JSON_OBJECT_KEY_VALUE = "22030",
|
87
|
+
INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION = "22031",
|
88
|
+
INVALID_JSON_TEXT = "22032",
|
89
|
+
INVALID_SQL_JSON_SUBSCRIPT = "22033",
|
90
|
+
MORE_THAN_ONE_SQL_JSON_ITEM = "22034",
|
91
|
+
NO_SQL_JSON_ITEM = "22035",
|
92
|
+
NON_NUMERIC_SQL_JSON_ITEM = "22036",
|
93
|
+
NON_UNIQUE_KEYS_IN_A_JSON_OBJECT = "22037",
|
94
|
+
SINGLETON_SQL_JSON_ITEM_REQUIRED = "22038",
|
95
|
+
SQL_JSON_ARRAY_NOT_FOUND = "22039",
|
96
|
+
SQL_JSON_MEMBER_NOT_FOUND = "2203A",
|
97
|
+
SQL_JSON_NUMBER_NOT_FOUND = "2203B",
|
98
|
+
SQL_JSON_OBJECT_NOT_FOUND = "2203C",
|
99
|
+
TOO_MANY_JSON_ARRAY_ELEMENTS = "2203D",
|
100
|
+
TOO_MANY_JSON_OBJECT_MEMBERS = "2203E",
|
101
|
+
SQL_JSON_SCALAR_REQUIRED = "2203F",
|
102
|
+
SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE = "2203G",
|
103
|
+
INTEGRITY_CONSTRAINT_VIOLATION = "23000",
|
104
|
+
RESTRICT_VIOLATION = "23001",
|
105
|
+
NOT_NULL_VIOLATION = "23502",
|
106
|
+
FOREIGN_KEY_VIOLATION = "23503",
|
107
|
+
UNIQUE_VIOLATION = "23505",
|
108
|
+
CHECK_VIOLATION = "23514",
|
109
|
+
EXCLUSION_VIOLATION = "23P01",
|
110
|
+
INVALID_CURSOR_STATE = "24000",
|
111
|
+
INVALID_TRANSACTION_STATE = "25000",
|
112
|
+
ACTIVE_SQL_TRANSACTION = "25001",
|
113
|
+
BRANCH_TRANSACTION_ALREADY_ACTIVE = "25002",
|
114
|
+
HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL = "25008",
|
115
|
+
INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION = "25003",
|
116
|
+
INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION = "25004",
|
117
|
+
NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION = "25005",
|
118
|
+
READ_ONLY_SQL_TRANSACTION = "25006",
|
119
|
+
SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED = "25007",
|
120
|
+
NO_ACTIVE_SQL_TRANSACTION = "25P01",
|
121
|
+
IN_FAILED_SQL_TRANSACTION = "25P02",
|
122
|
+
IDLE_IN_TRANSACTION_SESSION_TIMEOUT = "25P03",
|
123
|
+
INVALID_SQL_STATEMENT_NAME = "26000",
|
124
|
+
TRIGGERED_DATA_CHANGE_VIOLATION = "27000",
|
125
|
+
INVALID_AUTHORIZATION_SPECIFICATION = "28000",
|
126
|
+
INVALID_PASSWORD = "28P01",
|
127
|
+
DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST = "2B000",
|
128
|
+
DEPENDENT_OBJECTS_STILL_EXIST = "2BP01",
|
129
|
+
INVALID_TRANSACTION_TERMINATION = "2D000",
|
130
|
+
SQL_ROUTINE_EXCEPTION = "2F000",
|
131
|
+
S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT = "2F005",
|
132
|
+
S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED = "2F002",
|
133
|
+
S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED = "2F003",
|
134
|
+
S_R_E_READING_SQL_DATA_NOT_PERMITTED = "2F004",
|
135
|
+
INVALID_CURSOR_NAME = "34000",
|
136
|
+
EXTERNAL_ROUTINE_EXCEPTION = "38000",
|
137
|
+
E_R_E_CONTAINING_SQL_NOT_PERMITTED = "38001",
|
138
|
+
E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED = "38002",
|
139
|
+
E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED = "38003",
|
140
|
+
E_R_E_READING_SQL_DATA_NOT_PERMITTED = "38004",
|
141
|
+
EXTERNAL_ROUTINE_INVOCATION_EXCEPTION = "39000",
|
142
|
+
E_R_I_E_INVALID_SQLSTATE_RETURNED = "39001",
|
143
|
+
E_R_I_E_NULL_VALUE_NOT_ALLOWED = "39004",
|
144
|
+
E_R_I_E_TRIGGER_PROTOCOL_VIOLATED = "39P01",
|
145
|
+
E_R_I_E_SRF_PROTOCOL_VIOLATED = "39P02",
|
146
|
+
E_R_I_E_EVENT_TRIGGER_PROTOCOL_VIOLATED = "39P03",
|
147
|
+
SAVEPOINT_EXCEPTION = "3B000",
|
148
|
+
S_E_INVALID_SPECIFICATION = "3B001",
|
149
|
+
INVALID_CATALOG_NAME = "3D000",
|
150
|
+
INVALID_SCHEMA_NAME = "3F000",
|
151
|
+
TRANSACTION_ROLLBACK = "40000",
|
152
|
+
T_R_INTEGRITY_CONSTRAINT_VIOLATION = "40002",
|
153
|
+
T_R_SERIALIZATION_FAILURE = "40001",
|
154
|
+
T_R_STATEMENT_COMPLETION_UNKNOWN = "40003",
|
155
|
+
T_R_DEADLOCK_DETECTED = "40P01",
|
156
|
+
SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = "42000",
|
157
|
+
SYNTAX_ERROR = "42601",
|
158
|
+
INSUFFICIENT_PRIVILEGE = "42501",
|
159
|
+
CANNOT_COERCE = "42846",
|
160
|
+
GROUPING_ERROR = "42803",
|
161
|
+
WINDOWING_ERROR = "42P20",
|
162
|
+
INVALID_RECURSION = "42P19",
|
163
|
+
INVALID_FOREIGN_KEY = "42830",
|
164
|
+
INVALID_NAME = "42602",
|
165
|
+
NAME_TOO_LONG = "42622",
|
166
|
+
RESERVED_NAME = "42939",
|
167
|
+
DATATYPE_MISMATCH = "42804",
|
168
|
+
INDETERMINATE_DATATYPE = "42P18",
|
169
|
+
COLLATION_MISMATCH = "42P21",
|
170
|
+
INDETERMINATE_COLLATION = "42P22",
|
171
|
+
WRONG_OBJECT_TYPE = "42809",
|
172
|
+
GENERATED_ALWAYS = "428C9",
|
173
|
+
UNDEFINED_COLUMN = "42703",
|
174
|
+
UNDEFINED_CURSOR = "34000",
|
175
|
+
UNDEFINED_DATABASE = "3D000",
|
176
|
+
UNDEFINED_FUNCTION = "42883",
|
177
|
+
UNDEFINED_PSTATEMENT = "26000",
|
178
|
+
UNDEFINED_SCHEMA = "3F000",
|
179
|
+
UNDEFINED_TABLE = "42P01",
|
180
|
+
UNDEFINED_PARAMETER = "42P02",
|
181
|
+
UNDEFINED_OBJECT = "42704",
|
182
|
+
DUPLICATE_COLUMN = "42701",
|
183
|
+
DUPLICATE_CURSOR = "42P03",
|
184
|
+
DUPLICATE_DATABASE = "42P04",
|
185
|
+
DUPLICATE_FUNCTION = "42723",
|
186
|
+
DUPLICATE_PSTATEMENT = "42P05",
|
187
|
+
DUPLICATE_SCHEMA = "42P06",
|
188
|
+
DUPLICATE_TABLE = "42P07",
|
189
|
+
DUPLICATE_ALIAS = "42712",
|
190
|
+
DUPLICATE_OBJECT = "42710",
|
191
|
+
AMBIGUOUS_COLUMN = "42702",
|
192
|
+
AMBIGUOUS_FUNCTION = "42725",
|
193
|
+
AMBIGUOUS_PARAMETER = "42P08",
|
194
|
+
AMBIGUOUS_ALIAS = "42P09",
|
195
|
+
INVALID_COLUMN_REFERENCE = "42P10",
|
196
|
+
INVALID_COLUMN_DEFINITION = "42611",
|
197
|
+
INVALID_CURSOR_DEFINITION = "42P11",
|
198
|
+
INVALID_DATABASE_DEFINITION = "42P12",
|
199
|
+
INVALID_FUNCTION_DEFINITION = "42P13",
|
200
|
+
INVALID_PSTATEMENT_DEFINITION = "42P14",
|
201
|
+
INVALID_SCHEMA_DEFINITION = "42P15",
|
202
|
+
INVALID_TABLE_DEFINITION = "42P16",
|
203
|
+
INVALID_OBJECT_DEFINITION = "42P17",
|
204
|
+
WITH_CHECK_OPTION_VIOLATION = "44000",
|
205
|
+
INSUFFICIENT_RESOURCES = "53000",
|
206
|
+
DISK_FULL = "53100",
|
207
|
+
OUT_OF_MEMORY = "53200",
|
208
|
+
TOO_MANY_CONNECTIONS = "53300",
|
209
|
+
CONFIGURATION_LIMIT_EXCEEDED = "53400",
|
210
|
+
PROGRAM_LIMIT_EXCEEDED = "54000",
|
211
|
+
STATEMENT_TOO_COMPLEX = "54001",
|
212
|
+
TOO_MANY_COLUMNS = "54011",
|
213
|
+
TOO_MANY_ARGUMENTS = "54023",
|
214
|
+
OBJECT_NOT_IN_PREREQUISITE_STATE = "55000",
|
215
|
+
OBJECT_IN_USE = "55006",
|
216
|
+
CANT_CHANGE_RUNTIME_PARAM = "55P02",
|
217
|
+
LOCK_NOT_AVAILABLE = "55P03",
|
218
|
+
UNSAFE_NEW_ENUM_VALUE_USAGE = "55P04",
|
219
|
+
OPERATOR_INTERVENTION = "57000",
|
220
|
+
QUERY_CANCELED = "57014",
|
221
|
+
ADMIN_SHUTDOWN = "57P01",
|
222
|
+
CRASH_SHUTDOWN = "57P02",
|
223
|
+
CANNOT_CONNECT_NOW = "57P03",
|
224
|
+
DATABASE_DROPPED = "57P04",
|
225
|
+
IDLE_SESSION_TIMEOUT = "57P05",
|
226
|
+
SYSTEM_ERROR = "58000",
|
227
|
+
IO_ERROR = "58030",
|
228
|
+
UNDEFINED_FILE = "58P01",
|
229
|
+
DUPLICATE_FILE = "58P02",
|
230
|
+
SNAPSHOT_TOO_OLD = "72000",
|
231
|
+
CONFIG_FILE_ERROR = "F0000",
|
232
|
+
LOCK_FILE_EXISTS = "F0001",
|
233
|
+
FDW_ERROR = "HV000",
|
234
|
+
FDW_COLUMN_NAME_NOT_FOUND = "HV005",
|
235
|
+
FDW_DYNAMIC_PARAMETER_VALUE_NEEDED = "HV002",
|
236
|
+
FDW_FUNCTION_SEQUENCE_ERROR = "HV010",
|
237
|
+
FDW_INCONSISTENT_DESCRIPTOR_INFORMATION = "HV021",
|
238
|
+
FDW_INVALID_ATTRIBUTE_VALUE = "HV024",
|
239
|
+
FDW_INVALID_COLUMN_NAME = "HV007",
|
240
|
+
FDW_INVALID_COLUMN_NUMBER = "HV008",
|
241
|
+
FDW_INVALID_DATA_TYPE = "HV004",
|
242
|
+
FDW_INVALID_DATA_TYPE_DESCRIPTORS = "HV006",
|
243
|
+
FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER = "HV091",
|
244
|
+
FDW_INVALID_HANDLE = "HV00B",
|
245
|
+
FDW_INVALID_OPTION_INDEX = "HV00C",
|
246
|
+
FDW_INVALID_OPTION_NAME = "HV00D",
|
247
|
+
FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH = "HV090",
|
248
|
+
FDW_INVALID_STRING_FORMAT = "HV00A",
|
249
|
+
FDW_INVALID_USE_OF_NULL_POINTER = "HV009",
|
250
|
+
FDW_TOO_MANY_HANDLES = "HV014",
|
251
|
+
FDW_OUT_OF_MEMORY = "HV001",
|
252
|
+
FDW_NO_SCHEMAS = "HV00P",
|
253
|
+
FDW_OPTION_NAME_NOT_FOUND = "HV00J",
|
254
|
+
FDW_REPLY_HANDLE = "HV00K",
|
255
|
+
FDW_SCHEMA_NOT_FOUND = "HV00Q",
|
256
|
+
FDW_TABLE_NOT_FOUND = "HV00R",
|
257
|
+
FDW_UNABLE_TO_CREATE_EXECUTION = "HV00L",
|
258
|
+
FDW_UNABLE_TO_CREATE_REPLY = "HV00M",
|
259
|
+
FDW_UNABLE_TO_ESTABLISH_CONNECTION = "HV00N",
|
260
|
+
PLPGSQL_ERROR = "P0000",
|
261
|
+
RAISE_EXCEPTION = "P0001",
|
262
|
+
NO_DATA_FOUND = "P0002",
|
263
|
+
TOO_MANY_ROWS = "P0003",
|
264
|
+
ASSERT_FAILURE = "P0004",
|
265
|
+
INTERNAL_ERROR = "XX000",
|
266
|
+
DATA_CORRUPTED = "XX001",
|
267
|
+
INDEX_CORRUPTED = "XX002"
|
268
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/**
|
2
|
+
* If value is undefined, return default value otherwise assert it meets assertion rule
|
3
|
+
*/
|
4
|
+
export declare function assertAssignWithDefaultUndefinedValue<T>(value: unknown, assertionFunc: (val: unknown) => asserts val is T, defaultValue: T, errorMessage?: string): T;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function assertIsDefined<T>(value: T): asserts value is NonNullable<T>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function assertIsObject(val: any): asserts val is object;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function assertIsString(val: any): asserts val is string;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/lib/index.d.ts
CHANGED
@@ -3,3 +3,10 @@ export * from './ConnectionManager';
|
|
3
3
|
export * from './Migrator';
|
4
4
|
export * from './Repositories';
|
5
5
|
export * from './getConnectionInfo';
|
6
|
+
export * from './PostgresErrorCodes';
|
7
|
+
export * from './assertions/assertIsString';
|
8
|
+
export * from './assertions/assertIsDefined';
|
9
|
+
export * from './assertions/assertIsMapOfStringString';
|
10
|
+
export * from './assertions/assertIsObject';
|
11
|
+
export * from './assertions/assertAssignWithDefaultUndefinedValue';
|
12
|
+
export * from './assertions/assertAssign';
|