ruby-pg-extras 4.8.1 → 4.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53ad925bce389e73371c5bd13e7d9e39330480e3b099347ef64e0fd50b9183b7
4
- data.tar.gz: 6c55366083c537934e2409afa02868b7a2bd415d64c0bb784abe903484affde9
3
+ metadata.gz: c4b41078ac90e9598de6184dd02b7d351cafd32456e4f398f2d7902e233f053d
4
+ data.tar.gz: a8f19f5324b1c94a8f2516cf44087afec4d58b9a93537602175d225aeccb51e7
5
5
  SHA512:
6
- metadata.gz: 66063f3f4437fe237400594887252934e495b307daf567c1fb62cb9a199e560f96d1c3d51d3ff850fa84012a4e1f800fad79863439d5a63ccfa521c871e588d1
7
- data.tar.gz: f1dbf42153d2df5bbd4a391998441adbd08bd1801a68c3f6087ebdf569873ffa61603c626e4c16087f2fa972124efba4c81c68f4258f226192dbcf69de355960
6
+ metadata.gz: 48bbea030d77d6b27ff9000d3b7b7cf66a75386321559db2ba925edcc4c6dac9893ff5ce2bea54676b250a0e0e5219a9faf874b02e10d96236a249c84c2d9352
7
+ data.tar.gz: efb3cff55c6f5421813f3ac6d88cdbbd96ed08d1b8246099bf17416691ed480ae96459b2e2ce9c3dbc95eed418a85e4011097235f9407d0a9e359ec154260537
data/README.md CHANGED
@@ -635,6 +635,24 @@ RubyPgExtras.mandelbrot
635
635
 
636
636
  This command outputs the Mandelbrot set, calculated through SQL.
637
637
 
638
+ ### `connections`
639
+
640
+ ```ruby
641
+
642
+ RubyPgExtras.connections
643
+
644
+ +-----------------------------------------------------+
645
+ | Returns the list of all active database connections |
646
+ +-----------------+----------------+------------------+
647
+ | username | client_address | application_name |
648
+ +-----------------+----------------+------------------+
649
+ | postgres | 172.19.0.1/32 | psql |
650
+ | postgres | 172.19.0.1/32 | irb |
651
+ +-----------------+----------------+------------------+
652
+ ```
653
+
654
+ This command returns the list of all active database connections.
655
+
638
656
  ## Testing
639
657
 
640
658
  ```bash
@@ -24,7 +24,7 @@ module RubyPgExtras
24
24
  table_size total_index_size total_table_size
25
25
  unused_indexes duplicate_indexes vacuum_stats kill_all
26
26
  pg_stat_statements_reset buffercache_stats
27
- buffercache_usage ssl_used
27
+ buffercache_usage ssl_used connections
28
28
  )
29
29
 
30
30
  DEFAULT_ARGS = Hash.new({}).merge({
@@ -0,0 +1,4 @@
1
+ /* Returns the list of all active database connections */
2
+
3
+ SELECT usename as username, client_addr::text as client_address, application_name FROM pg_stat_activity
4
+ WHERE datname = current_database();
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyPgExtras
4
- VERSION = "4.8.1"
4
+ VERSION = "4.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.1
4
+ version: 4.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-19 00:00:00.000000000 Z
11
+ date: 2022-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -96,6 +96,7 @@ files:
96
96
  - lib/ruby_pg_extras/queries/cache_hit.sql
97
97
  - lib/ruby_pg_extras/queries/calls.sql
98
98
  - lib/ruby_pg_extras/queries/calls_legacy.sql
99
+ - lib/ruby_pg_extras/queries/connections.sql
99
100
  - lib/ruby_pg_extras/queries/db_settings.sql
100
101
  - lib/ruby_pg_extras/queries/duplicate_indexes.sql
101
102
  - lib/ruby_pg_extras/queries/extensions.sql