sequel_oracle_extensions 0.5.4 → 0.5.5

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -18,19 +18,16 @@ module Sequel
18
18
  schema, table = ds.schema_and_table(qualified_table).map{|k| k.to_s.send(ds.identifier_input_method) if k}
19
19
 
20
20
  # Build the dataset and apply filters for introspection of indexes.
21
- ds = ds.select(:i__index_name, :i__status, :i__uniqueness, :i__visibility,
22
- :i__index_type, :i__join_index, :ic__column_name).
21
+ ds = ds.select(:i__index_name, :i__index_type, :i__join_index, :i__partitioned,
22
+ :i__status, :i__uniqueness, :i__visibility, :i__compression, :i__tablespace_name,
23
+ :ic__column_name).
23
24
  from(:"all_indexes___i").
24
25
  join(:"all_ind_columns___ic", [ [:index_owner,:owner], [:index_name,:index_name] ]).
25
26
  where(:i__table_name=>table, :i__dropped=>'NO').
26
27
  order(:status.desc, :index_name, :ic__column_position)
27
- unless schema.nil?
28
- ds = ds.where :i__owner => schema
29
- end
30
- unless (z = options[:valid]).nil?
31
- ds = ds.where :i__status => (z ? 'VALID' : 'UNUSABLE')
32
- end
33
- if options[:all]
28
+ ds = ds.where :i__owner => schema unless schema.nil?
29
+ ds = ds.where :i__status => (options[:valid] ? 'VALID' : 'UNUSABLE') unless options[:valid].nil?
30
+ unless options[:all]
34
31
  pk = from(:all_constraints.as(:c)).where(:c__constraint_type=>'P').
35
32
  where(:c__index_name=>:i__index_name, :c__owner=>:i__owner)
36
33
  ds = ds.where ~pk.exists
@@ -43,11 +40,14 @@ module Sequel
43
40
  end
44
41
  ds.each do |row|
45
42
  ref = hash[row[:index_name]]
46
- ref[:index_type] ||= row[:index_type]
47
- ref[:join_index] ||= row[:join_index]=='YES'
48
- ref[:valid] ||= row[:status]=='VALID'
49
- ref[:uniqueness] ||= row[:uniqueness]=='UNIQUE'
50
- ref[:visibility] ||= row[:visibility]=='VISIBLE'
43
+ ref[:index_type] = row[:index_type]
44
+ ref[:join_index] = row[:join_index]=='YES'
45
+ ref[:partitioned] = row[:partitioned]=='YES'
46
+ ref[:valid] = row[:status]=='VALID'
47
+ ref[:uniqueness] = row[:uniqueness]=='UNIQUE'
48
+ ref[:visible] = row[:visibility]=='VISIBLE'
49
+ ref[:compression] = row[:compression]!='DISABLED'
50
+ ref[:tablespace] = row[:tablespace_name]
51
51
  ref[:columns] << outm[row[:column_name]]
52
52
  end
53
53
  result
@@ -104,13 +104,8 @@ module Sequel
104
104
  join(:"#{x_cons}_columns___cc", [ [:owner,:owner], [:constraint_name,:constraint_name] ]).
105
105
  where((options[:table_name_column]||:c__table_name)=>table, :c__constraint_type=>constraint_type).
106
106
  order(:table_name, :status.desc, :constraint_name, :cc__position)
107
- unless schema.nil?
108
- ds = ds.where :c__owner => schema
109
- end
110
- unless (z = options[:enabled]).nil?
111
- ds = ds.where :c__status => (z ? 'ENABLED' : 'DISABLED')
112
- end
113
-
107
+ ds = ds.where :c__owner => schema unless schema.nil?
108
+ ds = ds.where :c__status => (options[:enabled] ? 'ENABLED' : 'DISABLED') unless options[:enabled].nil?
114
109
  if constraint_type == 'R'
115
110
  ds = ds.select_more(:c__r_constraint_name, :t__table_name.as(:r_table_name)).
116
111
  join(:"#{x_cons}traints___t", [ [:owner,:c__r_owner], [:constraint_name,:c__r_constraint_name] ]).
@@ -127,18 +122,18 @@ module Sequel
127
122
  end
128
123
  ds.each do |row|
129
124
  ref = hash[row[:constraint_name]]
130
- ref[:table_name] ||= outm[row[:table_name]]
131
- ref[:rely] ||= row[:rely]=='RELY'
132
- ref[:enabled] ||= row[:status]=='ENABLED'
133
- ref[:validated] ||= row[:validated]=='VALIDATED'
134
- ref[:columns] << outm[row[:column_name]]
125
+ ref[:table_name] = outm[row[:table_name]]
126
+ ref[:rely] = row[:rely]=='RELY'
127
+ ref[:enabled] = row[:status]=='ENABLED'
128
+ ref[:validated] = row[:validated]=='VALIDATED'
129
+ ref[:columns] << outm[row[:column_name]]
135
130
 
136
131
  if row.include? :r_constraint_name
137
- ref[:r_constraint_name] ||= outm[row[:r_constraint_name]]
138
- ref[:r_table_name] ||= outm[row[:r_table_name]]
132
+ ref[:r_constraint_name] = outm[row[:r_constraint_name]]
133
+ ref[:r_table_name] = outm[row[:r_table_name]]
139
134
  end
140
135
  if row[:index_name]
141
- ref[:index_name] ||= outm[row[:index_name]]
136
+ ref[:index_name] = outm[row[:index_name]]
142
137
  end
143
138
  end
144
139
  result
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sequel_oracle_extensions}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Joe Khoobyar}]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_oracle_extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joe Khoobyar