data-api-client 2.0.0-beta.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +639 -146
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +79 -0
- package/dist/compat/errors.d.ts +28 -0
- package/dist/compat/errors.d.ts.map +1 -0
- package/dist/compat/errors.js +163 -0
- package/dist/compat/index.d.ts +7 -0
- package/dist/compat/index.d.ts.map +1 -0
- package/dist/compat/index.js +12 -0
- package/dist/compat/mysql2.d.ts +86 -0
- package/dist/compat/mysql2.d.ts.map +1 -0
- package/dist/compat/mysql2.js +350 -0
- package/dist/compat/pg.d.ts +142 -0
- package/dist/compat/pg.d.ts.map +1 -0
- package/dist/compat/pg.js +344 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/params.d.ts +19 -0
- package/dist/params.d.ts.map +1 -0
- package/dist/params.js +125 -0
- package/dist/query.d.ts +5 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +39 -0
- package/dist/results.d.ts +12 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/results.js +93 -0
- package/dist/retry.d.ts +11 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +76 -0
- package/dist/transaction.d.ts +4 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +59 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/utils.d.ts +19 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +150 -0
- package/package.json +80 -9
- package/index.js +0 -642
package/dist/retry.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface RetryConfig {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
baseDelay?: number;
|
|
5
|
+
retryableErrors?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function isDatabaseResuming(error: any): boolean;
|
|
8
|
+
export declare function isConnectionError(error: any): boolean;
|
|
9
|
+
export declare function isRetryableError(error: any): boolean;
|
|
10
|
+
export declare function withRetry<T>(fn: () => Promise<T>, config?: RetryConfig): Promise<T>;
|
|
11
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B;AAwBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAMtD;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAarD;AAKD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAEpD;AAUD,wBAAsB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAoD7F"}
|
package/dist/retry.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDatabaseResuming = isDatabaseResuming;
|
|
4
|
+
exports.isConnectionError = isConnectionError;
|
|
5
|
+
exports.isRetryableError = isRetryableError;
|
|
6
|
+
exports.withRetry = withRetry;
|
|
7
|
+
const RESUMING_RETRY_DELAYS = [0, 2000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000];
|
|
8
|
+
const CONNECTION_RETRY_DELAYS = [0, 2000, 4000];
|
|
9
|
+
const CONNECTION_ERROR_PATTERNS = [
|
|
10
|
+
'Communications link failure',
|
|
11
|
+
'Connection is not available',
|
|
12
|
+
'currently unavailable',
|
|
13
|
+
'Database cluster is not available',
|
|
14
|
+
"Can't connect to",
|
|
15
|
+
'Connection timed out'
|
|
16
|
+
];
|
|
17
|
+
function isDatabaseResuming(error) {
|
|
18
|
+
if (!error)
|
|
19
|
+
return false;
|
|
20
|
+
const code = error.code || error.Code || error.name || '';
|
|
21
|
+
const message = error.message || error.Message || '';
|
|
22
|
+
return code === 'DatabaseResumingException' || message.includes('is resuming after being auto-paused');
|
|
23
|
+
}
|
|
24
|
+
function isConnectionError(error) {
|
|
25
|
+
if (!error)
|
|
26
|
+
return false;
|
|
27
|
+
const message = error.message || error.Message || '';
|
|
28
|
+
const code = error.code || error.Code || error.name || '';
|
|
29
|
+
if (code === 'BadRequestException' || code === 'StatementTimeoutException') {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return CONNECTION_ERROR_PATTERNS.some((pattern) => message.includes(pattern));
|
|
33
|
+
}
|
|
34
|
+
function isRetryableError(error) {
|
|
35
|
+
return isDatabaseResuming(error) || isConnectionError(error);
|
|
36
|
+
}
|
|
37
|
+
async function withRetry(fn, config = {}) {
|
|
38
|
+
const { enabled = true, maxRetries = 9, retryableErrors = [] } = config;
|
|
39
|
+
if (!enabled) {
|
|
40
|
+
return fn();
|
|
41
|
+
}
|
|
42
|
+
let attempt = 0;
|
|
43
|
+
let retryDelays = [];
|
|
44
|
+
let maxAttempts = 0;
|
|
45
|
+
while (true) {
|
|
46
|
+
try {
|
|
47
|
+
if (attempt > 0 && retryDelays.length > 0) {
|
|
48
|
+
const delay = retryDelays[attempt] || retryDelays[retryDelays.length - 1];
|
|
49
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
50
|
+
}
|
|
51
|
+
return await fn();
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
let shouldRetry = false;
|
|
55
|
+
if (isDatabaseResuming(error)) {
|
|
56
|
+
retryDelays = RESUMING_RETRY_DELAYS;
|
|
57
|
+
maxAttempts = Math.min(maxRetries, retryDelays.length - 1);
|
|
58
|
+
shouldRetry = attempt < maxAttempts;
|
|
59
|
+
}
|
|
60
|
+
else if (isConnectionError(error)) {
|
|
61
|
+
retryDelays = CONNECTION_RETRY_DELAYS;
|
|
62
|
+
maxAttempts = CONNECTION_RETRY_DELAYS.length - 1;
|
|
63
|
+
shouldRetry = attempt < maxAttempts;
|
|
64
|
+
}
|
|
65
|
+
else if (retryableErrors.length > 0 && retryableErrors.includes(error.code || error.name)) {
|
|
66
|
+
retryDelays = RESUMING_RETRY_DELAYS;
|
|
67
|
+
maxAttempts = Math.min(maxRetries, retryDelays.length - 1);
|
|
68
|
+
shouldRetry = attempt < maxAttempts;
|
|
69
|
+
}
|
|
70
|
+
if (!shouldRetry) {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
attempt++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InternalConfig, Transaction, QueryOptions } from './types';
|
|
2
|
+
export declare const transaction: (config: InternalConfig, _args?: Partial<QueryOptions>) => Transaction;
|
|
3
|
+
export declare const commit: (config: InternalConfig, queries: Array<(lastResult: any, allResults: any[]) => any[]>, rollback: (err: Error, status: any) => void) => Promise<any[]>;
|
|
4
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAOxE,eAAO,MAAM,WAAW,GAAI,QAAQ,cAAc,EAAE,QAAQ,OAAO,CAAC,YAAY,CAAC,KAAG,WAiCnF,CAAA;AAGD,eAAO,MAAM,MAAM,GACjB,QAAQ,cAAc,EACtB,SAAS,KAAK,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC,EAC7D,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI,KAC1C,OAAO,CAAC,GAAG,EAAE,CAsCf,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commit = exports.transaction = void 0;
|
|
4
|
+
const client_rds_data_1 = require("@aws-sdk/client-rds-data");
|
|
5
|
+
const params_1 = require("./params");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const query_1 = require("./query");
|
|
8
|
+
const retry_1 = require("./retry");
|
|
9
|
+
const transaction = (config, _args) => {
|
|
10
|
+
const args = typeof _args === 'object' ? [_args] : [{}];
|
|
11
|
+
const queries = [];
|
|
12
|
+
let rollback = () => { };
|
|
13
|
+
const txConfig = Object.assign((0, params_1.prepareParams)(config, args), {
|
|
14
|
+
database: (0, params_1.parseDatabase)(config, args),
|
|
15
|
+
hydrateColumnNames: (0, params_1.parseHydrate)(config, args),
|
|
16
|
+
formatOptions: (0, params_1.parseFormatOptions)(config, args),
|
|
17
|
+
retryOptions: config.retryOptions,
|
|
18
|
+
RDS: config.RDS,
|
|
19
|
+
engine: config.engine
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
query: function (...args) {
|
|
23
|
+
if (typeof args[0] === 'function') {
|
|
24
|
+
queries.push(args[0]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
queries.push(() => [...args]);
|
|
28
|
+
}
|
|
29
|
+
return this;
|
|
30
|
+
},
|
|
31
|
+
rollback: function (fn) {
|
|
32
|
+
if (typeof fn === 'function') {
|
|
33
|
+
rollback = fn;
|
|
34
|
+
}
|
|
35
|
+
return this;
|
|
36
|
+
},
|
|
37
|
+
commit: async function () {
|
|
38
|
+
return await (0, exports.commit)(txConfig, queries, rollback);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.transaction = transaction;
|
|
43
|
+
const commit = async (config, queries, rollback) => {
|
|
44
|
+
const results = [];
|
|
45
|
+
const { transactionId } = await (0, retry_1.withRetry)(() => config.RDS.send(new client_rds_data_1.BeginTransactionCommand((0, utils_1.pick)(config, ['resourceArn', 'secretArn', 'database']))), config.retryOptions);
|
|
46
|
+
const txConfig = Object.assign(config, { transactionId });
|
|
47
|
+
for (let i = 0; i < queries.length; i++) {
|
|
48
|
+
const result = await query_1.query.apply({ rollback }, [config, queries[i](results[results.length - 1], results)]);
|
|
49
|
+
results.push(result);
|
|
50
|
+
}
|
|
51
|
+
const { transactionStatus } = await (0, retry_1.withRetry)(() => txConfig.RDS.send(new client_rds_data_1.CommitTransactionCommand({
|
|
52
|
+
resourceArn: txConfig.resourceArn,
|
|
53
|
+
secretArn: txConfig.secretArn,
|
|
54
|
+
transactionId: txConfig.transactionId
|
|
55
|
+
})), config.retryOptions);
|
|
56
|
+
results.push({ transactionStatus });
|
|
57
|
+
return results;
|
|
58
|
+
};
|
|
59
|
+
exports.commit = commit;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { RDSDataClient, RDSDataClientConfig, ExecuteStatementCommandOutput, BatchExecuteStatementCommandOutput, BeginTransactionCommandInput, BeginTransactionCommandOutput, CommitTransactionCommandInput, CommitTransactionCommandOutput, RollbackTransactionCommandInput, RollbackTransactionCommandOutput, ExecuteStatementCommandInput, BatchExecuteStatementCommandInput, ColumnMetadata, ResultSetOptions } from '@aws-sdk/client-rds-data';
|
|
2
|
+
export type SupportedType = 'arrayValue' | 'blobValue' | 'booleanValue' | 'doubleValue' | 'isNull' | 'longValue' | 'stringValue' | 'structValue';
|
|
3
|
+
export interface RetryConfig {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
maxRetries?: number;
|
|
6
|
+
retryableErrors?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface DataAPIClientConfig {
|
|
9
|
+
resourceArn: string;
|
|
10
|
+
secretArn: string;
|
|
11
|
+
database?: string;
|
|
12
|
+
engine?: 'mysql' | 'pg';
|
|
13
|
+
hydrateColumnNames?: boolean;
|
|
14
|
+
formatOptions?: FormatOptions;
|
|
15
|
+
retryOptions?: RetryConfig;
|
|
16
|
+
options?: RDSDataClientConfig;
|
|
17
|
+
client?: RDSDataClient;
|
|
18
|
+
region?: string;
|
|
19
|
+
sslEnabled?: boolean;
|
|
20
|
+
keepAlive?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface FormatOptions {
|
|
23
|
+
deserializeDate?: boolean;
|
|
24
|
+
treatAsLocalDate?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface InternalConfig {
|
|
27
|
+
engine: 'mysql' | 'pg';
|
|
28
|
+
secretArn: string;
|
|
29
|
+
resourceArn: string;
|
|
30
|
+
database?: string;
|
|
31
|
+
hydrateColumnNames: boolean;
|
|
32
|
+
formatOptions: Required<FormatOptions>;
|
|
33
|
+
retryOptions: Required<RetryConfig>;
|
|
34
|
+
RDS: RDSDataClient;
|
|
35
|
+
transactionId?: string;
|
|
36
|
+
}
|
|
37
|
+
export type ParameterValue = string | number | boolean | null | Date | Buffer | {
|
|
38
|
+
[key in SupportedType]?: any;
|
|
39
|
+
};
|
|
40
|
+
export interface NamedParameter {
|
|
41
|
+
name: string;
|
|
42
|
+
value: ParameterValue;
|
|
43
|
+
cast?: string;
|
|
44
|
+
}
|
|
45
|
+
export type Parameters = Record<string, ParameterValue> | NamedParameter[];
|
|
46
|
+
export interface QueryOptions {
|
|
47
|
+
sql: string;
|
|
48
|
+
parameters?: Parameters | Parameters[];
|
|
49
|
+
database?: string;
|
|
50
|
+
schema?: string;
|
|
51
|
+
continueAfterTimeout?: boolean;
|
|
52
|
+
includeResultMetadata?: boolean;
|
|
53
|
+
hydrateColumnNames?: boolean;
|
|
54
|
+
transactionId?: string;
|
|
55
|
+
secretArn?: string;
|
|
56
|
+
resourceArn?: string;
|
|
57
|
+
resultSetOptions?: ResultSetOptions;
|
|
58
|
+
formatOptions?: FormatOptions;
|
|
59
|
+
}
|
|
60
|
+
export interface FormattedParameter {
|
|
61
|
+
name: string;
|
|
62
|
+
value?: {
|
|
63
|
+
[key in SupportedType]?: any;
|
|
64
|
+
};
|
|
65
|
+
typeHint?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface SqlParamInfo {
|
|
68
|
+
type: 'n_ph' | 'n_id';
|
|
69
|
+
}
|
|
70
|
+
export interface QueryResult<T = any> {
|
|
71
|
+
records?: T[];
|
|
72
|
+
columnMetadata?: ColumnMetadata[];
|
|
73
|
+
numberOfRecordsUpdated?: number;
|
|
74
|
+
insertId?: number;
|
|
75
|
+
updateResults?: UpdateResult[];
|
|
76
|
+
}
|
|
77
|
+
export interface UpdateResult {
|
|
78
|
+
insertId?: number;
|
|
79
|
+
}
|
|
80
|
+
export interface Transaction {
|
|
81
|
+
query(sql: string, params?: Parameters): Transaction;
|
|
82
|
+
query(options: QueryOptions): Transaction;
|
|
83
|
+
query(fn: (lastResult: any, allResults: any[]) => [string, Parameters?]): Transaction;
|
|
84
|
+
rollback(fn: (error: Error, status: any) => void): Transaction;
|
|
85
|
+
commit(): Promise<any[]>;
|
|
86
|
+
}
|
|
87
|
+
export interface DataAPIClient {
|
|
88
|
+
query<T = any>(sql: string, params?: Parameters | Parameters[]): Promise<QueryResult<T>>;
|
|
89
|
+
query<T = any>(options: QueryOptions): Promise<QueryResult<T>>;
|
|
90
|
+
transaction(options?: Partial<QueryOptions>): Transaction;
|
|
91
|
+
batchExecuteStatement(args: BatchExecuteStatementCommandInput): Promise<BatchExecuteStatementCommandOutput>;
|
|
92
|
+
beginTransaction(args?: BeginTransactionCommandInput): Promise<BeginTransactionCommandOutput>;
|
|
93
|
+
commitTransaction(args: CommitTransactionCommandInput): Promise<CommitTransactionCommandOutput>;
|
|
94
|
+
executeStatement(args: ExecuteStatementCommandInput): Promise<ExecuteStatementCommandOutput>;
|
|
95
|
+
rollbackTransaction(args: RollbackTransactionCommandInput): Promise<RollbackTransactionCommandOutput>;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
package/dist/types.js
ADDED
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ParameterValue, SupportedType, SqlParamInfo } from './types';
|
|
2
|
+
export declare const supportedTypes: SupportedType[];
|
|
3
|
+
export declare const error: (...err: any[]) => never;
|
|
4
|
+
export declare const parseSQL: (args: any[]) => string;
|
|
5
|
+
export declare const omit: <T extends Record<string, any>>(obj: T, values: string[]) => Partial<T>;
|
|
6
|
+
export declare const pick: <T extends Record<string, any>, K extends keyof T>(obj: T, values: K[]) => Pick<T, K>;
|
|
7
|
+
export declare const flatten: <T>(arr: T[][]) => T[];
|
|
8
|
+
export declare const getSqlParams: (sql: string) => Record<string, SqlParamInfo>;
|
|
9
|
+
export declare const getType: (val: ParameterValue) => SupportedType | null | undefined;
|
|
10
|
+
export declare const isDate: (val: any) => val is Date;
|
|
11
|
+
export declare const isDateString: (val: string) => boolean;
|
|
12
|
+
export declare const isTimeString: (val: string) => boolean;
|
|
13
|
+
export declare const isDecimalString: (val: string) => boolean;
|
|
14
|
+
export declare const isUUIDString: (val: string) => boolean;
|
|
15
|
+
export declare const isJSONString: (val: string) => boolean;
|
|
16
|
+
export declare const getTypeHint: (val: ParameterValue, engine?: string) => string | undefined;
|
|
17
|
+
export declare const formatToTimeStamp: (date: Date, treatAsLocalDate: boolean) => string;
|
|
18
|
+
export declare const formatFromTimeStamp: (value: string, treatAsLocalDate: boolean) => Date;
|
|
19
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG1E,eAAO,MAAM,cAAc,EAAE,aAAa,EASzC,CAAA;AAGD,eAAO,MAAM,KAAK,GAAI,GAAG,KAAK,GAAG,EAAE,KAAG,KAErC,CAAA;AAGD,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,EAAE,KAAG,MAKI,CAAA;AAG3C,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,MAAM,EAAE,KAAG,OAAO,CAAC,CAAC,CACiC,CAAA;AAGzH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,EAAE,KAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAInG,CAAA;AAGH,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,KAAG,CAAC,EAA+C,CAAA;AAGxF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CA8CrE,CAAA;AAID,eAAO,MAAM,OAAO,GAAI,KAAK,cAAc,KAAG,aAAa,GAAG,IAAI,GAAG,SAsBtD,CAAA;AAKf,eAAO,MAAM,MAAM,GAAI,KAAK,GAAG,KAAG,GAAG,IAAI,IAA2B,CAAA;AAGpE,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OACV,CAAA;AAGjC,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OACE,CAAA;AAG7C,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,OACpB,CAAA;AAG1B,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OACkC,CAAA;AAG7E,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OAU1C,CAAA;AAID,eAAO,MAAM,WAAW,GAAI,KAAK,cAAc,EAAE,SAAS,MAAM,KAAG,MAAM,GAAG,SAqC3E,CAAA;AAID,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,kBAAkB,OAAO,KAAG,MAezE,CAAA;AAKD,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,EAAE,kBAAkB,OAAO,KAAG,IAG1D,CAAA"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatFromTimeStamp = exports.formatToTimeStamp = exports.getTypeHint = exports.isJSONString = exports.isUUIDString = exports.isDecimalString = exports.isTimeString = exports.isDateString = exports.isDate = exports.getType = exports.getSqlParams = exports.flatten = exports.pick = exports.omit = exports.parseSQL = exports.error = exports.supportedTypes = void 0;
|
|
4
|
+
exports.supportedTypes = [
|
|
5
|
+
'arrayValue',
|
|
6
|
+
'blobValue',
|
|
7
|
+
'booleanValue',
|
|
8
|
+
'doubleValue',
|
|
9
|
+
'isNull',
|
|
10
|
+
'longValue',
|
|
11
|
+
'stringValue',
|
|
12
|
+
'structValue'
|
|
13
|
+
];
|
|
14
|
+
const error = (...err) => {
|
|
15
|
+
throw Error(...err);
|
|
16
|
+
};
|
|
17
|
+
exports.error = error;
|
|
18
|
+
const parseSQL = (args) => typeof args[0] === 'string'
|
|
19
|
+
? args[0]
|
|
20
|
+
: typeof args[0] === 'object' && typeof args[0].sql === 'string'
|
|
21
|
+
? args[0].sql
|
|
22
|
+
: (0, exports.error)(`No 'sql' statement provided.`);
|
|
23
|
+
exports.parseSQL = parseSQL;
|
|
24
|
+
const omit = (obj, values) => Object.keys(obj).reduce((acc, x) => (values.includes(x) ? acc : Object.assign(acc, { [x]: obj[x] })), {});
|
|
25
|
+
exports.omit = omit;
|
|
26
|
+
const pick = (obj, values) => Object.keys(obj).reduce((acc, x) => (values.includes(x) ? Object.assign(acc, { [x]: obj[x] }) : acc), {});
|
|
27
|
+
exports.pick = pick;
|
|
28
|
+
const flatten = (arr) => arr.reduce((acc, x) => acc.concat(x), []);
|
|
29
|
+
exports.flatten = flatten;
|
|
30
|
+
const getSqlParams = (sql) => {
|
|
31
|
+
const matches = [];
|
|
32
|
+
const regex = /:{1,2}\w+/g;
|
|
33
|
+
let match;
|
|
34
|
+
while ((match = regex.exec(sql)) !== null) {
|
|
35
|
+
const matchedText = match[0];
|
|
36
|
+
const matchIndex = match.index;
|
|
37
|
+
if (matchedText.startsWith('::')) {
|
|
38
|
+
const beforeMatch = sql.substring(Math.max(0, matchIndex - 20), matchIndex);
|
|
39
|
+
const hasParamBefore = /:\w+$/.test(beforeMatch);
|
|
40
|
+
if (!hasParamBefore) {
|
|
41
|
+
matches.push(matchedText);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
matches.push(matchedText);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return matches
|
|
49
|
+
.map((p) => {
|
|
50
|
+
return p.startsWith('::')
|
|
51
|
+
? { type: 'n_id', label: p.substr(2) }
|
|
52
|
+
: { type: 'n_ph', label: p.substr(1) };
|
|
53
|
+
})
|
|
54
|
+
.reduce((acc, x) => {
|
|
55
|
+
return Object.assign(acc, {
|
|
56
|
+
[x.label]: {
|
|
57
|
+
type: x.type
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}, {});
|
|
61
|
+
};
|
|
62
|
+
exports.getSqlParams = getSqlParams;
|
|
63
|
+
const getType = (val) => typeof val === 'string'
|
|
64
|
+
? 'stringValue'
|
|
65
|
+
: typeof val === 'boolean'
|
|
66
|
+
? 'booleanValue'
|
|
67
|
+
: typeof val === 'number' && parseInt(val.toString()) === val
|
|
68
|
+
? 'longValue'
|
|
69
|
+
: typeof val === 'number' && parseFloat(val.toString()) === val
|
|
70
|
+
? 'doubleValue'
|
|
71
|
+
: val === null
|
|
72
|
+
? 'isNull'
|
|
73
|
+
: (0, exports.isDate)(val)
|
|
74
|
+
? 'stringValue'
|
|
75
|
+
: Buffer.isBuffer(val)
|
|
76
|
+
? 'blobValue'
|
|
77
|
+
:
|
|
78
|
+
typeof val === 'object' &&
|
|
79
|
+
val !== null &&
|
|
80
|
+
Object.keys(val).length === 1 &&
|
|
81
|
+
exports.supportedTypes.includes(Object.keys(val)[0])
|
|
82
|
+
? null
|
|
83
|
+
: undefined;
|
|
84
|
+
exports.getType = getType;
|
|
85
|
+
const isDate = (val) => val instanceof Date;
|
|
86
|
+
exports.isDate = isDate;
|
|
87
|
+
const isDateString = (val) => /^\d{4}-\d{2}-\d{2}$/.test(val);
|
|
88
|
+
exports.isDateString = isDateString;
|
|
89
|
+
const isTimeString = (val) => /^\d{2}:\d{2}:\d{2}(\.\d{1,3})?$/.test(val);
|
|
90
|
+
exports.isTimeString = isTimeString;
|
|
91
|
+
const isDecimalString = (val) => /^-?\d+\.\d+$/.test(val);
|
|
92
|
+
exports.isDecimalString = isDecimalString;
|
|
93
|
+
const isUUIDString = (val) => /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val);
|
|
94
|
+
exports.isUUIDString = isUUIDString;
|
|
95
|
+
const isJSONString = (val) => {
|
|
96
|
+
if (typeof val !== 'string')
|
|
97
|
+
return false;
|
|
98
|
+
const trimmed = val.trim();
|
|
99
|
+
if (!trimmed.startsWith('{') && !trimmed.startsWith('['))
|
|
100
|
+
return false;
|
|
101
|
+
try {
|
|
102
|
+
const parsed = JSON.parse(val);
|
|
103
|
+
return typeof parsed === 'object' && parsed !== null;
|
|
104
|
+
}
|
|
105
|
+
catch (_a) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
exports.isJSONString = isJSONString;
|
|
110
|
+
const getTypeHint = (val, engine) => {
|
|
111
|
+
if ((0, exports.isDate)(val)) {
|
|
112
|
+
return 'TIMESTAMP';
|
|
113
|
+
}
|
|
114
|
+
if (typeof val === 'string') {
|
|
115
|
+
if ((0, exports.isUUIDString)(val) && engine !== 'mysql') {
|
|
116
|
+
return 'UUID';
|
|
117
|
+
}
|
|
118
|
+
if ((0, exports.isDateString)(val)) {
|
|
119
|
+
return 'DATE';
|
|
120
|
+
}
|
|
121
|
+
if ((0, exports.isTimeString)(val)) {
|
|
122
|
+
return 'TIME';
|
|
123
|
+
}
|
|
124
|
+
if ((0, exports.isJSONString)(val) && engine !== 'mysql') {
|
|
125
|
+
return 'JSON';
|
|
126
|
+
}
|
|
127
|
+
if ((0, exports.isDecimalString)(val)) {
|
|
128
|
+
return 'DECIMAL';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
133
|
+
exports.getTypeHint = getTypeHint;
|
|
134
|
+
const formatToTimeStamp = (date, treatAsLocalDate) => {
|
|
135
|
+
const pad = (val, num = 2) => '0'.repeat(num - (val + '').length) + val;
|
|
136
|
+
const year = treatAsLocalDate ? date.getFullYear() : date.getUTCFullYear();
|
|
137
|
+
const month = (treatAsLocalDate ? date.getMonth() : date.getUTCMonth()) + 1;
|
|
138
|
+
const day = treatAsLocalDate ? date.getDate() : date.getUTCDate();
|
|
139
|
+
const hours = treatAsLocalDate ? date.getHours() : date.getUTCHours();
|
|
140
|
+
const minutes = treatAsLocalDate ? date.getMinutes() : date.getUTCMinutes();
|
|
141
|
+
const seconds = treatAsLocalDate ? date.getSeconds() : date.getUTCSeconds();
|
|
142
|
+
const ms = treatAsLocalDate ? date.getMilliseconds() : date.getUTCMilliseconds();
|
|
143
|
+
const fraction = ms <= 0 ? '' : `.${pad(ms, 3)}`;
|
|
144
|
+
return `${year}-${pad(month)}-${pad(day)} ${pad(hours)}:${pad(minutes)}:${pad(seconds)}${fraction}`;
|
|
145
|
+
};
|
|
146
|
+
exports.formatToTimeStamp = formatToTimeStamp;
|
|
147
|
+
const formatFromTimeStamp = (value, treatAsLocalDate) => !treatAsLocalDate && /^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2}(\.\d+)?)?$/.test(value)
|
|
148
|
+
? new Date(value + 'Z')
|
|
149
|
+
: new Date(value);
|
|
150
|
+
exports.formatFromTimeStamp = formatFromTimeStamp;
|
package/package.json
CHANGED
|
@@ -1,12 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-api-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A lightweight wrapper that simplifies working with the Amazon Aurora Serverless Data API",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./compat/pg": {
|
|
14
|
+
"types": "./dist/compat/pg.d.ts",
|
|
15
|
+
"import": "./dist/compat/pg.js",
|
|
16
|
+
"require": "./dist/compat/pg.js"
|
|
17
|
+
},
|
|
18
|
+
"./compat/mysql2": {
|
|
19
|
+
"types": "./dist/compat/mysql2.d.ts",
|
|
20
|
+
"import": "./dist/compat/mysql2.js",
|
|
21
|
+
"require": "./dist/compat/mysql2.js"
|
|
22
|
+
},
|
|
23
|
+
"./compat": {
|
|
24
|
+
"types": "./dist/compat/index.d.ts",
|
|
25
|
+
"import": "./dist/compat/index.js",
|
|
26
|
+
"require": "./dist/compat/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./types": {
|
|
29
|
+
"types": "./dist/types.d.ts",
|
|
30
|
+
"import": "./dist/types.js",
|
|
31
|
+
"require": "./dist/types.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
6
34
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
35
|
+
"build": "tsc",
|
|
36
|
+
"build:watch": "tsc --watch",
|
|
37
|
+
"prebuild": "rm -rf dist",
|
|
38
|
+
"test": "npm run build && vitest run src/",
|
|
39
|
+
"test:unit": "npm run build && vitest run src/",
|
|
40
|
+
"test:int:core": "npm run build && vitest run integration-tests/mysql.int.test.ts integration-tests/pg-compat.int.test.ts",
|
|
41
|
+
"test:int:core:mysql": "npm run build && vitest run integration-tests/mysql.int.test.ts",
|
|
42
|
+
"test:int:core:pg": "npm run build && vitest run integration-tests/postgres.int.test.ts",
|
|
43
|
+
"test:int:compat": "npm run build && vitest run integration-tests/pg-compat.int.test.ts integration-tests/mysql2-compat.int.test.ts",
|
|
44
|
+
"test:int:compat:pg": "npm run build && vitest run integration-tests/pg-compat.int.test.ts",
|
|
45
|
+
"test:int:compat:mysql": "npm run build && vitest run integration-tests/mysql2-compat.int.test.ts",
|
|
46
|
+
"test:int:orm:kysely": "npm run build && vitest run integration-tests/kysely-pg.int.test.ts integration-tests/kysely-mysql.int.test.ts",
|
|
47
|
+
"test:int:orm:kysely:pg": "npm run build && vitest run integration-tests/kysely-pg.int.test.ts",
|
|
48
|
+
"test:int:orm:kysely:mysql": "npm run build && vitest run integration-tests/kysely-mysql.int.test.ts",
|
|
49
|
+
"test:int:orm:drizzle": "npm run build && vitest run integration-tests/drizzle-pg.int.test.ts && vitest run integration-tests/drizzle-mysql.int.test.ts",
|
|
50
|
+
"test:int:orm:drizzle:pg": "npm run build && vitest run integration-tests/drizzle-pg.int.test.ts",
|
|
51
|
+
"test:int:orm:drizzle:mysql": "npm run build && vitest run integration-tests/drizzle-mysql.int.test.ts",
|
|
52
|
+
"test:int:orm:knex": "npm run build && vitest run integration-tests/knex-mysql.int.test.ts",
|
|
53
|
+
"test-ci": "npm run build && eslint src && vitest run src/",
|
|
54
|
+
"lint": "eslint src",
|
|
55
|
+
"prepublishOnly": "npm run build"
|
|
10
56
|
},
|
|
11
57
|
"repository": {
|
|
12
58
|
"type": "git",
|
|
@@ -24,17 +70,42 @@
|
|
|
24
70
|
"url": "https://github.com/jeremydaly/data-api-client/issues"
|
|
25
71
|
},
|
|
26
72
|
"homepage": "https://github.com/jeremydaly/data-api-client#readme",
|
|
73
|
+
"imports": {
|
|
74
|
+
"#fixtures/*": "./fixtures/*"
|
|
75
|
+
},
|
|
27
76
|
"devDependencies": {
|
|
77
|
+
"@aws-sdk/client-rds-data": "^3.712.0",
|
|
78
|
+
"@types/node": "^24.6.2",
|
|
79
|
+
"@types/pg": "^8.15.5",
|
|
80
|
+
"@types/pg-escape": "^0.2.3",
|
|
81
|
+
"@types/sqlstring": "^2.3.2",
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
|
83
|
+
"@typescript-eslint/parser": "^8.45.0",
|
|
84
|
+
"@vitest/ui": "^3.2.4",
|
|
85
|
+
"drizzle-orm": "^0.44.6",
|
|
28
86
|
"eslint": "^8.12.0",
|
|
29
87
|
"eslint-config-prettier": "^8.5.0",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
88
|
+
"knex": "^3.1.0",
|
|
89
|
+
"kysely": "^0.28.7",
|
|
90
|
+
"pg": "^8.16.3",
|
|
91
|
+
"prettier": "^2.6.2",
|
|
92
|
+
"tsx": "^4.20.6",
|
|
93
|
+
"typescript": "^5.9.3",
|
|
94
|
+
"vitest": "^3.2.4"
|
|
32
95
|
},
|
|
33
96
|
"dependencies": {
|
|
34
|
-
"
|
|
97
|
+
"pg-escape": "^0.2.0",
|
|
35
98
|
"sqlstring": "^2.3.2"
|
|
36
99
|
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@aws-sdk/client-rds-data": "^3.0.0"
|
|
102
|
+
},
|
|
103
|
+
"peerDependenciesMeta": {
|
|
104
|
+
"@aws-sdk/client-rds-data": {
|
|
105
|
+
"optional": true
|
|
106
|
+
}
|
|
107
|
+
},
|
|
37
108
|
"files": [
|
|
38
|
-
"
|
|
109
|
+
"dist"
|
|
39
110
|
]
|
|
40
111
|
}
|