sequel_oracle_extensions 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -6,8 +6,11 @@ module Sequel
6
6
  module Oracle
7
7
  module DatabaseMethods
8
8
 
9
- # Specifies index attributes which are considered implicit and, thus, do not require DDL clauses.
10
- IMPLICIT_INDEX_ATTRIBUTES = { :parallel=>false, :compress=>false, :logging=>true, :visible=>true }
9
+ # Specifies flag attributes which are considered implicit and, thus, do not require DDL clauses.
10
+ IMPLICIT_FLAG_ATTRIBUTES = {
11
+ :parallel=>false, :compress=>false, :logging=>true, :visible=>true,
12
+ :rely=>false, :enabled=>true, :validate=>true
13
+ }
11
14
 
12
15
  # Returns a hash containing expanded table metadata that exposes Oracle-specific table attributes.
13
16
  #
@@ -268,16 +271,24 @@ module Sequel
268
271
 
269
272
  private
270
273
 
271
- # Overridden because Oracle has slightly different syntax.
272
- def alter_table_sql(table, op)
273
- alter_table_op = case op[:op]
274
- when :add_column
275
- "ADD #{column_definition_sql(op)}"
276
- else
277
- return super(table, op)
278
- end
279
- "ALTER TABLE #{quote_schema_table(table)} #{alter_table_op}"
280
- end
274
+ # Overridden because Oracle has slightly different syntax.
275
+ def alter_table_sql(table, op)
276
+ alter_table_op =
277
+ case op[:op]
278
+ when :add_column then "ADD #{column_definition_sql(op)}"
279
+ else return super(table, op)
280
+ end
281
+ "ALTER TABLE #{quote_schema_table(table)} #{alter_table_op}"
282
+ end
283
+
284
+ # Overridden to support various Oracle-specific options.
285
+ def column_references_sql(options)
286
+ sql = [super(options)]
287
+ sql << flag_option_sql(options, :rely)
288
+ sql << flag_option_sql(options, :enable, 'DISABLE')
289
+ sql << flag_option_sql(options, :validate)
290
+ sql.join ' '
291
+ end
281
292
 
282
293
  # Overridden because Oracle has a 30 character maximum identifier length.
283
294
  def default_index_name(table_name, columns)
@@ -336,7 +347,7 @@ module Sequel
336
347
  end
337
348
 
338
349
  # SQL DDL clause for specifying on/off flags
339
- def flag_option_sql(attrs, key, off="NO#{key}".upcase, on=key.to_s.upcase, implicit=IMPLICIT_INDEX_ATTRIBUTES[key])
350
+ def flag_option_sql(attrs, key, off="NO#{key}".upcase, on=key.to_s.upcase, implicit=IMPLICIT_FLAG_ATTRIBUTES[key])
340
351
  case attrs[key]
341
352
  when NilClass, implicit
342
353
  when TrueClass then on
@@ -384,8 +395,8 @@ module Sequel
384
395
  key = outm[row[:constraint_name]]
385
396
  unless subhash = hash[key]
386
397
  subhash = hash[key] = {
387
- :rely=>(row[:rely]=='RELY'), :enabled=>(row[:status]=='ENABLED'),
388
- :validated=>(row[:validated]=='VALIDATED'), :columns=>[]
398
+ :rely=>(row[:rely]=='RELY'), :enable=>(row[:status]=='ENABLED'),
399
+ :validate=>(row[:validated]=='VALIDATED'), :columns=>[]
389
400
  }
390
401
  if row.include? :r_constraint_name
391
402
  subhash[:ref_constraint] = outm[row[:r_constraint_name]]
@@ -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.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["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
  - 6
9
- - 2
10
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joe Khoobyar