From b591a1eb51cedfe10b016bfa9559fb8429ebaa2b Mon Sep 17 00:00:00 2001 From: dr666m1 Date: Tue, 15 Aug 2023 00:02:52 +0900 Subject: [PATCH] update bq2cst. fix #224 --- expected_output/core.sql | 2 ++ input/core.sql | 5 +++++ package-lock.json | 14 +++++++------- package.json | 2 +- src/printer.ts | 3 +++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/expected_output/core.sql b/expected_output/core.sql index 67e436b..6ff01bd 100644 --- a/expected_output/core.sql +++ b/expected_output/core.sql @@ -34,6 +34,8 @@ SELECT 1 IN UNNEST([1, 2]); -- LIKE SELECT 'a' LIKE 'abc', 'a' NOT LIKE 'abc'; +SELECT 'a' LIKE ANY 'abc', 'a' NOT LIKE SOME 'abc'; + -- IS SELECT TRUE IS NULL, TRUE IS NOT NULL, TRUE IS NOT FALSE; diff --git a/input/core.sql b/input/core.sql index dbe8f68..7227b0c 100644 --- a/input/core.sql +++ b/input/core.sql @@ -41,6 +41,11 @@ select 'a' not like 'abc' ; +select + 'a' like any 'abc', + 'a' not like some 'abc' +; + -- IS select true is null, diff --git a/package-lock.json b/package-lock.json index 25f866b..6ed1499 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.2.42", "license": "MIT", "dependencies": { - "bq2cst": "0.4.28" + "bq2cst": "0.4.29" }, "devDependencies": { "@types/jest": "^26.0.23", @@ -1741,9 +1741,9 @@ "dev": true }, "node_modules/bq2cst": { - "version": "0.4.28", - "resolved": "https://registry.npmjs.org/bq2cst/-/bq2cst-0.4.28.tgz", - "integrity": "sha512-gX4XztmVm6JUoUt2eaEPxKo8mpyZIyfdEMNCqdvS/PVwd3vX7lWAwqzox/FS4jqZXaDZquVGFbSUTOAvjsYoVA==" + "version": "0.4.29", + "resolved": "https://registry.npmjs.org/bq2cst/-/bq2cst-0.4.29.tgz", + "integrity": "sha512-A/fd4+g+Vf/Q3Nrj1HsSawt5TfV0Q7YqF+C8Vf5mfzLUgpc5JcBj4OLzSTpp8k8Nd9pcUp3OcX4p41p4cOWSbA==" }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -8163,9 +8163,9 @@ "dev": true }, "bq2cst": { - "version": "0.4.28", - "resolved": "https://registry.npmjs.org/bq2cst/-/bq2cst-0.4.28.tgz", - "integrity": "sha512-gX4XztmVm6JUoUt2eaEPxKo8mpyZIyfdEMNCqdvS/PVwd3vX7lWAwqzox/FS4jqZXaDZquVGFbSUTOAvjsYoVA==" + "version": "0.4.29", + "resolved": "https://registry.npmjs.org/bq2cst/-/bq2cst-0.4.29.tgz", + "integrity": "sha512-A/fd4+g+Vf/Q3Nrj1HsSawt5TfV0Q7YqF+C8Vf5mfzLUgpc5JcBj4OLzSTpp8k8Nd9pcUp3OcX4p41p4cOWSbA==" }, "brace-expansion": { "version": "1.1.11", diff --git a/package.json b/package.json index c4cc0c0..84f4f8d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "typescript": "^4.3.2" }, "dependencies": { - "bq2cst": "0.4.28" + "bq2cst": "0.4.29" }, "peerDependencies": { "prettier": "^2.3.0" diff --git a/src/printer.ts b/src/printer.ts index 46a0811..7f48eee 100644 --- a/src/printer.ts +++ b/src/printer.ts @@ -1457,6 +1457,7 @@ const printBinaryOperator: PrintFunc = ( not: p.child("not", undefined, "all"), self: logical ? p.self("upper") : p.self("upper", true), trailing_comments: printTrailingComments(path, options, print, node), + quantifier: p.child("quantifier", undefined, "all"), right: p.child("right", undefined, "all"), as: "", // eslint-disable-line unicorn/no-unused-properties alias: printAlias(path, options, print, node), @@ -1499,6 +1500,8 @@ const printBinaryOperator: PrintFunc = ( printLeadingComments(path, options, print, node), docs.self, p.has("not") && p.includedIn(["IS"]) ? [" ", docs.not] : "", + p.has("quantifier") ? " " : "", + docs.quantifier, " ", docs.trailing_comments, right,