Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos and warnings #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Online Analytical Processing (OLAP) database management system.
```elixir
conn = Pillar.Connection.new("http://user:password@localhost:8123/database")

# Params are passed in brackets {} in SQL query, and map strtucture does fill
# Params are passed in brackets {} in SQL query, and map structure does fill
# query by values.
sql = "SELECT count(*) FROM users WHERE lastname = {lastname}"

Expand Down
3 changes: 2 additions & 1 deletion lib/pillar/http_client/httpc_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ defmodule Pillar.HttpClient.HttpcAdapter do
result =
:httpc.request(
:post,
{String.to_charlist(url), [{'te', 'application/json'}], 'application/json', post_body},
{String.to_charlist(url), [{~c"te", ~c"application/json"}], ~c"application/json",
post_body},
options,
[]
)
Expand Down
2 changes: 1 addition & 1 deletion lib/pillar/migrations/migrate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Pillar.Migrations.Migrate do
files_and_modules = Base.compile_migration_files(path)

Enum.map(files_and_modules, fn {filename, module} ->
result = migrate_if_was_not_migrated(connection, filename, module.up, options)
result = migrate_if_was_not_migrated(connection, filename, module.up(), options)
{filename, result}
end)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pillar/type_convert/to_elixir.ex
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ defmodule Pillar.TypeConvert.ToElixir do
datetime

{:error, :utc_only_time_zone_database} ->
Logger.warn(
Logger.warning(
"Add timezone database to your project if you want to use Timezones (tzdata or tz)."
)

Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
"tesla": {:hex, :tesla, "1.5.1", "f2ba04f5e6ace0f1954f1fb4375f55809a5f2ff491c18ccb09fbc98370d4280b", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.13", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:msgpax, "~> 2.3", [hex: :msgpax, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "2815d4f6550973d1ed65692d545d079174f6a1f8cb4775f6eb606cbc0666a9de"},
"tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
Expand Down
2 changes: 1 addition & 1 deletion test/pillar/bulk_insert_buffer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ defmodule Pillar.BulkInsertBufferTest do
%{"major" => major, "minor" => minor} = version(conn)

if (major >= 22 && minor >= 6) or major >= 23 do
# Clickhouse of this version doesn't return errors on insert becouse of internal queue
# Clickhouse of this version doesn't return errors on insert because of internal queue
# skip test scenario on this version and newer
:ok
else
Expand Down
12 changes: 6 additions & 6 deletions test/pillar/type_convert/to_clickhouse_json_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ defmodule Pillar.TypeConvert.ToClickhouseJsonTest do
test "String" do
assert ToClickhouseJson.convert("Hello") == "Hello"

assert ToClickhouseJson.convert("Hello, here is single qoute '") ==
"Hello, here is single qoute '"
assert ToClickhouseJson.convert("Hello, here is single quote '") ==
"Hello, here is single quote '"

assert ToClickhouseJson.convert("Hello, here are two single qoutes ''") ==
"Hello, here are two single qoutes ''"
assert ToClickhouseJson.convert("Hello, here are two single quotes ''") ==
"Hello, here are two single quotes ''"

assert ToClickhouseJson.convert("Hello, here are two double qoutes \"\"") ==
"Hello, here are two double qoutes \"\""
assert ToClickhouseJson.convert("Hello, here are two double quotes \"\"") ==
"Hello, here are two double quotes \"\""
end

test "Map" do
Expand Down
12 changes: 6 additions & 6 deletions test/pillar/type_convert/to_clickhouse_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ defmodule Pillar.TypeConvert.ToClickhouseTest do
test "String" do
assert ToClickhouse.convert("Hello") == "'Hello'"

assert ToClickhouse.convert("Hello, here is single qoute '") ==
"'Hello, here is single qoute '''"
assert ToClickhouse.convert("Hello, here is single quote '") ==
"'Hello, here is single quote '''"

assert ToClickhouse.convert("Hello, here are two single qoutes '' ") ==
"'Hello, here are two single qoutes '''' '"
assert ToClickhouse.convert("Hello, here are two single quotes '' ") ==
"'Hello, here are two single quotes '''' '"

assert ToClickhouse.convert("Hello, here are two double qoutes \"\" ") ==
"'Hello, here are two double qoutes \"\" '"
assert ToClickhouse.convert("Hello, here are two double quotes \"\" ") ==
"'Hello, here are two double quotes \"\" '"
end

test "Map" do
Expand Down
8 changes: 4 additions & 4 deletions test/pillar_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ defmodule PillarTest do
assert Pillar.select(conn, sql_array_values) ==
{:ok, [%{"test_map" => [bar: ["a", "b"], foo: ["1", "2", "3"]]}]}
else
Logger.warn("Parentheses tests skip, becouse CH major version is lower than 21")
Logger.warning("Parentheses tests skip, because CH major version is lower than 21")
end
end
end
Expand Down Expand Up @@ -548,7 +548,7 @@ defmodule PillarTest do
end

describe "#insert_to_table" do
test "bad request with unexistable fields", %{conn: conn} do
test "bad request with non-existent fields", %{conn: conn} do
%{"major" => major, "minor" => minor} = version(conn)

table_name = "to_table_inserts_with_fail_expected#{@timestamp}"
Expand Down Expand Up @@ -751,7 +751,7 @@ defmodule PillarTest do
%{"field4" => [{:baz, "bak"}, {:foo, "bar"}]}
]} = Pillar.select(conn, "select * from #{table_name}")
else
Logger.warn("insert keyword as map, because CH major version is lower than 21")
Logger.warning("insert keyword as map, because CH major version is lower than 21")
end
end

Expand All @@ -778,7 +778,7 @@ defmodule PillarTest do
%{"field5" => true}
]} = Pillar.select(conn, "select * from #{table_name}")
else
Logger.warn("insert keyword as boolean, because CH major version is lower than 21")
Logger.warning("insert keyword as boolean, because CH major version is lower than 21")
end
end
end
Expand Down
Loading