mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-23 01:16:30 +00:00
Ruby tests
This commit is contained in:
11
tests/ruby/tests.rb
Normal file
11
tests/ruby/tests.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
require 'pg'
|
||||||
|
|
||||||
|
conn = PG.connect(host: '127.0.0.1', port: 5433, dbname: 'test')
|
||||||
|
|
||||||
|
conn.exec( "SELECT * FROM pg_stat_activity" ) do |result|
|
||||||
|
puts " PID | User | Query"
|
||||||
|
result.each do |row|
|
||||||
|
puts " %7d | %-16s | %s " %
|
||||||
|
row.values_at('pid', 'usename', 'query')
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user