You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defpto_query(value)whenvaluein[Ecto.Adapters.Postgres,Postgrex],do: ~SQL"select * from information_schema.columns where table_schema not in ('information_schema', 'pg_catalog')"
33
+
defpto_query(value)whenvaluein[Ecto.Adapters.Tds,Tds],do: ~SQL"select * from information_schema.columns where table_schema not in ('information_schema', 'pg_catalog')"
34
+
defpto_query(value)whenvaluein[Ecto.Adapters.MyXQL,MyXQL],do: ~SQL"select * from information_schema.columns where table_schema not in ('mysql', 'performance_schema', 'sys')"
35
+
defpto_query(value)whenvaluein[Ecto.Adapters.SQLite3,Exqlite],do: ~SQL"select * from sqlite_master join pragma_table_info (sqlite_master.name)"
defto_query(value,:tables)whenis_postgres(value),do: ~SQL"select * from information_schema.tables where table_schema not in ('information_schema', 'pg_catalog')"
49
-
defto_query(value,:columns)whenis_postgres(value),do: ~SQL"select * from information_schema.columns where table_schema not in ('information_schema', 'pg_catalog')"
50
-
defto_query(value,:tables)whenis_tds(value),do: ~SQL"select * from information_schema.tables where table_schema not in ('information_schema', 'pg_catalog')"
51
-
defto_query(value,:columns)whenis_tds(value),do: ~SQL"select * from information_schema.columns where table_schema not in ('information_schema', 'pg_catalog')"
52
-
defto_query(value,:tables)whenis_mysql(value),do: ~SQL"select * from information_schema.tables where table_schema not in ('mysql', 'performance_schema', 'sys')"
53
-
defto_query(value,:columns)whenis_mysql(value),do: ~SQL"select * from information_schema.columns where table_schema not in ('mysql', 'performance_schema', 'sys')"
54
-
defto_query(value,:tables)whenis_sqlite(value),do: ~SQL"select * from sqlite_master join pragma_table_info (sqlite_master.name)"
{k,[{:special,_,_}]},acc->[acc|["the operator \e[31m",k,"\e[0m is invalid, did you mean any of #{__suggest__(k)}\n"]]
245
-
{k,[{:special,_,_}|_]=v},acc->[acc|["the operator \e[31m",k,"\e[0m is mentioned #{length(v)} times but is invalid, did you mean any of #{__suggest__(k)}\n"]]
246
-
{k,[_]},acc->[acc|["the relation \e[31m",k,"\e[0m does not exist\n"]]
247
-
{k,v},acc->[acc|["the relation \e[31m",k,"\e[0m is mentioned #{length(v)} times but does not exist\n"]]
230
+
{k,[{:special,_,_}]},acc->[acc|["the operator \e[31m",k,"\e[0m is invalid, did you mean any of #{__suggest__(k)}\n"]]
231
+
{k,[{:special,_,_}|_]=v},acc->[acc|["the operator \e[31m",k,"\e[0m is mentioned #{length(v)} times but is invalid, did you mean any of #{__suggest__(k)}\n"]]
232
+
{k,[_]},acc->[acc|["the relation \e[31m",k,"\e[0m does not exist\n"]]
233
+
{k,v},acc->[acc|["the relation \e[31m",k,"\e[0m is mentioned #{length(v)} times but does not exist\n"]]
Copy file name to clipboardExpand all lines: test/formatter_test.exs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,6 @@ defmodule SQL.FormatterTest do
9
9
end
10
10
11
11
test"format/2 preserve interpolation"do
12
-
assert"\nwith recursive temp(n, fact) as (\nselect\n0,\n1\nunion all\nselect\nn + {{one}},\n (n + {{one}}) * fact\nfrom\ntemp\nwhere\nn < 9\n)"==SQL.MixFormatter.format("with recursive temp(n, fact) as (select 0, 1 union all select n + {{one}}, (n + {{one}}) * fact from temp where n < 9)",[])
12
+
assert"\n\e[35mwith\e[0m \e[35mrecursive\e[0m \e[33mtemp\e[0m(\e[33mn\e[0m, \e[33mfact\e[0m) \e[35mas\e[0m (\n\e[35mselect\e[0m\n\e[33m0\e[0m,\n\e[33m1\e[0m\n\e[35munion\e[0m \e[35mall\e[0m\n\e[35mselect\e[0m\n\e[33mn\e[0m \e[35m+\e[0m {{one}},\n (\e[33mn\e[0m \e[35m+\e[0m {{one}}) \e[35m*\e[0m \e[33mfact\e[0m\n\e[35mfrom\e[0m\n\e[33mtemp\e[0m\n\e[35mwhere\e[0m\n\e[33mn\e[0m \e[35m<\e[0m \e[33m9\e[0m\n)"==SQL.MixFormatter.format("with recursive temp(n, fact) as (select 0, 1 union all select n + {{one}}, (n + {{one}}) * fact from temp where n < 9)",[])
0 commit comments