rails-pg-extras 5.6.1 → 5.6.4

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: 12c092356cb3e67c70abd5e49d61227fda3872353846b2fc18f23e83e5b33526
4
- data.tar.gz: 795c689588341078ed71d1ab6e522ba3b2d26e968d5f1a060983f70c0a163732
3
+ metadata.gz: c64f0e93ed959cd497aa7bfd471eb4dcf5e8327e31d46891d68f436ef63a9be6
4
+ data.tar.gz: 88778283a0b42e9a697dae56229e048ad35f657b7db58caed44f5b244cca4205
5
5
  SHA512:
6
- metadata.gz: 821ad0700c0b8d6fc352e15f7c45591354ac49d061c16d67e55b1778ae1ea4b979bfd62f76dc0b0bebd6cf8716803fb7e799434deba397d28496ac634a4c34af
7
- data.tar.gz: 5104d36a6a7e7a709f9e8be494178624b2e727d89e6958729dd00497245f11d2f8ae9a329c2ae848a00d41bf85e97b0eadb8cf17597678249e0150aa5837c120
6
+ metadata.gz: facfda5f88e9dd06f9ec11229bb40e399879d2c92f02b6eaa45d60bb853ddd9d768bc551881de9115386d3b5eb28ea5cbb3d6ca59e42cfda8f3cddb8e18de3d4
7
+ data.tar.gz: 859539a5d63c299acf366c799faacaf433f300c7737935fab678f48a4d2981c383954b5972f3ba921373fd2c0a8890ec027e2769012343d7f81fbfca1b1b0623
data/README.md CHANGED
@@ -212,7 +212,7 @@ you can add this info to the output:
212
212
 
213
213
  ### `missing_fk_indexes`
214
214
 
215
- This method lists columns likely to be foreign keys (i.e. column name ending in `_id` and related table exists) but don't have an index. It's recommended to always index foreign key columns because they are used for searching relation objects.
215
+ This method lists columns likely to be foreign keys (i.e. column name ending in `_id` and related table exists) which don't have an index. It's recommended to always index foreign key columns because they are used for searching relation objects.
216
216
 
217
217
  You can add indexes on the columns returned by this query and later check if they are receiving scans using the [unused_indexes method](#unused_indexes). Please remember that each index decreases write performance and autovacuuming overhead, so be careful when adding multiple indexes to often updated tables.
218
218
 
@@ -6,7 +6,7 @@
6
6
  <link href="/pg-extras-tailwind.min.css" rel="stylesheet">
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
- <body class="p-5 text-xs">
9
+ <body class="p-5 text-sm">
10
10
  <% if flash[:notice] %>
11
11
  <div class="bg-green-100 border-l-4 border-green-500 text-green-700 p-4 mb-4" role="alert">
12
12
  <p class="font-bold">Notice</p>
@@ -1,9 +1,26 @@
1
- <h1 class="font-bold text-xl my-5">Diagnose</h1>
2
- <table class="w-full font-mono border-collapse border my-5">
3
- <% RailsPgExtras.diagnose(in_format: :hash).each do |diagnosis| %>
4
- <tr class="<%= diagnosis[:ok] ? "bg-green-300" : "bg-red-300" %>">
5
- <td class='p-1 border font-bold'><%= diagnosis[:check_name] %></td>
6
- <td class='p-1 border'><%= diagnosis[:message] %></td>
1
+ <h1 class="font-bold text-2xl my-6 text-gray-900">Diagnose
2
+ <span class='pg-extras-help'>
3
+ (<a href="https://pawelurbanek.com/postgresql-fix-performance"
4
+ class="text-blue-600 hover:text-blue-800 hover:underline" target='_blank'>Tutorial</a>)
5
+ </span>
6
+ </h1>
7
+ <div class="overflow-x-auto">
8
+ <table class="w-full border border-gray-400 shadow-md rounded-lg overflow-hidden">
9
+ <thead>
10
+ <tr class="bg-gray-200 text-gray-900 text-left uppercase text-sm font-bold">
11
+ <th class="px-4 py-3 border">Ok</th>
12
+ <th class="px-4 py-3 border">Check Name</th>
13
+ <th class="px-4 py-3 border">Message</th>
7
14
  </tr>
8
- <% end %>
15
+ </thead>
16
+ <tbody>
17
+ <% RailsPgExtras.diagnose(in_format: :hash).each do |diagnosis| %>
18
+ <tr class="<%= diagnosis[:ok] ? "bg-green-100 text-green-900" : "bg-red-100 text-red-900" %> hover:bg-gray-300 transition">
19
+ <td class="px-4 py-3 border font-bold"><%= diagnosis[:ok] ? "YES" : "NO" %></td>
20
+ <td class="px-4 py-3 border font-semibold"><%= diagnosis[:check_name] %></td>
21
+ <td class="px-4 py-3 border"><%= diagnosis[:message] %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
9
25
  </table>
26
+ </div>
@@ -1,21 +1,24 @@
1
- <h1 class="font-bold text-xl my-5"><%= title %></h1>
1
+ <h1 class="font-bold text-2xl my-6 text-gray-800"><%= title %></h1>
2
2
 
3
- <table class="w-full font-mono border-collapse border my-5">
4
- <thead>
5
- <tr class="bg-gray-300">
6
- <% headers.each do |header| %>
7
- <th class="p-2 border text-left"><%= header %></th>
3
+ <div class="overflow-x-auto bg-white shadow-md rounded-lg">
4
+ <table class="w-full border border-gray-300 rounded-lg overflow-hidden">
5
+ <thead>
6
+ <tr class="bg-gray-100 text-gray-700 text-left uppercase text-sm font-semibold">
7
+ <% headers.each do |header| %>
8
+ <th class="px-4 py-3 border"><%= header %></th>
9
+ <% end %>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <% rows.each.with_index do |row, i| %>
14
+ <tr class="transition hover:bg-blue-100 hover:text-white <%= i.even? ? "bg-gray-50" : "bg-gray-100" %>">
15
+ <% row.each do |column| %>
16
+ <td class="px-4 py-3 border text-gray-800"><%= column %></td>
17
+ <% end %>
18
+ </tr>
8
19
  <% end %>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <% rows.each.with_index do |row, i| %>
13
- <tr class="hover:bg-gray-400 hover:text-white <%= i.even? ? "bg-gray-100" : "bg-gray-200" %>">
14
- <% row.each do |column| %>
15
- <td class="p-1 border"><%= column %></td>
16
- <% end %>
17
- </tr>
18
- <% end %>
19
- </tbody>
20
- </table>
21
- <span class="italic">run_at: <%= Time.now.utc %></span>
20
+ </tbody>
21
+ </table>
22
+ </div>
23
+
24
+ <p class="italic text-gray-500 text-sm mt-3">Run at: <%= Time.now.utc %></p>
@@ -3,6 +3,8 @@
3
3
  <%= render "unavailable_extensions_warning" if unavailable_extensions.any? %>
4
4
  <%= render "diagnose" %>
5
5
 
6
+ <br>
7
+ <br>
6
8
  <h1 class="font-bold text-xl my-5">Actions</h1>
7
9
 
8
10
  <% if RailsPgExtras::Web.action_enabled?(:kill_all) %>
@@ -1,8 +1,14 @@
1
1
  <%= content_for :title, params[:query_name].presence || "pg_extras" %>
2
2
  <%= render "rails_pg_extras/web/shared/queries_selector" %>
3
-
3
+
4
+ <br>
5
+
6
+ <a href="/pg_extras/queries"
7
+ class="inline-block bg-blue-500 text-white font-medium px-4 py-2 rounded-lg shadow-md hover:bg-blue-600 transition">
8
+ ← Back to Diagnose
9
+ </a>
4
10
  <% if @error %>
5
- <div class="text-red-500 p-3 font-mono my-5"><%= @error %></div>
11
+ <div class="text-red-500 p-3 font-mono my-5"><%= @error %></div>
6
12
  <% else %>
7
13
  <% if @result&.any? %>
8
14
  <%= render "result",
@@ -10,14 +16,14 @@
10
16
  headers: @result[0].keys,
11
17
  rows: @result.values %>
12
18
  <% else %>
13
- <div class="font-mono p-3 bg-gray-100 mt-3">No results</div>
19
+ <div class="font-mono p-3 bg-gray-100 mt-3">No results</div>
14
20
  <% end %>
15
21
  <% end %>
16
-
17
- <style>
18
- @media print {
19
- form {
20
- display: none
21
- }
22
- }
23
- </style>
22
+
23
+ <style>
24
+ @media print {
25
+ form {
26
+ display: none
27
+ }
28
+ }
29
+ </style>
@@ -1,7 +1,7 @@
1
- <%= form_tag queries_path, id: "queries", method: :get do |f| %>
2
- <%= select_tag :query_name, options_for_select(@all_queries, params[:query_name]),
3
- { prompt: "--- select query ---", class: "border p-2 font-bold", autofocus: true } %>
4
- <% end %>
1
+ <%= form_tag queries_path, id: "queries", method: :get do |f| %>
2
+ <%= select_tag :query_name, options_for_select(@all_queries, params[:query_name]),
3
+ { prompt: "diagnose", class: "border p-2 font-bold", autofocus: true } %>
4
+ <% end %>
5
5
 
6
6
  <%= javascript_tag nonce: true do -%>
7
7
  document.getElementById('queries').addEventListener('change', (e) => {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPgExtras
4
- VERSION = "5.6.1"
4
+ VERSION = "5.6.4"
5
5
  end
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.1
4
+ version: 5.6.4
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-02 00:00:00.000000000 Z
11
+ date: 2025-02-14 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.1
19
+ version: 5.6.4
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.1
26
+ version: 5.6.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement