rails-pg-extras 5.6.6 → 5.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 433fab89b899bbcb7cfc3461a00077b3e0aaccd1bf1eeb94f9b4750ebb83d372
4
- data.tar.gz: d62e0373cd0d55818269ce039ae0c8bae18a10b4f09a29f1e7f7c792752788cd
3
+ metadata.gz: e54017e538eb9864af4721e07934942298aa9efae334cb2a5deaa4bb59134db6
4
+ data.tar.gz: 2d9e87eb20e6ab1e13fcff2cabb7d7ae964c273d8887eed3d4ef32dda0defdd0
5
5
  SHA512:
6
- metadata.gz: fcd72685fbc47133644124b6cd12d5277e00e2349630fc008be9f22c672a798da9400c8615d84f0ea1c9bc989154058e648b268cc9d14ce90ad8d73e6b77bb1f
7
- data.tar.gz: 0c4d90515bcaa179a8537e6b3742bee714574f5a29e43d904683adfda9a8c2c28626357e63547fd2a45e0b716d53a757c01c936a658b53fa0e40b9bcb9640f71
6
+ metadata.gz: 64e61a113be55a5a420fc7d00191e8ac52c564cc8287ba4529bf67dea39f36b252b7860e63a2924918da8767a701d480154c883bb0c6f21f9e21a6551dd0492c
7
+ data.tar.gz: c5aafded789a8380a16adc121f34a151af81a653a6c09e7438c85a9104dc3de47337369fe604aff421c12305ada4f7d92b8e41d8869f5653a33b924b34417e2b
data/README.md CHANGED
@@ -10,7 +10,7 @@ You can read this blog post for detailed step by step tutorial on how to [optimi
10
10
 
11
11
  Optionally you can enable a visual interface:
12
12
 
13
- ![Web interface](https://github.com/pawurb/rails-pg-extras/raw/main/pg-extras-ui-2.png)
13
+ ![Web interface](https://github.com/pawurb/rails-pg-extras/raw/main/pg-extras-ui-3.png)
14
14
 
15
15
  Alternative versions:
16
16
 
@@ -252,6 +252,23 @@ RailsPgExtras.missing_fk_constraints(args: { table_name: "users" })
252
252
 
253
253
  `table_name` argument is optional, if omitted, method will display missing fk constraints for all the tables.
254
254
 
255
+ ### `table_schema`
256
+
257
+ This method displays structure of a selected table, listing its column names, together with types, null constraints, and default values.
258
+
259
+ ```ruby
260
+ RailsPgExtras.table_schema(args: { table_name: "users" })
261
+
262
+ +-----------------------------+-----------------------------+-------------+-----------------------------------+
263
+ | column_name | data_type | is_nullable | column_default |
264
+ +-----------------------------+-----------------------------+-------------+-----------------------------------+
265
+ | id | bigint | NO | nextval('users_id_seq'::regclass) |
266
+ | team_id | integer | NO | |
267
+ | slack_id | character varying | NO | |
268
+ | pseudonym | character varying | YES | |
269
+
270
+ ```
271
+
255
272
  ### `table_info`
256
273
 
257
274
  This method displays metadata metrics for all or a selected table. You can use it to check the table's size, its cache hit metrics, and whether it is correctly indexed. Many sequential scans or no index scans are potential indicators of misconfigured indexes. This method aggregates data provided by other methods in an easy to analyze summary format.
@@ -39,8 +39,8 @@ module RailsPgExtras::Web
39
39
  def unavailable_extensions
40
40
  return @unavailable_extensions if defined?(@unavailable_extensions)
41
41
 
42
- enabled_extensions = ActiveRecord::Base.connection.extensions
43
- @unavailable_extensions = REQUIRED_EXTENSIONS.delete_if { |ext| ext.to_s.in?(enabled_extensions) }
42
+ enabled_extensions = ActiveRecord::Base.connection.extensions.lazy
43
+ @unavailable_extensions = REQUIRED_EXTENSIONS.delete_if { |ext| enabled_extensions.grep(/^([^.]+\.)?#{ext}$/).any? }
44
44
  end
45
45
  end
46
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPgExtras
4
- VERSION = "5.6.6"
4
+ VERSION = "5.6.7"
5
5
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.6
4
+ version: 5.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-14 00:00:00.000000000 Z
11
+ date: 2025-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-pg-extras
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.6.6
19
+ version: 5.6.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.6.6
26
+ version: 5.6.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ files:
126
126
  - lib/rails_pg_extras/web.rb
127
127
  - lib/rails_pg_extras/web/engine.rb
128
128
  - marginalia-logs.png
129
- - pg-extras-ui-2.png
129
+ - pg-extras-ui-3.png
130
130
  - rails-pg-extras-diagnose.png
131
131
  - rails-pg-extras.gemspec
132
132
  - spec/smoke_spec.rb
data/pg-extras-ui-2.png DELETED
Binary file