activerecord-oracle_enhanced-adapter 1.6.9 → 1.7.0.beta1
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.
- checksums.yaml +4 -4
- data/Gemfile +10 -11
- data/History.md +126 -14
- data/README.md +9 -6
- data/RUNNING_TESTS.md +1 -1
- data/Rakefile +1 -16
- data/VERSION +1 -1
- data/activerecord-oracle_enhanced-adapter.gemspec +15 -52
- data/lib/active_record/connection_adapters/oracle_enhanced/column.rb +8 -22
- data/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb +53 -45
- data/lib/active_record/connection_adapters/oracle_enhanced/connection.rb +6 -1
- data/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb +23 -62
- data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb +46 -56
- data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb +35 -0
- data/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb +34 -21
- data/lib/active_record/connection_adapters/oracle_enhanced/oci_quoting.rb +36 -0
- data/lib/active_record/connection_adapters/oracle_enhanced/procedures.rb +1 -1
- data/lib/active_record/connection_adapters/oracle_enhanced/quoting.rb +174 -0
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_creation.rb +17 -8
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb +17 -11
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb +160 -178
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb +42 -94
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements_ext.rb +50 -54
- data/lib/active_record/connection_adapters/oracle_enhanced/structure_dump.rb +15 -11
- data/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +197 -301
- data/lib/active_record/oracle_enhanced/type/integer.rb +3 -2
- data/lib/active_record/oracle_enhanced/type/national_character_string.rb +25 -0
- data/lib/active_record/oracle_enhanced/type/raw.rb +14 -2
- data/lib/active_record/oracle_enhanced/type/string.rb +28 -0
- data/lib/active_record/oracle_enhanced/type/text.rb +32 -0
- data/lib/activerecord-oracle_enhanced-adapter.rb +12 -17
- data/spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb +113 -135
- data/spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb +51 -59
- data/spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb +40 -41
- data/spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb +6 -6
- data/spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb +281 -233
- data/spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb +7 -7
- data/spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb +10 -10
- data/spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb +22 -22
- data/spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb +2 -2
- data/spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb +36 -37
- data/spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb +86 -46
- data/spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb +194 -294
- data/spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb +53 -39
- data/spec/spec_helper.rb +0 -6
- metadata +42 -143
- data/.travis.yml +0 -39
- data/.travis/oracle/download.sh +0 -14
- data/.travis/oracle/install.sh +0 -31
- data/.travis/setup_accounts.sh +0 -9
- data/lib/active_record/connection_adapters/oracle_enhanced/dirty.rb +0 -40
- data/lib/active_record/oracle_enhanced/type/timestamp.rb +0 -11
- data/spec/spec_config.yaml.template +0 -11
- data/spec/support/alter_system_user_password.sql +0 -2
- data/spec/support/create_oracle_enhanced_users.sql +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f98878e23459a54a04b7fa57b79ff3ee30e50f78
|
4
|
+
data.tar.gz: ebecb63118fb612c6b21c5b6038e6f82c05e9bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 539c8e0b3e594c6cde1704bbddbefb7dc92208d1bcbf053fd8a6eff37322b0e7c7acc899f9a9c9d7581ff4b06d9d2c7ddd7dc6cdb85db96af04f027331445646
|
7
|
+
data.tar.gz: 5257dcdc1df87458889098bec9eada6b1105f6158e7e47a2600ff35a362ecb6f40ad2a37a438a83e1a99cb7364fb4980fe96cd221ac0688fc86f91b4baa07ef4
|
data/Gemfile
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
gem '
|
5
|
-
gem 'rspec'
|
4
|
+
gem 'rspec', '~> 3.3'
|
6
5
|
gem 'rdoc'
|
6
|
+
gem 'rake'
|
7
7
|
|
8
|
-
gem 'activerecord', github: 'rails/rails', branch: '
|
9
|
-
gem '
|
10
|
-
gem '
|
11
|
-
gem 'actionpack', github: 'rails/rails', branch: '4-2-stable'
|
12
|
-
gem 'railties', github: 'rails/rails', branch: '4-2-stable'
|
8
|
+
gem 'activerecord', github: 'rails/rails', branch: 'master'
|
9
|
+
gem 'rack', github: 'rack/rack', branch: 'master'
|
10
|
+
gem 'arel', github: 'rails/arel', branch: 'master'
|
13
11
|
|
14
|
-
gem 'arel', github: 'rails/arel', branch: '6-0-stable'
|
15
|
-
gem 'journey', github: 'rails/journey'
|
16
|
-
|
17
|
-
gem 'activerecord-deprecated_finders'
|
18
12
|
gem 'ruby-plsql', '>=0.5.0'
|
19
13
|
|
20
14
|
platforms :ruby do
|
21
15
|
gem 'ruby-oci8', github: 'kubo/ruby-oci8'
|
16
|
+
gem 'byebug'
|
17
|
+
end
|
18
|
+
|
19
|
+
platforms :jruby do
|
20
|
+
gem 'ruby-debug'
|
22
21
|
end
|
23
22
|
end
|
data/History.md
CHANGED
@@ -1,19 +1,131 @@
|
|
1
|
-
## 1.
|
2
|
-
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
*
|
9
|
-
*
|
1
|
+
## 1.7.0.beta1 / 2016-07-18
|
2
|
+
|
3
|
+
* Major enhancements
|
4
|
+
|
5
|
+
* Support Rails 5.0
|
6
|
+
* Use Arel::Visitors::Oracle12 to use better top-N query support [#671]
|
7
|
+
* Oracle TIMESTAMP sql type is associated with Rails `DateTime` type [#845]
|
8
|
+
* Rails :time as Oracle TIMESTAMP to support subsecond precision [#817, #816]
|
9
|
+
* Rails :datetime as Oracle TIMESTAMP to support subsecond precision [#739]
|
10
|
+
* Remove ActiveRecord::OracleEnhanced::Type::Timestamp [#815]
|
11
|
+
* Deprecate `quote_date_with_to_date` and `quote_timestamp_with_to_timestamp` [#879]
|
12
|
+
* Deprecate `set_boolean_columns` and `set_string_columns` [#874]
|
13
|
+
* Deprecate `set_integer_columns [#872]
|
14
|
+
* Deprecate `set_date_columns` and `set_datetime_columns` [#869]
|
15
|
+
* Deprecate `ignore_table_columns` to use Rails native `ignored_columns` [#855]
|
16
|
+
* Set :datetime for an attribute explicitly [#875, #876]
|
17
|
+
* Support `#views` #738
|
18
|
+
* Replace `table_exists?` with `data_source_exists?` [#842]
|
19
|
+
* Introduce `data_source_exists?` to return tables and views [#841]
|
20
|
+
* Implement primary_keys to prepare dumping composite primary key [#860]
|
21
|
+
* Support for any type primary key [#836]
|
22
|
+
* Dump composite primary keys [#863]
|
23
|
+
* Dump type and options for non default primary keys [#861]
|
24
|
+
* Support creating foreign keys in create table [#862]
|
25
|
+
* Support ActiveRecord native comment feature [#822, #821, #819]
|
26
|
+
|
27
|
+
* Changes and bug fixes
|
28
|
+
|
29
|
+
* Fix cast_type issue [#795]
|
30
|
+
* Rename quote_value to quote_default_expression [#661]
|
31
|
+
* Change bind parameters order to come offset first then limit next [#831]
|
32
|
+
* type_cast arity change [#781]
|
33
|
+
* Initial support for sql_type_metadata [#656]
|
34
|
+
* Support bind_params for JDBC connections [#806]
|
35
|
+
* Use all_* dictionary replacing user_* ones [#713]
|
36
|
+
* Register `NUMBER(1)` sql_type to `Type::Boolean` [#844]
|
37
|
+
* Add `ActiveRecord::ValueTooLong` exception class [#827]
|
38
|
+
* Not passing `native_database_types` to `TableDefinition` [#747]
|
39
|
+
* Ignore index name in `index_exists?` when not passed a name to check for [#840]
|
40
|
+
* Add reversible syntax for change_column_default [#839]
|
41
|
+
* Support Oracle national character set NCHAR, NVARCHAR2 [#886]
|
42
|
+
* Support "limited" :returning_id [#894, #803]
|
43
|
+
* Support RAW sql data type in Rails 5 [#877]
|
44
|
+
* Remove `serialized_attributes` which is removed in Rails 5 [#694]
|
45
|
+
* Add deprecation warning for `bind_param` [#809]
|
46
|
+
* Remove `self.string_to_raw` from Column which is not called anymore [#813]
|
47
|
+
* Remove type_cast from Column [#811]
|
48
|
+
* Remove deprecated `distinct` method [#771]
|
49
|
+
* Remove alias_method_chain and rename oracle_enhanced_table to table [#864]
|
50
|
+
* Warn if `AR.primary_key` is called for a table with composite primary key [#837]
|
51
|
+
* Remove select method from Oracle enhanced adapter [#784]
|
52
|
+
* Remove version check to see if ::Rails::Railtie exists [#769]
|
53
|
+
* Remove FALSE_VALUES [#716]
|
54
|
+
* Remove TRUE_VALUES from OracleEnhancedColumn [#646]
|
55
|
+
* Remove insert_sql method [#866, #890]
|
56
|
+
* Rails5 remove require bind visitor [#853]
|
57
|
+
* substitute_at has been removed from Rails [#849]
|
58
|
+
* Serialize value for lob columns [#878]
|
59
|
+
* Do not cache prepared statements that are unlikely to have cache hits [#748]
|
60
|
+
* Handle BLOB type correctly [#804]
|
61
|
+
* Move ActiveRecord::Type to ActiveModel [#723]
|
62
|
+
* Remove cast_type to support Rails 5 Attribute API [#867]
|
63
|
+
* Handle ActiveModel::Type::Binary::Data type cast in _type_cast [#826]
|
64
|
+
* Use Abstract adapter `dump_schema_information` implementation [#857]
|
65
|
+
* Use ActiveRecord initialize_schema_migrations_table [#843]
|
66
|
+
* Use ActiveRecord::SchemaDumper#ignored? [#838]
|
67
|
+
* Use Abstract adapter join_to_update [#801, #800]
|
68
|
+
* Use ActiveRecord::OracleEnhanced::Type::Text [#887]
|
69
|
+
* Use ActiveRecord::OracleEnhanced::Type::String [#883]
|
70
|
+
* Use OracleEnhanced::ColumnDefinition [#650]
|
71
|
+
* Move to ActiveRecord::ConnectionAdapters::OracleEnhanced::SchemaDumper [#695]
|
72
|
+
* ColumnDumper uses Module#prepend [#696]
|
73
|
+
* Migrate from OracleEnhancedSchemaStatementExt to OracleEnhanced::SchemaStatementsExt [#768]
|
74
|
+
* Extract ActiveRecord::ConnectionAdapters::OracleEnhanced::Quoting [#764]
|
75
|
+
* Use keyword arguments for new table options [#820]
|
76
|
+
* Move `ruby_to_java_value` logic to `_type_cast` [#904]
|
77
|
+
* OracleEnhancedColumn.new needs sql_type_metadata including sql_type [#858]
|
78
|
+
* OracleEnhanced::JDBCQuoting and OCIQuoting [#897]
|
79
|
+
* Address `add_column_options!': undefined method `quote_value' [#647]
|
80
|
+
* Remove dirty tracking methods [#883]
|
81
|
+
* Use arel master branch for rails5 development [#645]
|
82
|
+
* Bump ruby-oci8 version to 2.2.0 or higher [#775]
|
83
|
+
* Remove jeweler dependency [#766]
|
84
|
+
* Remove required_rubygems_version [#719]
|
85
|
+
* Remove journey which is already part of Rails [#701]
|
86
|
+
* Remove dependencies with non activerecord gems [#700]
|
87
|
+
* Remove activerecord-deprecated_finders [#698]
|
88
|
+
* Use rack master branch [#697]
|
89
|
+
* Clean up gemspec file and bump rspec, ruby-plsql and ruby-oci8 versions [#717]
|
90
|
+
* Remove magic comment for utf-8 [#772, #726]
|
91
|
+
* add_dependency with ruby-oci8 only if it runs cruby, not jruby [#902]
|
92
|
+
* Install ruby-debug for jruby [#899]
|
93
|
+
* Address dirty object tracking should not mark empty text as changed [#888]
|
94
|
+
* Revert "Update matcher to skip sql statements to get `table` metadata" [#881]
|
95
|
+
* No need to set @visitor instance variable here [#854]
|
96
|
+
* log binds should not be type_casted [#818]
|
97
|
+
* Fix schema dumper errors [#810]
|
98
|
+
* Address undefined method `cast_type' [#805]
|
99
|
+
* Better fix to support "Relation#count does not support finder options anymore in Rails [#788, #787]
|
100
|
+
* ActiveRecord::Calculations#count no longer accepts an options hash argument #754
|
101
|
+
* Supress WARNINGs using `raise_error` without specific errors [#724]
|
102
|
+
* Use RSpec 3 [#707]
|
103
|
+
* Update "OracleEnhancedAdapter boolean type detection based on string column types and names" [#873]
|
104
|
+
* Update "OracleEnhancedAdapter integer type detection based on column names" [#871]
|
105
|
+
* Update "OracleEnhancedAdapter date type detection based on column names" [#868]
|
106
|
+
* Do not set emulate_dates_by_column_name or emulate_dates in specs [#870]
|
107
|
+
* Update rake spec message to show default branch name as master [#648]
|
108
|
+
* Remove `ActiveRecord::Base.default_timezone = :local` from spec_helper [#901]
|
109
|
+
* Update to rspec3 syntax to avoid deprecation notices [#776]
|
110
|
+
* Remove RAILS_GEM_VERSION [#702]
|
10
111
|
* Run Oracle enhanced adapter unit tests using Travis CI [#789]
|
11
112
|
* Upgrade travis-oracle to Version 2.0.1 [#903]
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
*
|
113
|
+
|
114
|
+
* Known issues
|
115
|
+
|
116
|
+
- Only with JRuby
|
117
|
+
* Rails 5 : create table with primary key trigger with default primary key not returning id [#912]
|
118
|
+
* Rails 5 : dirty object tracking not working correctly for CLOB [#911]
|
119
|
+
* Rails 5 : handling of CLOB columns get failures [#910]
|
120
|
+
* Rails 5 : SQL with bind parameters when NLS_NUMERIC_CHARACTERS is set to ', '
|
121
|
+
show Java::JavaSql::SQLSyntaxErrorException: / ORA-01722: invalid number [#909]
|
122
|
+
* Rails 5 : explain should explain query with binds got Java::JavaSql::SQLException: Invalid column index [#908]
|
123
|
+
- CRuby and JRuby
|
124
|
+
* Rails 5 : create table with primary key trigger not returning id [#907]
|
125
|
+
* Rails 5 : custom methods for create, update and destroy not working [#906]
|
126
|
+
* Rails 5 : has_and_belongs_to_many test gets ORA-01400 since primary key column "ID"
|
127
|
+
not included in insert statement [#856, rails/rails#25388]
|
128
|
+
* Rails 5 : undefined method `to_i' for #<Arel::Nodes::BindParam:0x00000002c92910> [#848, rails/arel#438]
|
17
129
|
|
18
130
|
## 1.6.7 / 2016-03-08
|
19
131
|
|
data/README.md
CHANGED
@@ -12,6 +12,15 @@ Oracle enhanced ActiveRecord adapter provides Oracle database access from Ruby o
|
|
12
12
|
|
13
13
|
INSTALLATION
|
14
14
|
------------
|
15
|
+
### Rails 5
|
16
|
+
|
17
|
+
Oracle enhanced adapter Rails 5 support is still in beta release, so use with caution.
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
# Use oracle as the database for Active Record
|
21
|
+
gem 'activerecord-oracle_enhanced-adapter', '=> 1.7.0.beta1'
|
22
|
+
```
|
23
|
+
|
15
24
|
### Rails 4.2
|
16
25
|
|
17
26
|
Oracle enhanced adapter version 1.6 just supports Rails 4.2 and does not support Rails 4.1 or lower version of Rails.
|
@@ -191,12 +200,6 @@ environment variable, note that the adapter name uses a dash instead of an under
|
|
191
200
|
DATABASE_URL=oracle-enhanced://localhost/XE
|
192
201
|
```
|
193
202
|
|
194
|
-
You can also specify a connection string via the `DATABASE_URL`, as long as it doesn't have any whitespace:
|
195
|
-
|
196
|
-
```bash
|
197
|
-
DATABASE_URL=oracle-enhanced://user:secret@connection-string/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xe)))
|
198
|
-
```
|
199
|
-
|
200
203
|
If you deploy JRuby on Rails application in Java application server that supports JNDI connections then you can specify JNDI connection as well:
|
201
204
|
|
202
205
|
```yml
|
data/RUNNING_TESTS.md
CHANGED
@@ -42,7 +42,7 @@ Running tests
|
|
42
42
|
bundle install
|
43
43
|
|
44
44
|
* Configure database credentials in one of two ways:
|
45
|
-
* copy spec/spec_config.yaml.template to spec/
|
45
|
+
* copy spec/spec_config.yaml.template to spec/config.yaml and modify as needed
|
46
46
|
* set required environment variables (see DATABASE_NAME in spec_helper.rb)
|
47
47
|
|
48
48
|
* Run tests with
|
data/Rakefile
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler'
|
3
|
+
require 'bundler/gem_tasks'
|
3
4
|
begin
|
4
5
|
Bundler.setup(:default, :development)
|
5
6
|
rescue Bundler::BundlerError => e
|
@@ -10,22 +11,6 @@ end
|
|
10
11
|
|
11
12
|
require 'rake'
|
12
13
|
|
13
|
-
require 'jeweler'
|
14
|
-
Jeweler::Tasks.new do |gem|
|
15
|
-
gem.name = "activerecord-oracle_enhanced-adapter"
|
16
|
-
gem.summary = "Oracle enhanced adapter for ActiveRecord"
|
17
|
-
gem.description = <<-EOS
|
18
|
-
Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
|
19
|
-
This adapter is superset of original ActiveRecord Oracle adapter.
|
20
|
-
EOS
|
21
|
-
gem.email = "raimonds.simanovskis@gmail.com"
|
22
|
-
gem.homepage = "http://github.com/rsim/oracle-enhanced"
|
23
|
-
gem.authors = ["Raimonds Simanovskis"]
|
24
|
-
gem.extra_rdoc_files = ['README.md']
|
25
|
-
gem.license = 'MIT'
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
14
|
require 'rspec/core/rake_task'
|
30
15
|
RSpec::Core::RakeTask.new(:spec)
|
31
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0.beta1
|
@@ -1,16 +1,11 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
1
|
Gem::Specification.new do |s|
|
7
2
|
s.name = %q{activerecord-oracle_enhanced-adapter}
|
8
|
-
s.version = "1.
|
3
|
+
s.version = "1.7.0.beta1"
|
9
4
|
|
10
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
6
|
s.license = 'MIT'
|
12
7
|
s.authors = [%q{Raimonds Simanovskis}]
|
13
|
-
s.date = %q{
|
8
|
+
s.date = %q{2016-07-18}
|
14
9
|
s.description = %q{Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
|
15
10
|
This adapter is superset of original ActiveRecord Oracle adapter.
|
16
11
|
}
|
@@ -36,11 +31,13 @@ This adapter is superset of original ActiveRecord Oracle adapter.
|
|
36
31
|
"lib/active_record/connection_adapters/oracle_enhanced/context_index.rb",
|
37
32
|
"lib/active_record/connection_adapters/oracle_enhanced/cpk.rb",
|
38
33
|
"lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb",
|
39
|
-
"lib/active_record/connection_adapters/oracle_enhanced/dirty.rb",
|
40
34
|
"lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb",
|
41
35
|
"lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb",
|
36
|
+
"lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb",
|
42
37
|
"lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb",
|
38
|
+
"lib/active_record/connection_adapters/oracle_enhanced/oci_quoting.rb",
|
43
39
|
"lib/active_record/connection_adapters/oracle_enhanced/procedures.rb",
|
40
|
+
"lib/active_record/connection_adapters/oracle_enhanced/quoting.rb",
|
44
41
|
"lib/active_record/connection_adapters/oracle_enhanced/schema_creation.rb",
|
45
42
|
"lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb",
|
46
43
|
"lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb",
|
@@ -49,8 +46,10 @@ This adapter is superset of original ActiveRecord Oracle adapter.
|
|
49
46
|
"lib/active_record/connection_adapters/oracle_enhanced/structure_dump.rb",
|
50
47
|
"lib/active_record/connection_adapters/oracle_enhanced/version.rb",
|
51
48
|
"lib/active_record/oracle_enhanced/type/integer.rb",
|
52
|
-
"lib/active_record/oracle_enhanced/type/
|
49
|
+
"lib/active_record/oracle_enhanced/type/national_character_string.rb",
|
53
50
|
"lib/active_record/oracle_enhanced/type/raw.rb",
|
51
|
+
"lib/active_record/oracle_enhanced/type/string.rb",
|
52
|
+
"lib/active_record/oracle_enhanced/type/text.rb",
|
54
53
|
"lib/activerecord-oracle_enhanced-adapter.rb",
|
55
54
|
"spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb",
|
56
55
|
"spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb",
|
@@ -69,7 +68,6 @@ This adapter is superset of original ActiveRecord Oracle adapter.
|
|
69
68
|
]
|
70
69
|
s.homepage = %q{http://github.com/rsim/oracle-enhanced}
|
71
70
|
s.require_paths = [%q{lib}]
|
72
|
-
s.rubygems_version = %q{1.8.6}
|
73
71
|
s.summary = %q{Oracle enhanced adapter for ActiveRecord}
|
74
72
|
s.test_files = [
|
75
73
|
"spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb",
|
@@ -87,46 +85,11 @@ This adapter is superset of original ActiveRecord Oracle adapter.
|
|
87
85
|
"spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb",
|
88
86
|
"spec/spec_helper.rb"
|
89
87
|
]
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.4"])
|
97
|
-
s.add_development_dependency(%q<activerecord>, ["~> 4.2.1"])
|
98
|
-
s.add_development_dependency(%q<activemodel>, [">= 0"])
|
99
|
-
s.add_development_dependency(%q<activesupport>, [">= 0"])
|
100
|
-
s.add_development_dependency(%q<actionpack>, [">= 0"])
|
101
|
-
s.add_development_dependency(%q<railties>, [">= 0"])
|
102
|
-
s.add_development_dependency(%q<arel>, [">= 0"])
|
103
|
-
s.add_development_dependency(%q<journey>, [">= 0"])
|
104
|
-
s.add_development_dependency(%q<ruby-plsql>, [">= 0.4.4"])
|
105
|
-
s.add_development_dependency(%q<ruby-oci8>, [">= 2.0.4"])
|
106
|
-
else
|
107
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
108
|
-
s.add_dependency(%q<rspec>, ["~> 2.4"])
|
109
|
-
s.add_dependency(%q<activerecord>, ["~> 4.2.1"])
|
110
|
-
s.add_dependency(%q<activemodel>, [">= 0"])
|
111
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
112
|
-
s.add_dependency(%q<actionpack>, [">= 0"])
|
113
|
-
s.add_dependency(%q<railties>, [">= 0"])
|
114
|
-
s.add_dependency(%q<arel>, [">= 0"])
|
115
|
-
s.add_dependency(%q<journey>, [">= 0"])
|
116
|
-
s.add_dependency(%q<ruby-plsql>, [">= 0.4.4"])
|
117
|
-
s.add_dependency(%q<ruby-oci8>, [">= 2.0.4"])
|
118
|
-
end
|
119
|
-
else
|
120
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
121
|
-
s.add_dependency(%q<rspec>, ["~> 2.4"])
|
122
|
-
s.add_dependency(%q<activerecord>, ["~> 4.2.1"])
|
123
|
-
s.add_dependency(%q<activemodel>, [">= 0"])
|
124
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
125
|
-
s.add_dependency(%q<actionpack>, [">= 0"])
|
126
|
-
s.add_dependency(%q<railties>, [">= 0"])
|
127
|
-
s.add_dependency(%q<arel>, [">= 0"])
|
128
|
-
s.add_dependency(%q<journey>, [">= 0"])
|
129
|
-
s.add_dependency(%q<ruby-plsql>, [">= 0.4.4"])
|
130
|
-
s.add_dependency(%q<ruby-oci8>, [">= 2.0.4"])
|
131
|
-
end
|
88
|
+
s.add_dependency(%q<rspec>, ["~> 3.3"])
|
89
|
+
s.add_dependency(%q<activerecord>, ["~> 5.0.0"])
|
90
|
+
s.add_dependency(%q<arel>, ["~> 7.0"])
|
91
|
+
s.add_dependency(%q<ruby-plsql>, [">= 0.5.0"])
|
92
|
+
s.add_dependency(%q<ruby-oci8>, [">= 2.2.0"]) if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
|
93
|
+
s.license = 'MIT'
|
132
94
|
end
|
95
|
+
|
@@ -4,11 +4,8 @@ module ActiveRecord
|
|
4
4
|
|
5
5
|
attr_reader :table_name, :nchar, :virtual_column_data_default, :returning_id #:nodoc:
|
6
6
|
|
7
|
-
|
8
|
-
TRUE_VALUES << 'Y'
|
7
|
+
def initialize(name, default, sql_type_metadata = nil, null = true, table_name = nil, virtual = false, returning_id = nil, comment = nil) #:nodoc:
|
9
8
|
|
10
|
-
def initialize(name, default, cast_type, sql_type = nil, null = true, table_name = nil, virtual=false, returning_id=false) #:nodoc:
|
11
|
-
@table_name = table_name
|
12
9
|
@virtual = virtual
|
13
10
|
@virtual_column_data_default = default.inspect if virtual
|
14
11
|
@returning_id = returning_id
|
@@ -17,22 +14,15 @@ module ActiveRecord
|
|
17
14
|
else
|
18
15
|
default_value = self.class.extract_value_from_default(default)
|
19
16
|
end
|
20
|
-
super(name, default_value,
|
17
|
+
super(name, default_value, sql_type_metadata, null, table_name, comment: comment)
|
21
18
|
# Is column NCHAR or NVARCHAR2 (will need to use N'...' value quoting for these data types)?
|
22
19
|
# Define only when needed as adapter "quote" method will check at first if instance variable is defined.
|
23
|
-
if
|
24
|
-
@
|
25
|
-
@object_type = sql_type.include? '.'
|
20
|
+
if sql_type_metadata
|
21
|
+
@object_type = sql_type_metadata.sql_type.include? '.'
|
26
22
|
end
|
27
23
|
# TODO: Need to investigate when `sql_type` becomes nil
|
28
24
|
end
|
29
25
|
|
30
|
-
def type_cast(value) #:nodoc:
|
31
|
-
return OracleEnhancedColumn::string_to_raw(value) if type == :raw
|
32
|
-
return guess_date_or_time(value) if type == :datetime && OracleEnhancedAdapter.emulate_dates
|
33
|
-
super
|
34
|
-
end
|
35
|
-
|
36
26
|
def virtual?
|
37
27
|
@virtual
|
38
28
|
end
|
@@ -73,16 +63,12 @@ module ActiveRecord
|
|
73
63
|
super
|
74
64
|
end
|
75
65
|
|
76
|
-
# convert RAW column values back to byte strings.
|
77
|
-
def self.string_to_raw(string) #:nodoc:
|
78
|
-
string
|
79
|
-
end
|
80
|
-
|
81
66
|
# Get column comment from schema definition.
|
82
67
|
# Will work only if using default ActiveRecord connection.
|
83
|
-
def comment
|
84
|
-
|
85
|
-
|
68
|
+
# def comment
|
69
|
+
# #TODO: may be deprecated due to conflict with variable
|
70
|
+
# ActiveRecord::Base.connection.column_comment(@table_name, name)
|
71
|
+
# end
|
86
72
|
|
87
73
|
private
|
88
74
|
|
@@ -2,65 +2,73 @@ module ActiveRecord #:nodoc:
|
|
2
2
|
module ConnectionAdapters #:nodoc:
|
3
3
|
module OracleEnhanced #:nodoc:
|
4
4
|
module ColumnDumper #:nodoc:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
# return original method if not using 'OracleEnhanced'
|
14
|
-
if (rails_env = defined?(Rails.env) ? Rails.env : (defined?(RAILS_ENV) ? RAILS_ENV : nil)) &&
|
15
|
-
ActiveRecord::Base.configurations[rails_env] &&
|
16
|
-
ActiveRecord::Base.configurations[rails_env]['adapter'] != 'oracle_enhanced'
|
17
|
-
return false
|
18
|
-
else
|
19
|
-
return true
|
20
|
-
end
|
21
|
-
end
|
5
|
+
|
6
|
+
def column_spec(column)
|
7
|
+
spec = Hash[prepare_column_options(column).map { |k, v| [k, "#{k}: #{v}"] }]
|
8
|
+
spec[:name] = column.name.inspect
|
9
|
+
if column.virtual?
|
10
|
+
spec[:type] = "virtual"
|
11
|
+
else
|
12
|
+
spec[:type] = schema_type(column).to_s
|
22
13
|
end
|
14
|
+
spec
|
23
15
|
end
|
24
16
|
|
25
|
-
def
|
26
|
-
|
27
|
-
return column_spec_without_oracle_enhanced(column, types) unless oracle_enhanced_adapter?
|
17
|
+
def prepare_column_options(column)
|
18
|
+
spec = {}
|
28
19
|
|
29
|
-
|
30
|
-
|
31
|
-
key_s = (k == :virtual_type ? "type: " : "#{k.to_s}: ")
|
32
|
-
spec[k] = key_s + spec[k]
|
20
|
+
if limit = schema_limit(column)
|
21
|
+
spec[:limit] = limit
|
33
22
|
end
|
34
|
-
spec
|
35
|
-
end
|
36
23
|
|
37
|
-
|
38
|
-
|
39
|
-
|
24
|
+
if precision = schema_precision(column)
|
25
|
+
spec[:precision] = precision
|
26
|
+
end
|
27
|
+
|
28
|
+
if scale = schema_scale(column)
|
29
|
+
spec[:scale] = scale
|
30
|
+
end
|
31
|
+
|
32
|
+
if virtual_as = schema_virtual_as(column)
|
33
|
+
spec[:as] = virtual_as
|
34
|
+
end
|
35
|
+
|
36
|
+
if virtual_type = schema_virtual_type(column)
|
37
|
+
spec[:virtual_type] = virtual_type
|
38
|
+
end
|
39
|
+
|
40
|
+
default = schema_default(column) if column.has_default?
|
41
|
+
spec[:default] = default unless default.nil?
|
42
|
+
|
43
|
+
spec[:null] = 'false' unless column.null
|
44
|
+
|
45
|
+
spec[:comment] = column.comment.inspect if column.comment.present?
|
40
46
|
|
41
|
-
spec = {}
|
42
|
-
spec[:name] = column.name.inspect
|
43
|
-
spec[:type] = column.virtual? ? 'virtual' : column.type.to_s
|
44
|
-
spec[:virtual_type] = column.type.inspect if column.virtual? && column.sql_type != 'NUMBER'
|
45
|
-
spec[:limit] = column.limit.inspect if column.limit != types[column.type][:limit] && column.type != :decimal
|
46
|
-
spec[:precision] = column.precision.inspect if !column.precision.nil?
|
47
|
-
spec[:scale] = column.scale.inspect if !column.scale.nil?
|
48
|
-
spec[:null] = 'false' if !column.null
|
49
|
-
spec[:as] = column.virtual_column_data_default if column.virtual?
|
50
|
-
spec[:default] = schema_default(column) if column.has_default? && !column.virtual?
|
51
|
-
spec[:comment] = column.comment.inspect unless column.comment.nil?
|
52
|
-
spec.delete(:default) if spec[:default].nil?
|
53
47
|
spec
|
54
48
|
end
|
55
49
|
|
56
|
-
def
|
50
|
+
def migration_keys
|
57
51
|
# TODO `& column_specs.map(&:keys).flatten` should be exetuted here
|
58
|
-
# return original method if not using 'OracleEnhanced'
|
59
|
-
return migration_keys_without_oracle_enhanced unless oracle_enhanced_adapter?
|
60
|
-
|
61
52
|
[:name, :limit, :precision, :scale, :default, :null, :as, :virtual_type, :comment]
|
62
53
|
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def schema_virtual_as(column)
|
58
|
+
column.virtual_column_data_default if column.virtual?
|
59
|
+
end
|
60
|
+
|
61
|
+
def schema_virtual_type(column)
|
62
|
+
unless column.type == :decimal
|
63
|
+
column.type.inspect if column.virtual?
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
63
67
|
end
|
64
68
|
end
|
65
69
|
end
|
70
|
+
|
71
|
+
module ColumnDumper #:nodoc:
|
72
|
+
prepend ConnectionAdapters::OracleEnhanced::ColumnDumper
|
73
|
+
end
|
66
74
|
end
|