pg_examiner 0.4.2 → 0.4.3

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
  SHA1:
3
- metadata.gz: 697245ba4c753820e5ebb80a41c5776db2b5251b
4
- data.tar.gz: d363b5efac3c568c25bf2976185674c9a0473023
3
+ metadata.gz: 52b286b1541c6b5c4bae49271dbb37a1f75273bf
4
+ data.tar.gz: 8fe536e9f6af7a96a2a0780abb42db432cc33f4d
5
5
  SHA512:
6
- metadata.gz: fd7e6790209d5af475aa27d2f4309b2da294fb33e0ba58f09de18c610a2b7559e7bc1527a72b403a6e5586fb891c298cf751af727772f065dcd099fe09a6b61d
7
- data.tar.gz: 0b4520614f4f8eeb35b12ce5810ca8a996989d29e2f41531c32a80666c9e402082f7190f8f5bf8af158f17b87fe5a8dfee1af6f862b47c6593d9ab0ec5ddfa6e
6
+ metadata.gz: c7599ff717e5d701631fa20608daaa36c36c6122f1279b2faf11e0dacdc9a479f62f45cec2ce98faa539e292267ccaff035bfbfa7d8074da6cfcc1bd6962f50a
7
+ data.tar.gz: 5ac072b2cee56fe350785c53b4fc33fbc8d9e3d2ef795934d86a79e2ff597f1e90bbdca1b4d8d82942eef75525f3073d71ab46f2f89f94e02e08af6c8f861236
@@ -84,7 +84,7 @@ module PGExaminer
84
84
 
85
85
  @pg_index = load_table @pg_class.map{|ns| ns['oid']}, <<-SQL
86
86
  SELECT c.relname AS name, i.indrelid, i.indkey, indisunique, indisprimary,
87
- pg_get_expr(i.indpred, i.indexrelid) AS filter,
87
+ pg_get_expr(i.indpred, i.indrelid) AS filter,
88
88
  pg_get_expr(i.indexprs, i.indrelid) AS expression
89
89
  FROM pg_index i
90
90
  JOIN pg_class c ON c.oid = i.indexrelid
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PGExaminer
4
- VERSION = '0.4.2'
4
+ VERSION = '0.4.3'
5
5
  end
data/spec/index_spec.rb CHANGED
@@ -76,27 +76,30 @@ describe PGExaminer do
76
76
  it "should consider the filters indexes have when determining equivalency" do
77
77
  a = examine <<-SQL
78
78
  CREATE TABLE test_table (
79
- a integer
79
+ a integer,
80
+ b integer
80
81
  );
81
82
 
82
- CREATE INDEX int_idx ON test_table(a) WHERE a > 0;
83
+ CREATE INDEX int_idx ON test_table(a) WHERE b > 0;
83
84
  SQL
84
85
 
85
- a.schemas.first.tables.first.indexes.first.row['filter'].should == '(a > 0)'
86
+ a.schemas.first.tables.first.indexes.first.row['filter'].should == '(b > 0)'
86
87
 
87
88
  b = examine <<-SQL
88
89
  CREATE TABLE test_table (
89
- a integer
90
+ a integer,
91
+ b integer
90
92
  );
91
93
 
92
- CREATE INDEX int_idx ON test_table(a) WHERE a > 0;
94
+ CREATE INDEX int_idx ON test_table(a) WHERE b > 0;
93
95
  SQL
94
96
 
95
- b.schemas.first.tables.first.indexes.first.row['filter'].should == '(a > 0)'
97
+ b.schemas.first.tables.first.indexes.first.row['filter'].should == '(b > 0)'
96
98
 
97
99
  c = examine <<-SQL
98
100
  CREATE TABLE test_table (
99
- a integer
101
+ a integer,
102
+ b integer
100
103
  );
101
104
 
102
105
  CREATE INDEX int_idx ON test_table(a);
@@ -106,8 +109,8 @@ describe PGExaminer do
106
109
  a.should_not == c
107
110
  b.should_not == c
108
111
 
109
- a.diff(c).should == {"schemas"=>{"public"=>{"tables"=>{"test_table"=>{"indexes"=>{"int_idx"=>{"filter expression"=>{"(a > 0)"=>nil}}}}}}}}
110
- b.diff(c).should == {"schemas"=>{"public"=>{"tables"=>{"test_table"=>{"indexes"=>{"int_idx"=>{"filter expression"=>{"(a > 0)"=>nil}}}}}}}}
112
+ a.diff(c).should == {"schemas"=>{"public"=>{"tables"=>{"test_table"=>{"indexes"=>{"int_idx"=>{"filter expression"=>{"(b > 0)"=>nil}}}}}}}}
113
+ b.diff(c).should == {"schemas"=>{"public"=>{"tables"=>{"test_table"=>{"indexes"=>{"int_idx"=>{"filter expression"=>{"(b > 0)"=>nil}}}}}}}}
111
114
  end
112
115
 
113
116
  it "should consider the expressions indexes are on, if any" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_examiner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hanks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg