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
Stream.run(~SQL"SELECT g, repeat(md5(g::text), 4) FROM generate_series(1, 5000000) AS g")
34
+
end
35
+
end
17
36
18
-
defecto()do
37
+
defecto(type\\:transaction)
38
+
defecto(:statement)do
39
+
SQL.Repo.all(select(from("users"),[1]))
40
+
end
41
+
defecto(:empty)do
42
+
SQL.Repo.transaction(fn->
43
+
:ok
44
+
end)
45
+
end
46
+
defecto(:transaction)do
47
+
SQL.Repo.transaction(fn->
48
+
SQL.Repo.all(select(from("users"),[1]))
49
+
end)
50
+
end
51
+
defecto(:savepoint)do
19
52
SQL.Repo.transaction(fn->
20
53
SQL.Repo.transaction(fn->
21
54
SQL.Repo.all(select(from("users"),[1]))
22
55
end)
23
56
end)
24
57
end
58
+
defecto(:cursor)do
59
+
SQL.Repo.transaction(fn->
60
+
from(rowinfragment("SELECT g, repeat(md5(g::text), 4) FROM generate_series(1, ?) AS g",5000000),select: {fragment("?::int",row.g),fragment("?::text",row.repeat)})
# "runtime to_string" => fn _ -> to_string(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end,
55
105
# "runtime to_sql" => fn _ -> SQL.to_sql(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end,
56
106
# "runtime inspect" => fn _ -> inspect(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end,
0 commit comments