diff --git a/tests/ruby/tests.rb b/tests/ruby/tests.rb new file mode 100644 index 0000000..f12440f --- /dev/null +++ b/tests/ruby/tests.rb @@ -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 \ No newline at end of file