pgdexter 0.5.0 → 0.5.1

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: 65822d0d98c9641efdc3146295e098e09e83348ed109b856670a03d74ed2d70b
4
- data.tar.gz: 6d16c9019172e5e69df056ac358588151fa52ae9e8256159547e1842e2f9b97c
3
+ metadata.gz: c68746f6134f6603c5549b561886b45ee3432df5d1e07e65a5907559901d333a
4
+ data.tar.gz: 699c2744f3e2c9a79f8fa9ca6ae7a77586421243cbf7a1f92642f76724cc0cb0
5
5
  SHA512:
6
- metadata.gz: 4991adea5ee65493ea99abe94c19360fc6cc718048784431409abc08fbaf1b1efe3b304dedbd0994d8b66b38294b41ea6400bf5de1f03f09694723a7b709e77c
7
- data.tar.gz: 00f47a3efd2de6565dd5f5a3a64caa4b610e282d16620975376876501130a6d0cdbbef9412254b8f3d09db2df7a1f3f62d3a8e581c4fcfecd27ea3224cb6f20f
6
+ metadata.gz: 343bc52539ef09541fd0774667034ea02fb88b0e4f820e52c86d77df46d059c253576c22272b91a407b764965f66c554278154da6ab923249ce9979ab3a5aed0
7
+ data.tar.gz: a9b86931b4fc58d2b89c87f46f5008dfd47274cc39f096ec2b5143bea8858e29a786e387f9ccc29fe74475b5b0317e9d348d36f2a686cb19457ee79179a270f5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.5.1 (2023-05-27)
2
+
3
+ - Fixed `JSON::NestingError`
4
+
1
5
  ## 0.5.0 (2023-04-18)
2
6
 
3
7
  - Added support for normalized queries
data/README.md CHANGED
@@ -12,8 +12,8 @@ First, install [HypoPG](https://github.com/HypoPG/hypopg) on your database serve
12
12
 
13
13
  ```sh
14
14
  cd /tmp
15
- curl -L https://github.com/HypoPG/hypopg/archive/1.3.1.tar.gz | tar xz
16
- cd hypopg-1.3.1
15
+ curl -L https://github.com/HypoPG/hypopg/archive/1.4.0.tar.gz | tar xz
16
+ cd hypopg-1.4.0
17
17
  make
18
18
  make install # may need sudo
19
19
  ```
@@ -174,26 +174,6 @@ When streaming logs, specify the time to wait between processing queries
174
174
  dexter --interval 60 # seconds
175
175
  ```
176
176
 
177
- ## Examples
178
-
179
- Postgres package on Ubuntu 22.04
180
-
181
- ```sh
182
- sudo -u postgres dexter -d dbname /var/log/postgresql/postgresql-14-main.log
183
- ```
184
-
185
- Homebrew Postgres on Mac ARM
186
-
187
- ```sh
188
- dexter -d dbname /opt/homebrew/var/log/postgresql@14.log
189
- ```
190
-
191
- Homebrew Postgres on Mac x86-64
192
-
193
- ```sh
194
- dexter -d dbname /usr/local/var/log/postgresql@14.log
195
- ```
196
-
197
177
  ## Analyze
198
178
 
199
179
  For best results, make sure your tables have been recently analyzed so statistics are up-to-date. You can ask Dexter to analyze tables it comes across that haven’t been analyzed in the past hour with:
@@ -230,9 +210,8 @@ The `hypopg` extension, which Dexter needs to run, is available on [these provid
230
210
 
231
211
  For other providers, see [this guide](guides/Hosted-Postgres.md). To request a new extension:
232
212
 
233
- - Amazon RDS - follow the instructions on [this page](https://aws.amazon.com/rds/postgresql/faqs/)
234
213
  - Google Cloud SQL - vote or comment on [this page](https://issuetracker.google.com/issues/69250435)
235
- - DigitalOcean Managed Databases - vote or comment on [this page](https://ideas.digitalocean.com/app-framework-services/p/support-hypopg-for-postgres)
214
+ - DigitalOcean Managed Databases - vote or comment on [this page](https://ideas.digitalocean.com/managed-database/p/support-hypopg-for-postgres)
236
215
 
237
216
  ## HypoPG Installation Notes
238
217
 
@@ -197,10 +197,16 @@ module Dexter
197
197
  possible_columns = Set.new
198
198
  explainable_queries.each do |query|
199
199
  log "Finding columns: #{query.statement}" if @log_level == "debug3"
200
- find_columns(query.tree).each do |col|
201
- last_col = col["fields"].last
202
- if last_col["String"]
203
- possible_columns << last_col["String"]["sval"]
200
+ begin
201
+ find_columns(query.tree).each do |col|
202
+ last_col = col["fields"].last
203
+ if last_col["String"]
204
+ possible_columns << last_col["String"]["sval"]
205
+ end
206
+ end
207
+ rescue JSON::NestingError
208
+ if @log_level.start_with?("debug")
209
+ log colorize("ERROR: Cannot get columns", :red)
204
210
  end
205
211
  end
206
212
  end
@@ -226,7 +232,7 @@ module Dexter
226
232
  end
227
233
 
228
234
  def find_columns(plan)
229
- plan = JSON.parse(plan.to_json)
235
+ plan = JSON.parse(plan.to_json, max_nesting: 1000)
230
236
  find_by_key(plan, "ColumnRef")
231
237
  end
232
238
 
@@ -1,3 +1,3 @@
1
1
  module Dexter
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgdexter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg