diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e97a7b0b8..08aaa1981 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: node-version: [18.x, 20.x, 22.x] - bun-version: [1.0.23] + bun-version: [1.1.x] deno-version: [1.42.x] steps: diff --git a/package-lock.json b/package-lock.json index 130948e42..bfd34db09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "prettier": "^3.1.1", "sinon": "^17.0.1", "tarn": "^3.0.2", - "tedious": "^16.4.0", + "tedious": "^18.2.0", "tsd": "^0.30.3", "tsx": "^4.10.5", "typescript": "^5.4.2" @@ -1226,22 +1226,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -1251,28 +1235,6 @@ "node": ">=8" } }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -1291,21 +1253,6 @@ "node": "*" } }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1438,25 +1385,6 @@ "node": ">=4" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -1717,23 +1645,6 @@ "node": ">=4.0.0" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -1743,23 +1654,6 @@ "node": ">=8" } }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/denque": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", @@ -1841,135 +1735,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-abstract": { - "version": "1.22.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", - "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "hasown": "^2.0.1", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", - "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", - "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.5", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-aggregate-error": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.12.tgz", - "integrity": "sha512-j0PupcmELoVbYS2NNrsn5zcLLEsryQwP02x8fRawh7c2eEaPHwJFAxltZsqV7HJjsF57+SMpYyVRWgbVLfOagg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.1", - "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.1.0", - "function-bind": "^1.1.2", - "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.1", - "set-function-name": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/esbuild": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", @@ -2152,15 +1917,6 @@ "flat": "cli.js" } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -2196,33 +1952,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/generate-function": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", @@ -2335,21 +2064,6 @@ "node": ">= 6" } }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -2370,18 +2084,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -2391,15 +2093,6 @@ "node": ">=6" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2409,57 +2102,6 @@ "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasown": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", @@ -2604,20 +2246,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/irregular-plurals": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", @@ -2627,40 +2255,12 @@ "node": ">=8" } }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2673,34 +2273,6 @@ "node": ">=8" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -2713,21 +2285,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -2755,151 +2312,48 @@ "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", - "dev": true - }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.12.0" } }, - "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, - "dependencies": { - "which-typed-array": "^1.1.14" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "dev": true + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -2912,18 +2366,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -2936,12 +2378,6 @@ "node": ">=8" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -2990,12 +2426,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbi": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.0.tgz", - "integrity": "sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==", - "dev": true - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -3448,12 +2878,6 @@ "node": ">=10" } }, - "node_modules/node-abort-controller": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", - "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", - "dev": true - }, "node_modules/normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -3478,42 +2902,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -3885,15 +3273,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postgres-array": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", @@ -4261,24 +3640,6 @@ "node": ">=8" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4347,24 +3708,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", - "has-symbols": "^1.0.3", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4385,23 +3728,6 @@ } ] }, - "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-regex": "^1.1.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -4450,56 +3776,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.2", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/simple-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", @@ -4682,51 +3958,6 @@ "node": ">=8" } }, - "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -4853,25 +4084,23 @@ } }, "node_modules/tedious": { - "version": "16.7.1", - "resolved": "https://registry.npmjs.org/tedious/-/tedious-16.7.1.tgz", - "integrity": "sha512-NmedZS0NJiTv3CoYnf1FtjxIDUgVYzEmavrc8q2WHRb+lP4deI9BpQfmNnBZZaWusDbP5FVFZCcvzb3xOlNVlQ==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/tedious/-/tedious-18.2.0.tgz", + "integrity": "sha512-PCELoE17gN71lk0A87+WITcIJ6uGagrV2hXVJT5ige/Yef+YCLVpQ/Je12rOZT7vBhVZoMp6MvaBmbfI8fw0ag==", "dev": true, "dependencies": { "@azure/identity": "^3.4.1", "@azure/keyvault-keys": "^4.4.0", - "@js-joda/core": "^5.5.3", - "bl": "^6.0.3", - "es-aggregate-error": "^1.0.9", + "@js-joda/core": "^5.6.1", + "@types/node": ">=18", + "bl": "^6.0.11", "iconv-lite": "^0.6.3", "js-md4": "^0.3.2", - "jsbi": "^4.3.0", "native-duplexpair": "^1.0.0", - "node-abort-controller": "^3.1.1", - "sprintf-js": "^1.1.2" + "sprintf-js": "^1.1.3" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/tedious/node_modules/bl": { @@ -5432,79 +4661,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/typescript": { "version": "5.4.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", @@ -5518,21 +4674,6 @@ "node": ">=14.17" } }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -5564,41 +4705,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", diff --git a/package.json b/package.json index b68565acf..1a10e79b6 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:node:run": "mocha --timeout 15000 test/node/dist/**/*.test.js", "test:browser:build": "rm -rf test/browser/bundle.js && esbuild test/browser/main.ts --bundle --outfile=test/browser/bundle.js", "test:browser": "npm run build && npm run test:browser:build && node test/browser/test.js", - "test:bun": "npm run build && cd test/bun && bun install && bun run test", + "test:bun": "npm run build && bun link && cd test/bun && bun install && bun run test", "test:cloudflare-workers": "npm run build && cd test/cloudflare-workers && npm ci && npm test", "test:deno": "npm run build && deno run --allow-env --allow-read --allow-net test/deno/local.test.ts && deno run --allow-env --allow-read --allow-net test/deno/cdn.test.ts", "test:typings": "tsd test/typings", @@ -94,7 +94,7 @@ "prettier": "^3.1.1", "sinon": "^17.0.1", "tarn": "^3.0.2", - "tedious": "^16.4.0", + "tedious": "^18.2.0", "tsd": "^0.30.3", "tsx": "^4.10.5", "typescript": "^5.4.2" diff --git a/site/docs/getting-started/shared.tsx b/site/docs/getting-started/shared.tsx index ba24dcddd..3f458363d 100644 --- a/site/docs/getting-started/shared.tsx +++ b/site/docs/getting-started/shared.tsx @@ -12,7 +12,7 @@ export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'deno' | 'bun' const PACKAGE_MANAGER_UNSUPPORTED_DIALECTS: Record = { - bun: ['sqlite', 'mssql'], + bun: ['sqlite'], deno: ['sqlite', 'mssql'], npm: [], pnpm: [], diff --git a/site/docs/migrations.mdx b/site/docs/migrations.mdx index 263b96add..f6abc8232 100644 --- a/site/docs/migrations.mdx +++ b/site/docs/migrations.mdx @@ -4,6 +4,8 @@ sidebar_position: 4 # Migrations +## Migration files + Migration files should look like this: ```ts @@ -18,11 +20,11 @@ export async function down(db: Kysely): Promise { } ``` -The up function is called when you update your database schema to the next version and down when you go back to previous version. The only argument for the functions is an instance of `Kysely`. It's important to use ` Kysely` and not `Kysely`. +The `up` function is called when you update your database schema to the next version and `down` when you go back to previous version. The only argument for the functions is an instance of `Kysely`. It's important to use `Kysely` and not `Kysely`. Migrations should never depend on the current code of your app because they need to work even when the app changes. Migrations need to be "frozen in time". -Migrations can use the `Kysely.schema` module to modify the schema. Migrations can also run normal queries to modify data. +Migrations can use the `Kysely.schema` module to modify the schema. Migrations can also run normal queries to read/modify data. ## Execution order @@ -126,9 +128,16 @@ export async function down(db: Kysely): Promise { } ``` +## CLI (optional) + +Kysely offers a CLI you can use for migrations (and more). It can help you create and run migrations. +It is not part of the core, and your mileage may vary. + +For more information, visit https://github.com/kysely-org/kysely-ctl. + ## Running migrations -You can then use +You can then use: ```ts const migrator = new Migrator(migratorConfig) @@ -137,7 +146,7 @@ await migrator.migrateToLatest(pathToMigrationsFolder) to run all migrations that have not yet been run. See the Migrator class's documentation for more info. -Kysely doesn't have a CLI for running migrations and probably never will. This is because Kysely's migrations are also written in TypeScript. To run the migrations, you need to first build the TypeScript code into JavaScript. A CLI would cause confusion over which migrations are being run, the TypeScript ones or the JavaScript ones. If we added support for both, the CLI would need to depend on a TypeScript compiler, which most production environments don't (and shouldn't) have. You will probably want to add a simple migration script to your projects like this: +You will probably want to add a simple migration script to your projects like this: ```ts import * as path from 'path' diff --git a/site/src/components/SectionFeatures/index.tsx b/site/src/components/SectionFeatures/index.tsx index c2c95f2ba..af7f97cfd 100644 --- a/site/src/components/SectionFeatures/index.tsx +++ b/site/src/components/SectionFeatures/index.tsx @@ -46,7 +46,7 @@ const FeatureList: FeatureItem[] = [ description: ( <> PostgreSQL, MySQL, or SQLite? We've got you covered. There's also a - growing ecosystem of third-party dialects, including PlanetScale, D3, + growing ecosystem of third-party dialects, including PlanetScale, D1, SurrealDB, and more. Learn more. ), diff --git a/src/dialect/mssql/mssql-dialect-config.ts b/src/dialect/mssql/mssql-dialect-config.ts index f82abe9f5..6adc2f09d 100644 --- a/src/dialect/mssql/mssql-dialect-config.ts +++ b/src/dialect/mssql/mssql-dialect-config.ts @@ -52,98 +52,85 @@ export interface MssqlDialectConfig { export interface Tedious { connectionFactory: () => TediousConnection | Promise ISOLATION_LEVEL: TediousIsolationLevel - Request: typeof TediousRequest + Request: TediousRequestClass TYPES: TediousTypes } -export type TediousIsolationLevel = Record< - | 'NO_CHANGE' - | 'READ_UNCOMMITTED' - | 'READ_COMMITTED' - | 'REPEATABLE_READ' - | 'SERIALIZABLE' - | 'SNAPSHOT', - number -> - -export type TediousTypes = Record< - | 'BigInt' - | 'Binary' - | 'Bit' - | 'Char' - | 'Date' - | 'DateTime' - | 'DateTime2' - | 'DateTimeOffset' - | 'Decimal' - | 'Float' - | 'Image' - | 'Int' - | 'Money' - | 'NChar' - | 'NText' - | 'Null' - | 'Numeric' - | 'NVarChar' - | 'Real' - | 'SmallDateTime' - | 'SmallInt' - | 'SmallMoney' - | 'Text' - | 'Time' - | 'TinyInt' - | 'TVP' - | 'UDT' - | 'UniqueIdentifier' - | 'VarBinary' - | 'VarChar' - // TODO: uncomment once it is introduced in @types/tedious. See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66369 - // | 'Variant' - | 'Xml', - { name: string; type: string } -> - -export interface TediousType { - name: string - type: string -} - export interface TediousConnection { beginTransaction( - callback: (error?: Error) => void, - transactionId?: string | undefined, - isolationLevel?: number | undefined, + callback: (error?: Error | null, transactionDescriptor?: any) => void, + name?: string, + isolationLevel?: number, ): void - cancel(): void + cancel(): boolean close(): void - commitTransaction(callback: (error?: Error) => void): void - connect(callback: (error?: Error) => void): void + commitTransaction( + callback: (error?: Error | null) => void, + name?: string, + ): void + connect(callback?: (error?: Error) => void): void execSql(request: TediousRequest): void - reset(callback: (error?: Error) => void): void - rollbackTransaction(callback: (error?: Error) => void): void - once(event: 'end', listener: () => void): void + off(event: 'error', listener: (error: unknown) => void): this + off(event: string, listener: (...args: any[]) => void): this + on(event: 'error', listener: (error: unknown) => void): this + on(event: string, listener: (...args: any[]) => void): this + once(event: 'end', listener: () => void): this + once(event: string, listener: (...args: any[]) => void): this + reset(callback: (error?: Error | null) => void): void + rollbackTransaction( + callback: (error?: Error | null) => void, + name?: string, + ): void + saveTransaction(callback: (error?: Error | null) => void, name: string): void +} + +export type TediousIsolationLevel = Record + +export interface TediousRequestClass { + new ( + sqlTextOrProcedure: string | undefined, + callback: (error?: Error | null, rowCount?: number, rows?: any) => void, + options?: { + statementColumnEncryptionSetting?: any + }, + ): TediousRequest } export declare class TediousRequest { - constructor( - sql: string, - callback: (error: Error, rowCount: number, rows: any[]) => void, - ) addParameter( name: string, - type: TediousType, - value: any, - options?: { - length?: number | 'max' | undefined - precision?: number | undefined - scale?: number | undefined - }, + dataType: TediousDataType, + value?: unknown, + options?: Readonly<{ + output?: boolean + length?: number + precision?: number + scale?: number + }> | null, ): void - off(event: 'row', listener: (...args: any[]) => void): void - on(event: 'row', listener: (columns: TediousColumnValue[]) => void): void - once(event: 'requestCompleted', listener: (...args: any[]) => void): void + off(event: 'row', listener: (columns: any) => void): this + off(event: string, listener: (...args: any[]) => void): this + on(event: 'row', listener: (columns: any) => void): this + on(event: string, listener: (...args: any[]) => void): this + once(event: 'requestCompleted', listener: () => void): this + once(event: string, listener: (...args: any[]) => void): this + pause(): void + resume(): void +} + +export interface TediousTypes { + NVarChar: TediousDataType + BigInt: TediousDataType + Int: TediousDataType + Float: TediousDataType + Bit: TediousDataType + DateTime: TediousDataType + VarBinary: TediousDataType + [x: string]: TediousDataType } +export interface TediousDataType {} + export interface TediousColumnValue { metadata: { colName: string diff --git a/src/dialect/mssql/mssql-driver.ts b/src/dialect/mssql/mssql-driver.ts index 5d9b9cb12..71807b37c 100644 --- a/src/dialect/mssql/mssql-driver.ts +++ b/src/dialect/mssql/mssql-driver.ts @@ -46,14 +46,10 @@ export class MssqlDriver implements Driver { create: async () => { const connection = await this.#config.tedious.connectionFactory() - await new Promise((resolve, reject) => - connection.connect((error) => { - if (error) reject(error) - else resolve(undefined) - }), - ) - - return new MssqlConnection(connection, this.#config.tedious) + return await new MssqlConnection( + connection, + this.#config.tedious, + ).connect() }, destroy: async (connection) => { await connection[PRIVATE_DESTROY_METHOD]() @@ -104,6 +100,11 @@ class MssqlConnection implements DatabaseConnection { constructor(connection: TediousConnection, tedious: Tedious) { this.#connection = connection this.#tedious = tedious + + this.#connection.on('error', console.error) + this.#connection.once('end', () => { + this.#connection.off('error', console.error) + }) } async beginTransaction(settings: TransactionSettings): Promise { @@ -132,15 +133,30 @@ class MssqlConnection implements DatabaseConnection { ) } + async connect(): Promise { + await new Promise((resolve, reject) => { + this.#connection.connect((error) => { + if (error) { + console.error(error) + reject(error) + } else { + resolve(undefined) + } + }) + }) + + return this + } + async executeQuery(compiledQuery: CompiledQuery): Promise> { try { const deferred = new Deferred>() - const request = new MssqlRequest( - this.#tedious, + const request = new MssqlRequest({ compiledQuery, - deferred, - ) + tedious: this.#tedious, + onDone: deferred, + }) this.#connection.execSql(request.request) @@ -172,13 +188,17 @@ class MssqlConnection implements DatabaseConnection { throw new Error('chunkSize must be a positive integer') } - const request = new MssqlRequest(this.#tedious, compiledQuery) + const request = new MssqlRequest({ + compiledQuery, + streamChunkSize: chunkSize, + tedious: this.#tedious, + }) this.#connection.execSql(request.request) try { while (true) { - const rows = await request.readChunk(chunkSize) + const rows = await request.readChunk() if (rows.length === 0) { break @@ -191,7 +211,7 @@ class MssqlConnection implements DatabaseConnection { } } } finally { - this.#connection.cancel() + await this.#cancelRequest(request) } } @@ -199,11 +219,11 @@ class MssqlConnection implements DatabaseConnection { try { const deferred = new Deferred>() - const request = new MssqlRequest( - this.#tedious, - CompiledQuery.raw('select 1'), - deferred, - ) + const request = new MssqlRequest({ + compiledQuery: CompiledQuery.raw('select 1'), + onDone: deferred, + tedious: this.#tedious, + }) this.#connection.execSql(request.request) @@ -238,6 +258,19 @@ class MssqlConnection implements DatabaseConnection { return tediousIsolationLevel } + #cancelRequest(request: MssqlRequest): Promise { + return new Promise((resolve) => { + request.request.once('requestCompleted', resolve) + + const wasCanceled = this.#connection.cancel() + + if (!wasCanceled) { + request.request.off('requestCompleted', resolve) + resolve(undefined) + } + }) + } + [PRIVATE_RELEASE_METHOD](): Promise { return new Promise((resolve, reject) => { this.#connection.reset((error) => { @@ -271,50 +304,83 @@ interface PlainDeferred { class MssqlRequest { readonly #request: TediousRequest readonly #rows: O[] + readonly #streamChunkSize: number | undefined + readonly #subscribers: Record< + string, + (event: 'completed' | 'chunkReady' | 'error', error?: unknown) => void + > readonly #tedious: Tedious - #completed: boolean #error: Error | any[] | undefined #rowCount: number | undefined - constructor( - tedious: Tedious, - compiledQuery: CompiledQuery, - onDone?: Deferred> | PlainDeferred>, - ) { - this.#completed = false + constructor(props: MssqlRequestProps) { + const { compiledQuery, onDone, streamChunkSize, tedious } = props + this.#rows = [] + this.#streamChunkSize = streamChunkSize + this.#subscribers = {} this.#tedious = tedious - const { parameters, sql } = compiledQuery + if (onDone) { + const subscriptionKey = 'onDone' - this.#request = new this.#tedious.Request(sql, (err, rowCount) => { - if (err) { - this.#error = err instanceof AggregateError ? err.errors : err - onDone?.reject(this.#error) - } else { - this.#rowCount = rowCount + this.#subscribers[subscriptionKey] = (event, error) => { + if (event === 'chunkReady') { + return + } + + delete this.#subscribers[subscriptionKey] + + if (event === 'error') { + onDone.reject(error) + } else { + onDone.resolve({ + rowCount: this.#rowCount, + rows: this.#rows, + }) + } } - }) + } - this.#addParametersToRequest(parameters) - this.#attachListeners(onDone) + this.#request = new this.#tedious.Request( + compiledQuery.sql, + (err, rowCount) => { + if (err) { + Object.values(this.#subscribers).forEach((subscriber) => + subscriber( + 'error', + err instanceof AggregateError ? err.errors : err, + ), + ) + } else { + this.#rowCount = rowCount + } + }, + ) + + this.#addParametersToRequest(compiledQuery.parameters) + this.#attachListeners() } get request(): TediousRequest { return this.#request } - readChunk(chunkSize: number): Promise { + readChunk(): Promise { + const subscriptionKey = this.readChunk.name + return new Promise((resolve, reject) => { - const interval = setInterval(() => { - if (this.#error) { - clearInterval(interval) - reject(this.#error) - } else if (this.#completed || this.#rows.length >= chunkSize) { - clearInterval(interval) - resolve(this.#rows.splice(0, chunkSize)) + this.#subscribers[subscriptionKey] = (event, error) => { + delete this.#subscribers[subscriptionKey] + + if (event === 'error') { + reject(error) + } else { + resolve(this.#rows.splice(0, this.#streamChunkSize)) } - }, 0) + } + + this.#request.resume() }) } @@ -330,9 +396,19 @@ class MssqlRequest { } } - #attachListeners( - onDone: Deferred> | PlainDeferred> | undefined, - ): void { + #attachListeners(): void { + const pauseAndEmitChunkReady = this.#streamChunkSize + ? () => { + if (this.#streamChunkSize! <= this.#rows.length) { + this.#request.pause() + + Object.values(this.#subscribers).forEach((subscriber) => + subscriber('chunkReady'), + ) + } + } + : () => {} + const rowListener = (columns: TediousColumnValue[]) => { const row: Record = {} @@ -341,18 +417,17 @@ class MssqlRequest { } this.#rows.push(row as O) + + pauseAndEmitChunkReady() } this.#request.on('row', rowListener) this.#request.once('requestCompleted', () => { - this.#completed = true + Object.values(this.#subscribers).forEach((subscriber) => + subscriber('completed'), + ) this.#request.off('row', rowListener) - - onDone?.resolve({ - rowCount: this.#rowCount, - rows: this.#rows, - }) }) } @@ -388,3 +463,10 @@ class MssqlRequest { return this.#tedious.TYPES.NVarChar } } + +interface MssqlRequestProps { + compiledQuery: CompiledQuery + onDone?: Deferred> | PlainDeferred> + streamChunkSize?: number + tedious: Tedious +} diff --git a/src/dialect/postgres/postgres-introspector.ts b/src/dialect/postgres/postgres-introspector.ts index 6a359057f..956cf7ab2 100644 --- a/src/dialect/postgres/postgres-introspector.ts +++ b/src/dialect/postgres/postgres-introspector.ts @@ -73,7 +73,7 @@ export class PostgresIntrospector implements DatabaseIntrospector { ]) // r == normal table .where((eb) => - eb.or([eb('c.relkind', '=', 'r'), eb('c.relkind', '=', 'v')]), + eb.or([eb('c.relkind', '=', 'r'), eb('c.relkind', '=', 'v'), eb('c.relkind', '=', 'p')]), ) .where('ns.nspname', '!~', '^pg_') .where('ns.nspname', '!=', 'information_schema') diff --git a/src/operation-node/operator-node.ts b/src/operation-node/operator-node.ts index d7f81ecd2..8a6f68da5 100644 --- a/src/operation-node/operator-node.ts +++ b/src/operation-node/operator-node.ts @@ -21,6 +21,7 @@ export const COMPARISON_OPERATORS = [ 'not ilike', '@>', '<@', + '^@', '&&', '?', '?&', diff --git a/src/query-builder/update-query-builder.ts b/src/query-builder/update-query-builder.ts index f8422bfba..cbe670461 100644 --- a/src/query-builder/update-query-builder.ts +++ b/src/query-builder/update-query-builder.ts @@ -682,18 +682,28 @@ export class UpdateQueryBuilder }) } - returningAll(): UpdateQueryBuilder> { + returningAll( + tables: ReadonlyArray, + ): UpdateQueryBuilder> + + returningAll( + table: T, + ): UpdateQueryBuilder> + + returningAll(): UpdateQueryBuilder> + + returningAll(table?: any): any { return new UpdateQueryBuilder({ ...this.#props, queryNode: QueryNode.cloneWithReturning( this.#props.queryNode, - parseSelectAll(), + parseSelectAll(table), ), }) } output>( - selections: readonly OE[] + selections: readonly OE[], ): UpdateQueryBuilder< DB, UT, @@ -702,7 +712,7 @@ export class UpdateQueryBuilder > output>( - callback: CB + callback: CB, ): UpdateQueryBuilder< DB, UT, @@ -711,7 +721,7 @@ export class UpdateQueryBuilder > output>( - selection: OE + selection: OE, ): UpdateQueryBuilder< DB, UT, @@ -724,19 +734,19 @@ export class UpdateQueryBuilder ...this.#props, queryNode: QueryNode.cloneWithOutput( this.#props.queryNode, - parseSelectArg(args) + parseSelectArg(args), ), }) } outputAll( - table: OutputPrefix + table: OutputPrefix, ): UpdateQueryBuilder> { return new UpdateQueryBuilder({ ...this.#props, queryNode: QueryNode.cloneWithOutput( this.#props.queryNode, - parseSelectAll(table) + parseSelectAll(table), ), }) } @@ -836,8 +846,8 @@ export class UpdateQueryBuilder ): O2 extends UpdateResult ? UpdateQueryBuilder : O2 extends O & infer E - ? UpdateQueryBuilder> - : UpdateQueryBuilder> { + ? UpdateQueryBuilder> + : UpdateQueryBuilder> { if (condition) { return func(this) as any } @@ -1099,12 +1109,12 @@ export type UpdateQueryBuilderWithInnerJoin< ? InnerJoinedBuilder : never : TE extends keyof DB - ? UpdateQueryBuilder - : TE extends AliasedExpression - ? InnerJoinedBuilder - : TE extends (qb: any) => AliasedExpression - ? InnerJoinedBuilder - : never + ? UpdateQueryBuilder + : TE extends AliasedExpression + ? InnerJoinedBuilder + : TE extends (qb: any) => AliasedExpression + ? InnerJoinedBuilder + : never type InnerJoinedBuilder< DB, @@ -1133,12 +1143,12 @@ export type UpdateQueryBuilderWithLeftJoin< ? LeftJoinedBuilder : never : TE extends keyof DB - ? LeftJoinedBuilder - : TE extends AliasedExpression - ? LeftJoinedBuilder - : TE extends (qb: any) => AliasedExpression - ? LeftJoinedBuilder - : never + ? LeftJoinedBuilder + : TE extends AliasedExpression + ? LeftJoinedBuilder + : TE extends (qb: any) => AliasedExpression + ? LeftJoinedBuilder + : never type LeftJoinedBuilder< DB, @@ -1156,8 +1166,8 @@ type LeftJoinedDB = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable : C extends keyof DB - ? DB[C] - : never + ? DB[C] + : never }> export type UpdateQueryBuilderWithRightJoin< @@ -1171,12 +1181,12 @@ export type UpdateQueryBuilderWithRightJoin< ? RightJoinedBuilder : never : TE extends keyof DB - ? RightJoinedBuilder - : TE extends AliasedExpression - ? RightJoinedBuilder - : TE extends (qb: any) => AliasedExpression - ? RightJoinedBuilder - : never + ? RightJoinedBuilder + : TE extends AliasedExpression + ? RightJoinedBuilder + : TE extends (qb: any) => AliasedExpression + ? RightJoinedBuilder + : never type RightJoinedBuilder< DB, @@ -1196,10 +1206,10 @@ type RightJoinedDB< [C in keyof DB | A]: C extends A ? R : C extends TB - ? Nullable - : C extends keyof DB - ? DB[C] - : never + ? Nullable + : C extends keyof DB + ? DB[C] + : never }> export type UpdateQueryBuilderWithFullJoin< @@ -1213,12 +1223,12 @@ export type UpdateQueryBuilderWithFullJoin< ? OuterJoinedBuilder : never : TE extends keyof DB - ? OuterJoinedBuilder - : TE extends AliasedExpression - ? OuterJoinedBuilder - : TE extends (qb: any) => AliasedExpression - ? OuterJoinedBuilder - : never + ? OuterJoinedBuilder + : TE extends AliasedExpression + ? OuterJoinedBuilder + : TE extends (qb: any) => AliasedExpression + ? OuterJoinedBuilder + : never type OuterJoinedBuilder< DB, @@ -1238,8 +1248,8 @@ type OuterJoinedBuilderDB< [C in keyof DB | A]: C extends A ? Nullable : C extends TB - ? Nullable - : C extends keyof DB - ? DB[C] - : never + ? Nullable + : C extends keyof DB + ? DB[C] + : never }> diff --git a/src/query-compiler/default-query-compiler.ts b/src/query-compiler/default-query-compiler.ts index 321f41bb0..f9697079f 100644 --- a/src/query-compiler/default-query-compiler.ts +++ b/src/query-compiler/default-query-compiler.ts @@ -126,6 +126,7 @@ export class DefaultQueryCompiler compileQuery(node: RootOperationNode): CompiledQuery { this.#sql = '' this.#parameters = [] + this.nodeStack.splice(0, this.nodeStack.length) this.visitNode(node) diff --git a/src/query-creator.ts b/src/query-creator.ts index dfdca0cb1..d3c2caf6a 100644 --- a/src/query-creator.ts +++ b/src/query-creator.ts @@ -171,7 +171,7 @@ export class QueryCreator { from: TE[], ): SelectQueryBuilder, {}> - selectFrom>( + selectFrom>( from: TE[], ): SelectQueryBuilder, FromTables, {}> @@ -187,7 +187,7 @@ export class QueryCreator { {} > - selectFrom>( + selectFrom>( from: TE, ): SelectQueryBuilder, FromTables, {}> diff --git a/src/schema/alter-column-builder.ts b/src/schema/alter-column-builder.ts index caa41b04d..61cf708cd 100644 --- a/src/schema/alter-column-builder.ts +++ b/src/schema/alter-column-builder.ts @@ -8,6 +8,7 @@ import { DefaultValueExpression, parseDefaultValueExpression, } from '../parser/default-value-parser.js' +import { preventAwait } from '../util/prevent-await.js' export class AlterColumnBuilder { readonly #column: string @@ -63,6 +64,8 @@ export class AlterColumnBuilder { } } +preventAwait(AlterColumnBuilder, "don't await AlterColumnBuilder instances") + /** * Allows us to force consumers to do exactly one alteration to a column. * @@ -93,3 +96,5 @@ export class AlteredColumnBuilder implements OperationNodeSource { export type AlterColumnBuilderCallback = ( builder: AlterColumnBuilder, ) => AlteredColumnBuilder + +preventAwait(AlteredColumnBuilder, "don't await AlteredColumnBuilder instances") diff --git a/src/schema/alter-table-builder.ts b/src/schema/alter-table-builder.ts index c55901b8d..b7bee0308 100644 --- a/src/schema/alter-table-builder.ts +++ b/src/schema/alter-table-builder.ts @@ -323,6 +323,8 @@ export interface AlterTableBuilderProps { readonly node: AlterTableNode } +preventAwait(AlterTableBuilder, "don't await AlterTableBuilder instances") + export interface ColumnAlteringInterface { alterColumn( column: string, @@ -469,9 +471,6 @@ export class AlterTableColumnAlteringBuilder export interface AlterTableColumnAlteringBuilderProps extends AlterTableBuilderProps {} -preventAwait(AlterTableBuilder, "don't await AlterTableBuilder instances") -preventAwait(AlterColumnBuilder, "don't await AlterColumnBuilder instances") - preventAwait( AlterTableColumnAlteringBuilder, "don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`", diff --git a/src/util/object-utils.ts b/src/util/object-utils.ts index 845f9ee87..4f7842cac 100644 --- a/src/util/object-utils.ts +++ b/src/util/object-utils.ts @@ -59,13 +59,20 @@ export function isArrayBufferOrView( } export function isPlainObject(obj: unknown): obj is Record { - return ( - isObject(obj) && - !Array.isArray(obj) && - !isDate(obj) && - !isBuffer(obj) && - !isArrayBufferOrView(obj) - ) + if (!isObject(obj) || getTag(obj) !== '[object Object]') { + return false + } + + if (Object.getPrototypeOf(obj) === null) { + return true + } + + let proto = obj + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto) + } + + return Object.getPrototypeOf(obj) === proto } export function getLast(arr: ArrayLike): T | undefined { @@ -169,3 +176,13 @@ function compareGenericObjects( return true } + +const toString = Object.prototype.toString + +function getTag(value: unknown): string { + if (value == null) { + return value === undefined ? '[object Undefined]' : '[object Null]' + } + + return toString.call(value) +} diff --git a/test/bun/bun.lockb b/test/bun/bun.lockb old mode 100644 new mode 100755 index e716655b7..19a9da9e2 Binary files a/test/bun/bun.lockb and b/test/bun/bun.lockb differ diff --git a/test/bun/bun.test.ts b/test/bun/bun.test.ts index 9becba23d..fc671a688 100644 --- a/test/bun/bun.test.ts +++ b/test/bun/bun.test.ts @@ -1,11 +1,14 @@ import { createPool } from 'mysql2' import { Pool } from 'pg' +import * as Tarn from 'tarn' +import * as Tedious from 'tedious' import { Generated, Kysely, PostgresDialect, MysqlDialect, sql, + MssqlDialect, } from '../../dist/esm/index.js' interface Person { @@ -40,6 +43,38 @@ const dbs = [ }), }), }), + new Kysely({ + dialect: new MssqlDialect({ + tarn: { + ...Tarn, + options: { + min: 0, + max: 10, + }, + }, + tedious: { + ...Tedious, + connectionFactory: () => + new Tedious.Connection({ + authentication: { + options: { + password: 'KyselyTest0', + userName: 'sa', + }, + type: 'default', + }, + options: { + connectTimeout: 3000, + database: 'kysely_test', + encrypt: false, + port: 21433, + trustServerCertificate: true, + }, + server: 'localhost', + }), + }, + }), + }), ] if ( @@ -60,3 +95,5 @@ await Promise.all(dbs.map((db) => query.execute(db))) console.log('bun test passed') await Promise.all(dbs.map((db) => db.destroy())) + +process.exit(0) // hangs otherwise... diff --git a/test/bun/package.json b/test/bun/package.json index 08285b44f..05823019f 100644 --- a/test/bun/package.json +++ b/test/bun/package.json @@ -5,8 +5,14 @@ "test": "bun bun.test.ts" }, "dependencies": { - "kysely": "^0.25.0", + "kysely": "link:kysely", "mysql2": "^3.3.3", - "pg": "^8.11.0" + "pg": "^8.11.0", + "tarn": "^3.0.2", + "tedious": "^17.0.0" + }, + "devDependencies": { + "@types/bun": "^1.1.3", + "typescript": "^5.4.5" } } diff --git a/test/node/src/camel-case.test.ts b/test/node/src/camel-case.test.ts index 5ba4aeceb..923ce43fa 100644 --- a/test/node/src/camel-case.test.ts +++ b/test/node/src/camel-case.test.ts @@ -1,4 +1,11 @@ -import { CamelCasePlugin, Generated, Kysely, RawBuilder, sql } from '../../../' +import { + CamelCasePlugin, + Generated, + Kysely, + ParseJSONResultsPlugin, + RawBuilder, + sql, +} from '../../../' import { destroyTest, @@ -78,7 +85,7 @@ for (const dialect of DIALECTS) { // Can't run this test on SQLite because we can't access the same database // from the other Kysely instance. - if (dialect === 'postgres' || dialect === 'mysql' || dialect === 'mssql') { + if (dialect !== 'sqlite') { it('should have created the table and its columns in snake_case', async () => { const result = await sql`select * from camel_person`.execute( ctx.db, @@ -262,18 +269,41 @@ for (const dialect of DIALECTS) { }) }) - it('should respect maintainNestedObjectKeys', async () => { - const data = await camelDb - .withoutPlugins() - .withPlugin(new CamelCasePlugin({ maintainNestedObjectKeys: true })) + it('should map nested objects by default', async () => { + let db = camelDb.withoutPlugins() + + if (dialect === 'mssql' || dialect === 'sqlite') { + db = db.withPlugin(new ParseJSONResultsPlugin()) + } + + db = db.withPlugin(new CamelCasePlugin()) + + const data = await db .selectFrom('camelPerson') .selectAll() .executeTakeFirstOrThrow() + expect(data.preferences).to.eql({ + disableEmails: true, + }) + }) + + it('should respect maintainNestedObjectKeys', async () => { + let db = camelDb.withoutPlugins() + if (dialect === 'mssql' || dialect === 'sqlite') { - data.preferences = JSON.parse(data.preferences.toString()) + db = db.withPlugin(new ParseJSONResultsPlugin()) } + db = db.withPlugin( + new CamelCasePlugin({ maintainNestedObjectKeys: true }), + ) + + const data = await db + .selectFrom('camelPerson') + .selectAll() + .executeTakeFirstOrThrow() + expect(data.preferences).to.eql({ disable_emails: true, }) diff --git a/test/node/src/delete.test.ts b/test/node/src/delete.test.ts index efa0c61d4..b7024f73f 100644 --- a/test/node/src/delete.test.ts +++ b/test/node/src/delete.test.ts @@ -299,6 +299,35 @@ for (const dialect of DIALECTS) { await query.execute() }) + it('should delete from t1 using t2, t3 returning t2.*', async () => { + const query = ctx.db + .deleteFrom('toy') + .using(['pet', 'person']) + .whereRef('toy.pet_id', '=', 'pet.id') + .whereRef('pet.owner_id', '=', 'person.id') + .where('person.first_name', '=', 'Bob') + .returningAll('pet') + + testSql(query, dialect, { + postgres: { + sql: [ + 'delete from "toy"', + 'using "pet", "person"', + 'where "toy"."pet_id" = "pet"."id"', + 'and "pet"."owner_id" = "person"."id"', + 'and "person"."first_name" = $1', + 'returning "pet".*', + ], + parameters: ['Bob'], + }, + mysql: NOT_SUPPORTED, + mssql: NOT_SUPPORTED, + sqlite: NOT_SUPPORTED, + }) + + await query.execute() + }) + it('should delete from t1 returning *', async () => { const query = ctx.db .deleteFrom('pet') diff --git a/test/node/src/disconnects.test.ts b/test/node/src/disconnects.test.ts new file mode 100644 index 000000000..56ae1ff36 --- /dev/null +++ b/test/node/src/disconnects.test.ts @@ -0,0 +1,52 @@ +import { Kysely, MssqlDialect, sql } from '../../..' +import { DIALECTS, DIALECT_CONFIGS, Database, expect } from './test-setup' +import * as tarn from 'tarn' +import * as tedious from 'tedious' + +const dialect = 'mssql' + +if (DIALECTS.includes(dialect)) { + describe(`${dialect}: disconnects`, () => { + let connection: tedious.Connection + let connectionFactoryTimesCalled = 0 + let db: Kysely + + before(async () => { + db = new Kysely({ + dialect: new MssqlDialect({ + tarn: { + ...tarn, + options: { + min: 0, + max: 1, + }, + }, + tedious: { + ...tedious, + connectionFactory: () => { + connectionFactoryTimesCalled++ + + return (connection = new tedious.Connection( + DIALECT_CONFIGS[dialect], + )) + }, + }, + }), + }) + }) + + after(async () => { + await db.destroy() + }) + + it('should be disconnection tolerant', async () => { + await sql`select 1`.execute(db) + expect(connectionFactoryTimesCalled).to.equal(1) + + connection.socketError(new Error('moshe')) + + await sql`select 1`.execute(db) + expect(connectionFactoryTimesCalled).to.equal(2) + }) + }) +} diff --git a/test/node/src/introspect.test.ts b/test/node/src/introspect.test.ts index 86e1a6cac..1aaa58350 100644 --- a/test/node/src/introspect.test.ts +++ b/test/node/src/introspect.test.ts @@ -280,6 +280,22 @@ for (const dialect of DIALECTS) { }, ], }, + { + name: 'pet_partition', + isView: false, + schema: 'some_schema', + columns: [ + { + name: 'part_column', + dataType: 'text', + dataTypeSchema: 'pg_catalog', + isNullable: true, + isAutoIncrementing: false, + hasDefaultValue: false, + comment: undefined, + }, + ] + } ]) } else if (dialect === 'mysql') { expect(meta).to.eql([ @@ -827,6 +843,11 @@ for (const dialect of DIALECTS) { .addColumn('some_column', 'serial', (col) => col.primaryKey()) .addColumn('spcies', sql`dtype_schema.species`) .execute() + await ctx.db.schema + .createTable('some_schema.pet_partition') + .addColumn('part_column', 'text') + .modifyEnd(sql`PARTITION by LIST ("part_column")`) + .execute() } else { await ctx.db.schema .createTable('some_schema.pet') @@ -842,6 +863,7 @@ for (const dialect of DIALECTS) { async function dropSchema() { await ctx.db.schema.dropTable('some_schema.pet').ifExists().execute() + await ctx.db.schema.dropTable('some_schema.pet_partition').ifExists().execute() await ctx.db.schema.dropSchema('some_schema').ifExists().execute() if (dialect === 'postgres') { diff --git a/test/node/src/object-util.test.ts b/test/node/src/object-util.test.ts new file mode 100644 index 000000000..fd70c1bdc --- /dev/null +++ b/test/node/src/object-util.test.ts @@ -0,0 +1,30 @@ +import { isPlainObject } from '../../../dist/cjs/util/object-utils' + +import { expect } from './test-setup.js' + +describe('object util', () => { + it('isPlainObject', async () => { + class SomeClass {} + + for (const obj of [{ foo: 'bar' }, Object.create(null)]) { + expect(isPlainObject(obj)).to.equal(true) + } + + for (const obj of [ + [], + new Date(), + Buffer.allocUnsafe(10), + new ArrayBuffer(10), + new Int32Array(10), + new Float64Array(10), + '', + 42, + false, + null, + undefined, + new SomeClass(), + ]) { + expect(isPlainObject(obj)).to.equal(false) + } + }) +}) diff --git a/test/node/src/stream.test.ts b/test/node/src/stream.test.ts new file mode 100644 index 000000000..427ee1152 --- /dev/null +++ b/test/node/src/stream.test.ts @@ -0,0 +1,71 @@ +import { + DIALECTS, + Database, + TestContext, + createTableWithId, + destroyTest, + expect, + initTest, +} from './test-setup' +import { GeneratedAlways, Kysely, sql } from '../../..' +import { Request } from 'tedious' +import { SinonSandbox, SinonSpy, createSandbox } from 'sinon' + +const CHUNK_SIZE = 10 +const DIALECT = 'mssql' +const ITEM_COUNT = 100 +const TABLE = 'stream_test' + +if (DIALECTS.includes(DIALECT)) { + describe(`mssql: stream`, () => { + let sandbox: SinonSandbox + let pauseSpy: SinonSpy + let resumeSpy: SinonSpy + let ctx: Omit & { + db: Kysely } }> + } + + before(async function () { + sandbox = createSandbox() + pauseSpy = sandbox.spy(Request.prototype, 'pause') + resumeSpy = sandbox.spy(Request.prototype, 'resume') + + ctx = (await initTest(this, DIALECT)) as any + try { + await ctx.db.schema.dropTable(TABLE).execute() + } catch (err) {} + await createTableWithId(ctx.db.schema, DIALECT, TABLE).execute() + await sql` + set identity_insert ${sql.table(TABLE)} on; + with cteNums(n) AS ( + SELECT 1 + UNION ALL + SELECT n + 1 + FROM cteNums WHERE n < ${sql.lit(ITEM_COUNT)} -- how many times to iterate + ) + INSERT ${sql.table(TABLE)} (id) + SELECT * FROM cteNums + OPTION (MAXRECURSION ${sql.lit(ITEM_COUNT)}); + set identity_insert ${sql.table(TABLE)} off + `.execute(ctx.db) + }) + + after(async () => { + await ctx.db.schema.dropTable(TABLE).execute() + await destroyTest(ctx as any) + sandbox.restore() + }) + + it('should pause/resume the request according to chunk size', async () => { + for await (const _ of ctx.db + .selectFrom(TABLE) + .selectAll() + .stream(CHUNK_SIZE)); + + const chunks = Math.ceil(ITEM_COUNT / CHUNK_SIZE) + + expect(pauseSpy.callCount).to.equal(chunks) + expect(resumeSpy.callCount).to.equal(chunks + 1) + }) + }) +} diff --git a/test/node/src/test-setup.ts b/test/node/src/test-setup.ts index fb2e7cf68..2fba278fc 100644 --- a/test/node/src/test-setup.ts +++ b/test/node/src/test-setup.ts @@ -41,6 +41,7 @@ import { OrderByDirection, UndirectedOrderByExpression, } from '../../../dist/cjs/parser/order-by-parser' +import type { ConnectionConfiguration } from 'tedious' export type Gender = 'male' | 'female' | 'other' export type MaritalStatus = 'single' | 'married' | 'divorced' | 'widowed' @@ -158,7 +159,7 @@ export const DIALECT_CONFIGS = { trustServerCertificate: true, }, server: 'localhost', - } satisfies Tedious.ConnectionConfig, + } satisfies ConnectionConfiguration, sqlite: { databasePath: ':memory:', diff --git a/test/node/src/update.test.ts b/test/node/src/update.test.ts index 7a5b69c18..5e4639cd2 100644 --- a/test/node/src/update.test.ts +++ b/test/node/src/update.test.ts @@ -478,6 +478,34 @@ for (const dialect of DIALECTS) { }) } + if (dialect === 'postgres') { + it('should update some rows and return joined rows when `returningAll` is used', async () => { + const query = ctx.db + .updateTable('person') + .from('pet') + .set({ + first_name: (eb) => eb.ref('pet.name'), + }) + .whereRef('pet.owner_id', '=', 'person.id') + .where('person.first_name', '=', 'Arnold') + .returningAll('pet') + + testSql(query, dialect, { + postgres: { + sql: 'update "person" set "first_name" = "pet"."name" from "pet" where "pet"."owner_id" = "person"."id" and "person"."first_name" = $1 returning "pet".*', + parameters: ['Arnold'], + }, + mysql: NOT_SUPPORTED, + mssql: NOT_SUPPORTED, + sqlite: NOT_SUPPORTED, + }) + + const result = await query.execute() + expect(result[0].name).to.equal('Doggo') + expect(result[0].species).to.equal('dog') + }) + } + if (dialect === 'postgres') { it('should update multiple rows and stream returned results', async () => { const stream = ctx.db diff --git a/test/typings/test-d/delete-query-builder.test-d.ts b/test/typings/test-d/delete-query-builder.test-d.ts index f827d0a3b..fbf9a0590 100644 --- a/test/typings/test-d/delete-query-builder.test-d.ts +++ b/test/typings/test-d/delete-query-builder.test-d.ts @@ -52,6 +52,15 @@ async function testDelete(db: Kysely) { .executeTakeFirstOrThrow() expectType(r7) + const r8 = await db + .deleteFrom('pet') + .using('person') + .leftJoin('pet', 'pet.owner_id', 'person.id') + .where('person.id', '=', 1) + .returningAll('person') + .executeTakeFirstOrThrow() + expectType>(r8) + expectError(db.deleteFrom('NO_SUCH_TABLE')) expectError(db.deleteFrom('pet').where('NO_SUCH_COLUMN', '=', '1')) expectError(db.deleteFrom('pet').whereRef('owner_id', '=', 'NO_SUCH_COLUMN')) diff --git a/test/typings/test-d/infer-result.test-d.ts b/test/typings/test-d/infer-result.test-d.ts index e48cbac61..088a191b9 100644 --- a/test/typings/test-d/infer-result.test-d.ts +++ b/test/typings/test-d/infer-result.test-d.ts @@ -80,9 +80,23 @@ function testInferResultUpdateQuery(db: Kysely) { const query1 = query0.returningAll() const compiledQuery1 = query1.compile() - type Expected1 = Selectable[] - expectType>>(true) - expectType>>(true) + type Expected1 = { + id: string | number + first_name: string + last_name: string | null + age: number + gender: 'male' | 'female' | 'other' + marital_status: 'single' | 'married' | 'divorced' | 'widowed' | null + modified_at: Date + deleted_at: Date | null + name: string + owner_id: number + species: 'dog' | 'cat' + }[] + + const expected1: Expected1 = undefined! + expectType>(expected1) + expectType>(expected1) const query2 = query0.returning('modified_at') const compiledQuery2 = query2.compile() diff --git a/test/typings/test-d/select-from.test-d.ts b/test/typings/test-d/select-from.test-d.ts index 6750257ba..cd799e067 100644 --- a/test/typings/test-d/select-from.test-d.ts +++ b/test/typings/test-d/select-from.test-d.ts @@ -37,6 +37,16 @@ async function testFromSingle(db: Kysely) { .execute() expectType<{ strs: number }>(r4) + // Subquery factory list + const [r4_2] = await db + .selectFrom([ + (eb) => eb.selectFrom('movie').select('movie.stars as strs').as('m'), + (eb) => eb.selectFrom('pet').select('id').as('p'), + ]) + .selectAll(['m', 'p']) + .execute() + expectType<{ strs: number; id: string }>(r4_2) + // Table with schema const [r5] = await db .selectFrom('some_schema.movie') diff --git a/test/typings/test-d/update.test-d.ts b/test/typings/test-d/update.test-d.ts index e4b1ba883..3721de1eb 100644 --- a/test/typings/test-d/update.test-d.ts +++ b/test/typings/test-d/update.test-d.ts @@ -31,6 +31,22 @@ async function testUpdate(db: Kysely) { .executeTakeFirst() expectType(r4) + const r5 = await db + .updateTable('pet') + .from((eb) => + eb + .selectFrom('person') + .select(['person.id as person_id', 'first_name as fn']) + .where('person.first_name', '=', 'Jennifer') + .forUpdate() + .skipLocked() + .as('p'), + ) + .set('name', (eb) => eb.ref('p.fn')) + .returningAll('p') + .execute() + expectType<{ fn: string; person_id: number }[]>(r5) + // Non-existent column expectError( db