scenic-oracle_adapter 1.3.3 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +75 -0
- data/docker-compose.yml +0 -2
- data/lib/scenic/adapters/oracle.rb +27 -7
- data/lib/scenic/oracle_adapter/version.rb +1 -1
- data/lib/tsortable_hash.rb +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deca022db8759f5e92910b10e1c9174717499054ca3d35f3036cc33ee621163c
|
4
|
+
data.tar.gz: bc8288c1ca2955e36eaa3005ecd2d46458e1efa7038124c076d2b9dc353aa3cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 530586109add300de30c1752f84ab28f568aa94cc262209a65881c408e3341b79e5f4ebab753b8610adf2c110645602a58442853dc42a67a47787e5e3081ae66
|
7
|
+
data.tar.gz: f632cc5e34fe412fca3d3dc5255177109bb5e2f2ca71aad84659e1c7ae1dae5dadc600bef3884423803e58d5c1d521f5ed33790e44ac463030a54d7424dd322b
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## v1.3.5 - Oct 9, 2024
|
4
|
+
|
5
|
+
- Silence ActiveRecord output while running specs. Clean green dots! (@eeklund, @dlagerro)
|
6
|
+
- Fix growing indentation issue in schema.rb after `schema:dump`/`schema:load` (@eeklund, @dlagerro)
|
7
|
+
|
8
|
+
## v1.3.4 - Jul 22, 2024
|
9
|
+
|
10
|
+
- Fixes a syntax issue in pre-3.1 rubies
|
11
|
+
- Fixes SchemaDumper error when all view objects aren't present in Oracle's user_dependencies
|
12
|
+
- Reduce git churn in schema.rb by ordering views before they're handed to SchemaDumper
|
13
|
+
- Strip newlines and trailing semicolons from view definitions
|
14
|
+
|
15
|
+
## v1.3.3 - Jul 18, 2024
|
16
|
+
|
17
|
+
- Fixes an issue with dependency sorting where mviews will sometimes be classified as a tables in user_dependencies (@whit0694)
|
18
|
+
|
19
|
+
## v1.3.2 - Jul 3, 2024
|
20
|
+
|
21
|
+
- Fixes a bug in the dependency-ordered views logic when Scenic views depend on external objects (@whit0694)
|
22
|
+
|
23
|
+
## v1.3.1 - Jul 3, 2024
|
24
|
+
|
25
|
+
- Ensures views in schema.rb are correctly ordered based on dependencies
|
26
|
+
|
27
|
+
## v1.3.0 - Mar 29, 2024
|
28
|
+
|
29
|
+
- Update to scenic version 1.8.0
|
30
|
+
- Adds support for the #populated? model method
|
31
|
+
|
32
|
+
## v1.2.2 - Apr 27, 2023
|
33
|
+
|
34
|
+
- This fixes the botched publishing of 1.2.1 (#14).
|
35
|
+
- The 1.2.1 gem file that was published to rubygems.org didn't contain any source code in the tarball. It was yanked and replaced with 1.2.2.
|
36
|
+
|
37
|
+
## v1.2.1 - Apr 20, 2023
|
38
|
+
|
39
|
+
- Fixes a bug where update_view fails on materialized views (#13)
|
40
|
+
|
41
|
+
## v1.2.0 - Dec 16, 2022
|
42
|
+
|
43
|
+
- Update to scenic version 1.7.0
|
44
|
+
- Update Oracle docker container to 21 XE for testing and local development
|
45
|
+
|
46
|
+
## v1.1.1 - Sep 10, 2021
|
47
|
+
|
48
|
+
- Fixes issue with schema dumping in pre-1.7.0 versions of activerecord-oracle_enhanced-adapter.
|
49
|
+
|
50
|
+
## v1.1.0 - Apr 23, 2021
|
51
|
+
|
52
|
+
- Added support for unpopulated materialized views (build deferrred) via scenic's no_data option.
|
53
|
+
- Move CI from Travis CI to Github Actions.
|
54
|
+
|
55
|
+
## v1.0.3 - Apr 22, 2021
|
56
|
+
|
57
|
+
- Update scenic dependency to 1.5.4 to provide support for Ruby 3
|
58
|
+
|
59
|
+
## v1.0.2 - May 11, 2020
|
60
|
+
|
61
|
+
- Remove ruby-oci as a direct dependency for jruby users (it was moved to a development dependency)
|
62
|
+
- Drop ruby 2.4 from the CI matrix. 2.4 is no longer supported.
|
63
|
+
|
64
|
+
## v1.0.1 - Apr 7, 2020
|
65
|
+
|
66
|
+
- Update rake development dependency to address CVE-2020-8130
|
67
|
+
- Default to docker/docker-compose for development and specs
|
68
|
+
|
69
|
+
## v1.0.0 - Nov 25, 2018
|
70
|
+
|
71
|
+
- This release adds cascading materialized view refreshes.
|
72
|
+
|
73
|
+
## v0.2.0 Pre-release - Oct 24, 2018
|
74
|
+
|
75
|
+
- Initial release with feature parity with Scenic::Adapters::Postgres with the exception of cascading materialized view refreshes.
|
data/docker-compose.yml
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative "oracle/index_reapplication"
|
4
4
|
require_relative "oracle/indexes"
|
5
5
|
require_relative "oracle/refresh_dependencies"
|
6
|
+
require "active_support/core_ext/string/strip"
|
6
7
|
require "tsortable_hash"
|
7
8
|
|
8
9
|
module Scenic
|
@@ -13,13 +14,11 @@ module Scenic
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def views
|
16
|
-
|
17
|
-
dependency_order.index(view_object.name)
|
18
|
-
end
|
17
|
+
sorted_dependency_views + sorted_missing_dependency_views
|
19
18
|
end
|
20
19
|
|
21
20
|
def create_view(name, definition)
|
22
|
-
execute("create view #{quote_table_name(name)} as #{definition}")
|
21
|
+
execute("create view #{quote_table_name(name)} as #{trimmed_definition(definition)}")
|
23
22
|
end
|
24
23
|
|
25
24
|
def drop_view(name)
|
@@ -27,7 +26,7 @@ module Scenic
|
|
27
26
|
end
|
28
27
|
|
29
28
|
def replace_view(name, definition)
|
30
|
-
execute("create or replace view #{quote_table_name(name)} as #{definition}")
|
29
|
+
execute("create or replace view #{quote_table_name(name)} as #{trimmed_definition(definition)}")
|
31
30
|
end
|
32
31
|
|
33
32
|
def update_view(name, definition)
|
@@ -36,7 +35,7 @@ module Scenic
|
|
36
35
|
end
|
37
36
|
|
38
37
|
def create_materialized_view(name, definition, no_data: false)
|
39
|
-
execute("create materialized view #{quote_table_name(name)} #{'build deferred' if no_data} as #{definition}")
|
38
|
+
execute("create materialized view #{quote_table_name(name)} #{'build deferred' if no_data} as #{trimmed_definition(definition)}")
|
40
39
|
end
|
41
40
|
|
42
41
|
def update_materialized_view(name, definition, no_data: false)
|
@@ -71,7 +70,7 @@ module Scenic
|
|
71
70
|
private
|
72
71
|
|
73
72
|
def view_dependencies
|
74
|
-
select_all(<<~EOSQL)
|
73
|
+
@view_dependencies ||= select_all(<<~EOSQL)
|
75
74
|
select lower(uo.object_name) as name, lower(ud.referenced_name) as dependency
|
76
75
|
from user_objects uo
|
77
76
|
left join user_dependencies ud on
|
@@ -88,6 +87,7 @@ module Scenic
|
|
88
87
|
and ud.referenced_name in (select object_name from user_objects)
|
89
88
|
and ud.referenced_owner = user
|
90
89
|
where uo.object_type in ('VIEW', 'MATERIALIZED VIEW')
|
90
|
+
order by lower(uo.object_name), lower(ud.referenced_name)
|
91
91
|
EOSQL
|
92
92
|
end
|
93
93
|
|
@@ -102,6 +102,22 @@ module Scenic
|
|
102
102
|
views_hash.tsort
|
103
103
|
end
|
104
104
|
|
105
|
+
def sorted_dependency_views
|
106
|
+
all_view_objects.filter do |view|
|
107
|
+
dependency_order.include?(view.name)
|
108
|
+
end.sort_by do |view|
|
109
|
+
dependency_order.index(view.name)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def sorted_missing_dependency_views
|
114
|
+
all_view_objects.filter do |view|
|
115
|
+
dependency_order.exclude?(view.name)
|
116
|
+
end.sort_by do |view|
|
117
|
+
view.name
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
105
121
|
def all_views
|
106
122
|
select_all("select lower(view_name) name, text definition from user_views").map do |view|
|
107
123
|
Scenic::View.new(name: view["name"], definition: view["definition"], materialized: false)
|
@@ -121,6 +137,10 @@ module Scenic
|
|
121
137
|
def refresh_dependencies_for(name)
|
122
138
|
Scenic::Adapters::Oracle::RefreshDependencies.call(name, self, connection)
|
123
139
|
end
|
140
|
+
|
141
|
+
def trimmed_definition(sql)
|
142
|
+
sql.rstrip.sub(/;$/, "").rstrip.strip_heredoc
|
143
|
+
end
|
124
144
|
end
|
125
145
|
end
|
126
146
|
end
|
data/lib/tsortable_hash.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scenic-oracle_adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Dinger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scenic
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- ".gitignore"
|
120
120
|
- ".rspec"
|
121
121
|
- ".rubocop.yml"
|
122
|
+
- CHANGELOG.md
|
122
123
|
- CODE_OF_CONDUCT.md
|
123
124
|
- Dockerfile
|
124
125
|
- Gemfile
|
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
159
|
- !ruby/object:Gem::Version
|
159
160
|
version: '0'
|
160
161
|
requirements: []
|
161
|
-
rubygems_version: 3.5.
|
162
|
+
rubygems_version: 3.5.17
|
162
163
|
signing_key:
|
163
164
|
specification_version: 4
|
164
165
|
summary: Oracle adapter for thoughtbot/scenic
|