Skip to content

Commit

Permalink
_ and $ can be in identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Sep 6, 2024
1 parent efd6d2d commit 0415d9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ch/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ defmodule Ch.Types do
defguardp is_numeric(char) when char >= ?0 and char <= ?9

defp decode_identifier(<<a, rest::bytes>>, len, original, stack, acc)
when is_alpha(a) or is_numeric(a) do
when is_alpha(a) or is_numeric(a) or a == ?_ or a == ?$ do
decode_identifier(rest, len + 1, original, stack, acc)
end

Expand Down
2 changes: 2 additions & 0 deletions test/ch/query_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ defmodule Ch.QueryTest do
test "decode tuples", %{conn: conn} do

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.14, 25, latest, UTC)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.14, 26, latest, UTC)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.15, 25, latest, UTC)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.15, 26, latest, UTC)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.16, 25, latest, UTC)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.16, 26, latest, UTC)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.17, 27, latest, Europe/Berlin)

test query decode tuples (Ch.QueryTest)

Check failure on line 102 in test/ch/query_test.exs

View workflow job for this annotation

GitHub Actions / test (1.17, 27, latest, UTC)

test query decode tuples (Ch.QueryTest)
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello', 123)").rows
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a, 123 as b)").rows
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a_, 123 as b)").rows
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a$, 123 as b)").rows
end

test "decode network types", %{conn: conn} do
Expand Down

0 comments on commit 0415d9f

Please sign in to comment.