scenic 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +9 -0
- data/lib/scenic/adapters/postgres.rb +2 -1
- data/lib/scenic/version.rb +1 -1
- data/spec/scenic/adapters/postgres_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e48c4898ced79e149309b431569eff692ef95ff075a57ad0a02f2b80b59a262
|
4
|
+
data.tar.gz: 7de8b684edffe599452d125aaed7f32111bfc4f99ef4b7e475ca0b2882c7c137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a3f7c1e233cd63be18a94ac39c44f36baff1f1c1ba6cdcc71aa31063c52c2220b3321455a2e904366c157ed419d0a20454dccfdd22e66e42508584865f0aabe
|
7
|
+
data.tar.gz: 0ee497506b13cdf2b64c49aea4b18fc351cf620b902acb962a8c9b5281c319b37b473f56ecfbcb873f4561e521780a54c6c6269d43ac841cfc4a3508213a61af
|
data/NEWS.md
CHANGED
@@ -5,6 +5,15 @@ changelog, see the [CHANGELOG] for each version via the version links.
|
|
5
5
|
|
6
6
|
[CHANGELOG]: https://github.com/scenic-views/scenic/commits/master
|
7
7
|
|
8
|
+
## [1.5.1] - February 10, 2019
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- Passing `no_data: true` when creating a materialized view would error if the
|
13
|
+
corresponding SQL file had statement-terminating semicolon.
|
14
|
+
|
15
|
+
[1.5.1]: https://github.com/scenic-views/scenic/compare/v1.5.0...v1.5.1
|
16
|
+
|
8
17
|
## [1.5.0] - February 8, 2019
|
9
18
|
|
10
19
|
### Added
|
@@ -134,9 +134,10 @@ module Scenic
|
|
134
134
|
# @return [void]
|
135
135
|
def create_materialized_view(name, sql_definition, no_data: false)
|
136
136
|
raise_unless_materialized_views_supported
|
137
|
+
|
137
138
|
execute <<-SQL
|
138
139
|
CREATE MATERIALIZED VIEW #{quote_table_name(name)} AS
|
139
|
-
#{sql_definition}
|
140
|
+
#{sql_definition.rstrip.chomp(';')}
|
140
141
|
#{'WITH NO DATA' if no_data};
|
141
142
|
SQL
|
142
143
|
end
|
data/lib/scenic/version.rb
CHANGED
@@ -27,6 +27,20 @@ module Scenic
|
|
27
27
|
expect(view.materialized).to eq true
|
28
28
|
end
|
29
29
|
|
30
|
+
it "handles semicolon in definition when using `with no data`" do
|
31
|
+
adapter = Postgres.new
|
32
|
+
|
33
|
+
adapter.create_materialized_view(
|
34
|
+
"greetings",
|
35
|
+
"SELECT text 'hi' AS greeting; \n",
|
36
|
+
no_data: true,
|
37
|
+
)
|
38
|
+
|
39
|
+
view = adapter.views.first
|
40
|
+
expect(view.name).to eq("greetings")
|
41
|
+
expect(view.materialized).to eq true
|
42
|
+
end
|
43
|
+
|
30
44
|
it "raises an exception if the version of PostgreSQL is too old" do
|
31
45
|
connection = double("Connection", supports_materialized_views?: false)
|
32
46
|
connectable = double("Connectable", connection: connection)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scenic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Prior
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-02-
|
12
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appraisal
|