Created
June 27, 2020 07:28
-
-
Save ioquatix/2f08f78699418f65971035785c80cf18 to your computer and use it in GitHub Desktop.
multiple queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sync do | |
query = subject.call(<<~SQL * 10) | |
SELECT PG_SLEEP(0.1) AS LIFE; | |
SQL | |
query.results do |result| | |
Console.logger.info(query) {"#{result.count} #{result.field_names}"} | |
result.each do |row| | |
Console.logger.info(result, row) | |
end | |
end | |
end | |
# DB::Client | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.08s info: FFI::Postgres::Result [oid=0xd48] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.08s info: FFI::Postgres::Result [oid=0xd5c] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.08s info: FFI::Postgres::Result [oid=0xd70] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.08s info: FFI::Postgres::Result [oid=0xd84] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.08s info: FFI::Postgres::Result [oid=0xd98] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.08s info: FFI::Postgres::Result [oid=0xdac] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.08s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.09s info: FFI::Postgres::Result [oid=0xdc0] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.09s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.09s info: FFI::Postgres::Result [oid=0xdd4] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.09s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.09s info: FFI::Postgres::Result [oid=0xde8] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] | |
# 1.09s info: DB::Context::Query [oid=0xd34] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | 1 ["life"] | |
# 1.09s info: FFI::Postgres::Result [oid=0xdfc] [pid=1416503] [2020-06-27 18:24:34 +1200] | |
# | [""] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment