activerecord-oracle_enhanced-adapter 1.7.3 → 1.8.0
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/History.md +288 -0
- data/README.md +44 -0
- data/VERSION +1 -1
- data/lib/active_record/connection_adapters/emulation/oracle_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/oracle_enhanced/column.rb +7 -63
- data/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb +6 -52
- data/lib/active_record/connection_adapters/oracle_enhanced/connection.rb +13 -16
- data/lib/active_record/connection_adapters/oracle_enhanced/context_index.rb +117 -119
- data/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb +33 -27
- data/lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb +10 -10
- data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb +59 -77
- data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb +0 -4
- data/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb +56 -82
- data/lib/active_record/connection_adapters/oracle_enhanced/oci_quoting.rb +4 -4
- data/lib/active_record/connection_adapters/oracle_enhanced/procedures.rb +77 -77
- data/lib/active_record/connection_adapters/oracle_enhanced/quoting.rb +16 -45
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_creation.rb +60 -65
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb +33 -51
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb +149 -162
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb +119 -122
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements_ext.rb +3 -4
- data/lib/active_record/connection_adapters/oracle_enhanced/structure_dump.rb +69 -107
- data/lib/active_record/connection_adapters/oracle_enhanced/version.rb +1 -1
- data/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +315 -538
- data/lib/active_record/oracle_enhanced/type/boolean.rb +7 -11
- data/lib/active_record/oracle_enhanced/type/integer.rb +4 -5
- data/lib/active_record/oracle_enhanced/type/json.rb +8 -0
- data/lib/active_record/oracle_enhanced/type/national_character_string.rb +1 -2
- data/lib/active_record/oracle_enhanced/type/raw.rb +2 -4
- data/lib/active_record/oracle_enhanced/type/string.rb +2 -3
- data/lib/active_record/oracle_enhanced/type/text.rb +2 -4
- data/lib/active_record/oracle_enhanced/type/timestamptz.rb +23 -0
- data/lib/activerecord-oracle_enhanced-adapter.rb +14 -13
- data/spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb +129 -166
- data/spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb +50 -33
- data/spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb +44 -42
- data/spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb +283 -378
- data/spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb +14 -7
- data/spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb +5 -7
- data/spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb +118 -127
- data/spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb +2 -3
- data/spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb +74 -78
- data/spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb +68 -83
- data/spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb +308 -321
- data/spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb +103 -48
- data/spec/spec_config.yaml.template +11 -0
- data/spec/spec_helper.rb +59 -60
- data/spec/support/alter_system_user_password.sql +2 -0
- data/spec/support/create_oracle_enhanced_users.sql +31 -0
- metadata +25 -25
- data/.rspec +0 -2
- data/Gemfile +0 -22
- data/RUNNING_TESTS.md +0 -50
- data/Rakefile +0 -45
- data/activerecord-oracle_enhanced-adapter.gemspec +0 -95
- data/lib/active_record/connection_adapters/oracle_enhanced/cpk.rb +0 -21
- data/spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb +0 -113
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-oracle_enhanced-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Raimonds Simanovskis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -16,42 +16,42 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 5.0.
|
|
19
|
+
version: 5.1.0.rc
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 5.0.
|
|
26
|
+
version: 5.1.0.rc
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: arel
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: '8.0'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: '8.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: ruby-plsql
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.
|
|
47
|
+
version: 0.6.0
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.
|
|
54
|
+
version: 0.6.0
|
|
55
55
|
description: |
|
|
56
56
|
Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
|
|
57
57
|
This adapter is superset of original ActiveRecord Oracle adapter.
|
|
@@ -61,21 +61,15 @@ extensions: []
|
|
|
61
61
|
extra_rdoc_files:
|
|
62
62
|
- README.md
|
|
63
63
|
files:
|
|
64
|
-
- ".rspec"
|
|
65
|
-
- Gemfile
|
|
66
64
|
- History.md
|
|
67
65
|
- License.txt
|
|
68
66
|
- README.md
|
|
69
|
-
- RUNNING_TESTS.md
|
|
70
|
-
- Rakefile
|
|
71
67
|
- VERSION
|
|
72
|
-
- activerecord-oracle_enhanced-adapter.gemspec
|
|
73
68
|
- lib/active_record/connection_adapters/emulation/oracle_adapter.rb
|
|
74
69
|
- lib/active_record/connection_adapters/oracle_enhanced/column.rb
|
|
75
70
|
- lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb
|
|
76
71
|
- lib/active_record/connection_adapters/oracle_enhanced/connection.rb
|
|
77
72
|
- lib/active_record/connection_adapters/oracle_enhanced/context_index.rb
|
|
78
|
-
- lib/active_record/connection_adapters/oracle_enhanced/cpk.rb
|
|
79
73
|
- lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb
|
|
80
74
|
- lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb
|
|
81
75
|
- lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb
|
|
@@ -94,15 +88,16 @@ files:
|
|
|
94
88
|
- lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
|
|
95
89
|
- lib/active_record/oracle_enhanced/type/boolean.rb
|
|
96
90
|
- lib/active_record/oracle_enhanced/type/integer.rb
|
|
91
|
+
- lib/active_record/oracle_enhanced/type/json.rb
|
|
97
92
|
- lib/active_record/oracle_enhanced/type/national_character_string.rb
|
|
98
93
|
- lib/active_record/oracle_enhanced/type/raw.rb
|
|
99
94
|
- lib/active_record/oracle_enhanced/type/string.rb
|
|
100
95
|
- lib/active_record/oracle_enhanced/type/text.rb
|
|
96
|
+
- lib/active_record/oracle_enhanced/type/timestamptz.rb
|
|
101
97
|
- lib/activerecord-oracle_enhanced-adapter.rb
|
|
102
98
|
- spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb
|
|
103
99
|
- spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb
|
|
104
100
|
- spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb
|
|
105
|
-
- spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb
|
|
106
101
|
- spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb
|
|
107
102
|
- spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb
|
|
108
103
|
- spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb
|
|
@@ -112,7 +107,10 @@ files:
|
|
|
112
107
|
- spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb
|
|
113
108
|
- spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb
|
|
114
109
|
- spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb
|
|
110
|
+
- spec/spec_config.yaml.template
|
|
115
111
|
- spec/spec_helper.rb
|
|
112
|
+
- spec/support/alter_system_user_password.sql
|
|
113
|
+
- spec/support/create_oracle_enhanced_users.sql
|
|
116
114
|
homepage: http://github.com/rsim/oracle-enhanced
|
|
117
115
|
licenses:
|
|
118
116
|
- MIT
|
|
@@ -130,25 +128,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
130
128
|
requirements:
|
|
131
129
|
- - ">="
|
|
132
130
|
- !ruby/object:Gem::Version
|
|
133
|
-
version:
|
|
131
|
+
version: 1.8.11
|
|
134
132
|
requirements: []
|
|
135
133
|
rubyforge_project:
|
|
136
|
-
rubygems_version: 2.
|
|
134
|
+
rubygems_version: 2.6.11
|
|
137
135
|
signing_key:
|
|
138
136
|
specification_version: 4
|
|
139
137
|
summary: Oracle enhanced adapter for ActiveRecord
|
|
140
138
|
test_files:
|
|
141
|
-
- spec/
|
|
139
|
+
- spec/spec_config.yaml.template
|
|
140
|
+
- spec/spec_helper.rb
|
|
141
|
+
- spec/support/create_oracle_enhanced_users.sql
|
|
142
|
+
- spec/support/alter_system_user_password.sql
|
|
143
|
+
- spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb
|
|
144
|
+
- spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb
|
|
142
145
|
- spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb
|
|
143
146
|
- spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb
|
|
144
|
-
- spec/active_record/connection_adapters/
|
|
145
|
-
- spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb
|
|
146
|
-
- spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb
|
|
147
|
+
- spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb
|
|
147
148
|
- spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb
|
|
148
|
-
- spec/active_record/connection_adapters/
|
|
149
|
+
- spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb
|
|
149
150
|
- spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb
|
|
150
151
|
- spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb
|
|
151
|
-
- spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb
|
|
152
152
|
- spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb
|
|
153
|
-
- spec/active_record/connection_adapters/
|
|
154
|
-
- spec/
|
|
153
|
+
- spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb
|
|
154
|
+
- spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb
|
data/.rspec
DELETED
data/Gemfile
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
source 'http://rubygems.org'
|
|
2
|
-
|
|
3
|
-
group :development do
|
|
4
|
-
gem 'rspec', '~> 3.3'
|
|
5
|
-
gem 'rdoc'
|
|
6
|
-
gem 'rake'
|
|
7
|
-
|
|
8
|
-
gem 'activerecord', github: 'rails/rails', branch: '5-0-stable'
|
|
9
|
-
gem 'rack', github: 'rack/rack', branch: 'master'
|
|
10
|
-
gem 'arel', github: 'rails/arel', branch: 'master'
|
|
11
|
-
|
|
12
|
-
gem 'ruby-plsql', '>=0.5.0'
|
|
13
|
-
|
|
14
|
-
platforms :ruby do
|
|
15
|
-
gem 'ruby-oci8', github: 'kubo/ruby-oci8'
|
|
16
|
-
gem 'byebug'
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
platforms :jruby do
|
|
20
|
-
gem 'ruby-debug'
|
|
21
|
-
end
|
|
22
|
-
end
|
data/RUNNING_TESTS.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
Creating the test database
|
|
2
|
-
--------------------------
|
|
3
|
-
|
|
4
|
-
You need Oracle database (version 10.2 or later) with SYS and SYSTEM user access.
|
|
5
|
-
|
|
6
|
-
If you are on a Mac OS X 10.6 then use [these instructions](http://blog.rayapps.com/2009/09/14/how-to-install-oracle-database-10g-on-mac-os-x-snow-leopard) to install local Oracle DB 10.2.0.4. Other option is to use Linux VM and install Oracle DB on it.
|
|
7
|
-
|
|
8
|
-
If you are on Linux (or will use Linux virtual machine) and need Oracle DB just for running tests then Oracle DB XE edition is enough. See [Oracle XE downloads page](http://www.oracle.com/technetwork/database/express-edition/downloads/index.html) for download links and instructions.
|
|
9
|
-
|
|
10
|
-
If you are getting ORA-12520 errors when running tests then it means that Oracle cannot create enough processes to handle many connections (as during tests many connections are created and destroyed). In this case you need to log in as SYSTEM user and execute e.g.
|
|
11
|
-
|
|
12
|
-
alter system set processes=200 scope=spfile;
|
|
13
|
-
|
|
14
|
-
to increase process limit and then restart the database (this will be necessary if Oracle XE will be used as default processes limit is 40).
|
|
15
|
-
|
|
16
|
-
Ruby versions
|
|
17
|
-
-------------
|
|
18
|
-
|
|
19
|
-
oracle_enhanced is tested with MRI 2.1.x and 2.2.x, and JRuby 1.7.x and 9.0.x.x.
|
|
20
|
-
|
|
21
|
-
It is recommended to use [RVM](http://rvm.beginrescueend.com) to run tests with different Ruby implementations.
|
|
22
|
-
|
|
23
|
-
Running tests
|
|
24
|
-
-------------
|
|
25
|
-
|
|
26
|
-
* Create Oracle database schema for test purposes. Review `spec/spec_helper.rb` to see default schema/user names and database names (use environment variables to override defaults)
|
|
27
|
-
|
|
28
|
-
SQL> CREATE USER oracle_enhanced IDENTIFIED BY oracle_enhanced;
|
|
29
|
-
SQL> GRANT unlimited tablespace, create session, create table, create sequence, create procedure, create trigger, create view, create materialized view, create database link, create synonym, create type, ctxapp TO oracle_enhanced;
|
|
30
|
-
|
|
31
|
-
SQL> CREATE USER oracle_enhanced_schema IDENTIFIED BY oracle_enhanced_schema;
|
|
32
|
-
SQL> GRANT unlimited tablespace, create session, create table, create sequence, create procedure, create trigger, create view, create materialized view, create database link, create synonym, create type, ctxapp TO oracle_enhanced_schema;
|
|
33
|
-
|
|
34
|
-
* If you use RVM then switch to corresponding Ruby. It is recommended to create isolated gemsets for test purposes (e.g. rvm create gemset oracle_enhanced)
|
|
35
|
-
|
|
36
|
-
* Install bundler with
|
|
37
|
-
|
|
38
|
-
gem install bundler
|
|
39
|
-
|
|
40
|
-
* Install necessary gems with
|
|
41
|
-
|
|
42
|
-
bundle install
|
|
43
|
-
|
|
44
|
-
* Configure database credentials in one of two ways:
|
|
45
|
-
* copy spec/spec_config.yaml.template to spec/config.yaml and modify as needed
|
|
46
|
-
* set required environment variables (see DATABASE_NAME in spec_helper.rb)
|
|
47
|
-
|
|
48
|
-
* Run tests with
|
|
49
|
-
|
|
50
|
-
rake spec
|
data/Rakefile
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
require 'rubygems'
|
|
2
|
-
require 'bundler'
|
|
3
|
-
require 'bundler/gem_tasks'
|
|
4
|
-
begin
|
|
5
|
-
Bundler.setup(:default, :development)
|
|
6
|
-
rescue Bundler::BundlerError => e
|
|
7
|
-
$stderr.puts e.message
|
|
8
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
|
9
|
-
exit e.status_code
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
require 'rake'
|
|
13
|
-
|
|
14
|
-
require 'rspec/core/rake_task'
|
|
15
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
16
|
-
|
|
17
|
-
RSpec::Core::RakeTask.new(:rcov) do |t|
|
|
18
|
-
t.rcov = true
|
|
19
|
-
t.rcov_opts = ['--exclude', '/Library,spec/']
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
desc "Clear test database"
|
|
23
|
-
task :clear do
|
|
24
|
-
require "./spec/spec_helper"
|
|
25
|
-
ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
|
|
26
|
-
require "active_support/core_ext"
|
|
27
|
-
ActiveRecord::Base.connection.execute_structure_dump(ActiveRecord::Base.connection.full_drop)
|
|
28
|
-
ActiveRecord::Base.connection.execute("PURGE RECYCLEBIN") rescue nil
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# Clear test database before running spec and rcov
|
|
32
|
-
task :spec => :clear
|
|
33
|
-
task :rcov => :clear
|
|
34
|
-
|
|
35
|
-
task :default => :spec
|
|
36
|
-
|
|
37
|
-
require 'rdoc/task'
|
|
38
|
-
Rake::RDocTask.new do |rdoc|
|
|
39
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
40
|
-
|
|
41
|
-
rdoc.rdoc_dir = 'doc'
|
|
42
|
-
rdoc.title = "activerecord-oracle_enhanced-adapter #{version}"
|
|
43
|
-
rdoc.rdoc_files.include('README*')
|
|
44
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
45
|
-
end
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
Gem::Specification.new do |s|
|
|
2
|
-
s.name = %q{activerecord-oracle_enhanced-adapter}
|
|
3
|
-
s.version = "1.7.3"
|
|
4
|
-
|
|
5
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
6
|
-
s.required_ruby_version = '>= 2.2.2'
|
|
7
|
-
s.license = 'MIT'
|
|
8
|
-
s.authors = [%q{Raimonds Simanovskis}]
|
|
9
|
-
s.date = %q{2016-10-03}
|
|
10
|
-
s.description = %q{Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
|
|
11
|
-
This adapter is superset of original ActiveRecord Oracle adapter.
|
|
12
|
-
}
|
|
13
|
-
s.email = %q{raimonds.simanovskis@gmail.com}
|
|
14
|
-
s.extra_rdoc_files = [
|
|
15
|
-
"README.md"
|
|
16
|
-
]
|
|
17
|
-
s.files = [
|
|
18
|
-
".rspec",
|
|
19
|
-
"Gemfile",
|
|
20
|
-
"History.md",
|
|
21
|
-
"License.txt",
|
|
22
|
-
"README.md",
|
|
23
|
-
"RUNNING_TESTS.md",
|
|
24
|
-
"Rakefile",
|
|
25
|
-
"VERSION",
|
|
26
|
-
"activerecord-oracle_enhanced-adapter.gemspec",
|
|
27
|
-
"lib/active_record/connection_adapters/emulation/oracle_adapter.rb",
|
|
28
|
-
"lib/active_record/connection_adapters/oracle_enhanced_adapter.rb",
|
|
29
|
-
"lib/active_record/connection_adapters/oracle_enhanced/column.rb",
|
|
30
|
-
"lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb",
|
|
31
|
-
"lib/active_record/connection_adapters/oracle_enhanced/connection.rb",
|
|
32
|
-
"lib/active_record/connection_adapters/oracle_enhanced/context_index.rb",
|
|
33
|
-
"lib/active_record/connection_adapters/oracle_enhanced/cpk.rb",
|
|
34
|
-
"lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb",
|
|
35
|
-
"lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb",
|
|
36
|
-
"lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb",
|
|
37
|
-
"lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb",
|
|
38
|
-
"lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb",
|
|
39
|
-
"lib/active_record/connection_adapters/oracle_enhanced/oci_quoting.rb",
|
|
40
|
-
"lib/active_record/connection_adapters/oracle_enhanced/procedures.rb",
|
|
41
|
-
"lib/active_record/connection_adapters/oracle_enhanced/quoting.rb",
|
|
42
|
-
"lib/active_record/connection_adapters/oracle_enhanced/schema_creation.rb",
|
|
43
|
-
"lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb",
|
|
44
|
-
"lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb",
|
|
45
|
-
"lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb",
|
|
46
|
-
"lib/active_record/connection_adapters/oracle_enhanced/schema_statements_ext.rb",
|
|
47
|
-
"lib/active_record/connection_adapters/oracle_enhanced/structure_dump.rb",
|
|
48
|
-
"lib/active_record/connection_adapters/oracle_enhanced/version.rb",
|
|
49
|
-
"lib/active_record/oracle_enhanced/type/boolean.rb",
|
|
50
|
-
"lib/active_record/oracle_enhanced/type/integer.rb",
|
|
51
|
-
"lib/active_record/oracle_enhanced/type/national_character_string.rb",
|
|
52
|
-
"lib/active_record/oracle_enhanced/type/raw.rb",
|
|
53
|
-
"lib/active_record/oracle_enhanced/type/string.rb",
|
|
54
|
-
"lib/active_record/oracle_enhanced/type/text.rb",
|
|
55
|
-
"lib/activerecord-oracle_enhanced-adapter.rb",
|
|
56
|
-
"spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb",
|
|
57
|
-
"spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb",
|
|
58
|
-
"spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb",
|
|
59
|
-
"spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb",
|
|
60
|
-
"spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb",
|
|
61
|
-
"spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb",
|
|
62
|
-
"spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb",
|
|
63
|
-
"spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb",
|
|
64
|
-
"spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb",
|
|
65
|
-
"spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb",
|
|
66
|
-
"spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb",
|
|
67
|
-
"spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb",
|
|
68
|
-
"spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb",
|
|
69
|
-
"spec/spec_helper.rb"
|
|
70
|
-
]
|
|
71
|
-
s.homepage = %q{http://github.com/rsim/oracle-enhanced}
|
|
72
|
-
s.require_paths = [%q{lib}]
|
|
73
|
-
s.summary = %q{Oracle enhanced adapter for ActiveRecord}
|
|
74
|
-
s.test_files = [
|
|
75
|
-
"spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb",
|
|
76
|
-
"spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb",
|
|
77
|
-
"spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb",
|
|
78
|
-
"spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb",
|
|
79
|
-
"spec/active_record/connection_adapters/oracle_enhanced_database_tasks_spec.rb",
|
|
80
|
-
"spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb",
|
|
81
|
-
"spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb",
|
|
82
|
-
"spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb",
|
|
83
|
-
"spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb",
|
|
84
|
-
"spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb",
|
|
85
|
-
"spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb",
|
|
86
|
-
"spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb",
|
|
87
|
-
"spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb",
|
|
88
|
-
"spec/spec_helper.rb"
|
|
89
|
-
]
|
|
90
|
-
s.add_runtime_dependency(%q<activerecord>, ["~> 5.0.0"])
|
|
91
|
-
s.add_runtime_dependency(%q<arel>, ["~> 7.1.0"])
|
|
92
|
-
s.add_runtime_dependency(%q<ruby-plsql>, [">= 0.5.0"])
|
|
93
|
-
s.license = 'MIT'
|
|
94
|
-
end
|
|
95
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module ActiveRecord #:nodoc:
|
|
2
|
-
module ConnectionAdapters #:nodoc:
|
|
3
|
-
module OracleEnhancedCpk #:nodoc:
|
|
4
|
-
|
|
5
|
-
# This mightn't be in Core, but count(distinct x,y) doesn't work for me.
|
|
6
|
-
# Return that not supported if composite_primary_keys gem is required.
|
|
7
|
-
def supports_count_distinct? #:nodoc:
|
|
8
|
-
@supports_count_distinct ||= ! defined?(CompositePrimaryKeys)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def concat(*columns) #:nodoc:
|
|
12
|
-
"(#{columns.join('||')})"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.class_eval do
|
|
20
|
-
include ActiveRecord::ConnectionAdapters::OracleEnhancedCpk
|
|
21
|
-
end
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
unless defined?(NO_COMPOSITE_PRIMARY_KEYS)
|
|
4
|
-
|
|
5
|
-
describe "OracleEnhancedAdapter composite_primary_keys support" do
|
|
6
|
-
include SchemaSpecHelper
|
|
7
|
-
|
|
8
|
-
before(:all) do
|
|
9
|
-
if defined?(::ActiveRecord::ConnectionAdapters::OracleAdapter)
|
|
10
|
-
@old_oracle_adapter = ::ActiveRecord::ConnectionAdapters::OracleAdapter
|
|
11
|
-
::ActiveRecord::ConnectionAdapters.send(:remove_const, :OracleAdapter)
|
|
12
|
-
end
|
|
13
|
-
ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
|
|
14
|
-
if $cpk_oracle_adapter
|
|
15
|
-
::ActiveRecord::ConnectionAdapters::OracleAdapter = $cpk_oracle_adapter
|
|
16
|
-
$cpk_oracle_adapter = nil
|
|
17
|
-
end
|
|
18
|
-
require 'composite_primary_keys'
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
after(:all) do
|
|
22
|
-
# Object.send(:remove_const, 'CompositePrimaryKeys') if defined?(CompositePrimaryKeys)
|
|
23
|
-
if defined?(::ActiveRecord::ConnectionAdapters::OracleAdapter)
|
|
24
|
-
$cpk_oracle_adapter = ::ActiveRecord::ConnectionAdapters::OracleAdapter
|
|
25
|
-
::ActiveRecord::ConnectionAdapters.send(:remove_const, :OracleAdapter)
|
|
26
|
-
end
|
|
27
|
-
if @old_oracle_adapter
|
|
28
|
-
::ActiveRecord::ConnectionAdapters::OracleAdapter = @old_oracle_adapter
|
|
29
|
-
@old_oracle_adapter = nil
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
describe "do not use count distinct" do
|
|
34
|
-
before(:all) do
|
|
35
|
-
schema_define do
|
|
36
|
-
create_table :job_history, :primary_key => [:employee_id, :start_date], :force => true do |t|
|
|
37
|
-
t.integer :employee_id
|
|
38
|
-
t.date :start_date
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
class ::JobHistory < ActiveRecord::Base
|
|
42
|
-
set_table_name "job_history"
|
|
43
|
-
set_primary_keys :employee_id, :start_date
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
after(:all) do
|
|
48
|
-
Object.send(:remove_const, 'JobHistory') if defined?(JobHistory)
|
|
49
|
-
schema_define do
|
|
50
|
-
drop_table :job_history
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
it "should tell ActiveRecord that count distinct is not supported" do
|
|
55
|
-
expect(ActiveRecord::Base.connection.supports_count_distinct?).to be_falsey
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
it "should execute correct SQL COUNT DISTINCT statement on table with composite primary keys" do
|
|
59
|
-
expect { JobHistory.count(:distinct => true) }.not_to raise_error
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
describe "table with LOB" do
|
|
64
|
-
before(:all) do
|
|
65
|
-
schema_define do
|
|
66
|
-
create_table :cpk_write_lobs_test, :primary_key => [:type_category, :date_value], :force => true do |t|
|
|
67
|
-
t.string :type_category, :limit => 15, :null => false
|
|
68
|
-
t.date :date_value, :null => false
|
|
69
|
-
t.text :results, :null => false
|
|
70
|
-
t.timestamps null: true
|
|
71
|
-
end
|
|
72
|
-
create_table :non_cpk_write_lobs_test, :force => true do |t|
|
|
73
|
-
t.date :date_value, :null => false
|
|
74
|
-
t.text :results, :null => false
|
|
75
|
-
t.timestamps null: true
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
class ::CpkWriteLobsTest < ActiveRecord::Base
|
|
79
|
-
set_table_name 'cpk_write_lobs_test'
|
|
80
|
-
set_primary_keys :type_category, :date_value
|
|
81
|
-
end
|
|
82
|
-
class ::NonCpkWriteLobsTest < ActiveRecord::Base
|
|
83
|
-
set_table_name 'non_cpk_write_lobs_test'
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
after(:all) do
|
|
88
|
-
schema_define do
|
|
89
|
-
drop_table :cpk_write_lobs_test
|
|
90
|
-
drop_table :non_cpk_write_lobs_test
|
|
91
|
-
end
|
|
92
|
-
Object.send(:remove_const, "CpkWriteLobsTest")
|
|
93
|
-
Object.send(:remove_const, "NonCpkWriteLobsTest")
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it "should create new record in table with CPK and LOB" do
|
|
97
|
-
expect {
|
|
98
|
-
CpkWriteLobsTest.create(:type_category => 'AAA', :date_value => Date.today, :results => 'DATA '*10)
|
|
99
|
-
}.not_to raise_error
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
it "should create new record in table without CPK and with LOB" do
|
|
103
|
-
expect {
|
|
104
|
-
NonCpkWriteLobsTest.create(:date_value => Date.today, :results => 'DATA '*10)
|
|
105
|
-
}.not_to raise_error
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Other testing was done based on composite_primary_keys tests
|
|
110
|
-
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
end
|