From addcee2bc5e4fb603e4b5a8da0069829f63ee3fc Mon Sep 17 00:00:00 2001 From: Ross Light Date: Tue, 11 Jun 2024 13:45:05 -0700 Subject: [PATCH] Add test for using a dollar sign in a parameter name Already supported, but in discussion about parameters, realized that we may want parameters to stand out from other elements. This test ensures that this use case is supported. (I was surprised to discover that Clickhouse also supports dollar signs in their identifiers.) --- testdata/Goldens/ParamsDollarSign/input.pql | 2 ++ testdata/Goldens/ParamsDollarSign/options.jwcc | 8 ++++++++ testdata/Goldens/ParamsDollarSign/output.csv | 2 ++ testdata/Goldens/ParamsDollarSign/output.sql | 1 + 4 files changed, 13 insertions(+) create mode 100644 testdata/Goldens/ParamsDollarSign/input.pql create mode 100644 testdata/Goldens/ParamsDollarSign/options.jwcc create mode 100644 testdata/Goldens/ParamsDollarSign/output.csv create mode 100644 testdata/Goldens/ParamsDollarSign/output.sql diff --git a/testdata/Goldens/ParamsDollarSign/input.pql b/testdata/Goldens/ParamsDollarSign/input.pql new file mode 100644 index 0000000..60822cf --- /dev/null +++ b/testdata/Goldens/ParamsDollarSign/input.pql @@ -0,0 +1,2 @@ +Tokens +| where Kind == $desiredKind diff --git a/testdata/Goldens/ParamsDollarSign/options.jwcc b/testdata/Goldens/ParamsDollarSign/options.jwcc new file mode 100644 index 0000000..a9b6f29 --- /dev/null +++ b/testdata/Goldens/ParamsDollarSign/options.jwcc @@ -0,0 +1,8 @@ +{ + "parameters": { + "$desiredKind": { + "clickhouse": "{$desiredKind: Int32}", + "value": "1", + }, + }, +} diff --git a/testdata/Goldens/ParamsDollarSign/output.csv b/testdata/Goldens/ParamsDollarSign/output.csv new file mode 100644 index 0000000..565e14f --- /dev/null +++ b/testdata/Goldens/ParamsDollarSign/output.csv @@ -0,0 +1,2 @@ +Kind,TokenConstant +1,TokenIdentifier diff --git a/testdata/Goldens/ParamsDollarSign/output.sql b/testdata/Goldens/ParamsDollarSign/output.sql new file mode 100644 index 0000000..6d1b705 --- /dev/null +++ b/testdata/Goldens/ParamsDollarSign/output.sql @@ -0,0 +1 @@ +SELECT * FROM "Tokens" WHERE coalesce("Kind" = {$desiredKind: Int32}, FALSE);