sequel_oracle_extensions 0.6.2 → 0.6.3
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 +1 -1
- data/lib/sequel/oracle_extensions/schemata.rb +26 -15
- data/sequel_oracle_extensions.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.3
|
@@ -6,8 +6,11 @@ module Sequel
|
|
6
6
|
module Oracle
|
7
7
|
module DatabaseMethods
|
8
8
|
|
9
|
-
# Specifies
|
10
|
-
|
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
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
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=
|
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'), :
|
388
|
-
:
|
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]]
|
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:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 3
|
10
|
+
version: 0.6.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joe Khoobyar
|