chicagowarehouse 0.6.1 → 0.6.2
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
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
OTNkMGY3MWQ3NGEwNmRkZjE5YjRhZWI5NTVlYjkzNDM4MTg5OTA5Zg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NmJkNzExMDE4ZDc2MjgyZDU5OTEzNGJhNWJlYzI0MTZjYWIzOWFiZg==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MWNmOGUyYmI4ZWU4Y2M0MjY5ZWMyMzFkZWQ2ZTI3OTM2ZWFmNDFiNWNjOTI5
|
|
10
|
+
ZWQ3YWRjYzY1OWJhZTNhYmQ0ZjNmMWNjYmMzNmIxZDRmOWYwZjIyNzFmYjAy
|
|
11
|
+
YTRlNjEzMTg2ZTM0N2RlZjVmZWVmNjkxYzYzODUxNTQ0ZDI4MmE=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
YmQ0ZGVlMDcyOWY4OTk5NWQxMWViYmExMGQ3YzhlMTlkN2VlNjg4ZjI4OTk2
|
|
14
|
+
MDhjMTRjZjE2MzI3ZmRjNGU0YTlmYmFkNDM4ZmUzMDNjZTBlNzE0MGExOTUz
|
|
15
|
+
MWYyYTAwOGJiNTM0MzhmMWI5NDg5YzdmN2Y4ZjkxNDE0M2M5MDE=
|
data/Rakefile
CHANGED
|
@@ -14,7 +14,7 @@ require 'rake'
|
|
|
14
14
|
require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
|
16
16
|
gem.name = "chicagowarehouse"
|
|
17
|
-
gem.version = "0.6.
|
|
17
|
+
gem.version = "0.6.2"
|
|
18
18
|
gem.summary = "Ruby Data Warehousing"
|
|
19
19
|
gem.description = "Simple Data Warehouse toolkit for ruby"
|
|
20
20
|
gem.author = "Roland Swingler"
|
data/chicagowarehouse.gemspec
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: chicagowarehouse 0.6.
|
|
5
|
+
# stub: chicagowarehouse 0.6.2 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "chicagowarehouse"
|
|
9
|
-
s.version = "0.6.
|
|
9
|
+
s.version = "0.6.2"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib"]
|
|
13
13
|
s.authors = ["Roland Swingler"]
|
|
14
|
-
s.date = "2014-09-
|
|
14
|
+
s.date = "2014-09-03"
|
|
15
15
|
s.description = "Simple Data Warehouse toolkit for ruby"
|
|
16
16
|
s.email = "roland.swingler@gmail.com"
|
|
17
17
|
s.extra_rdoc_files = [
|
|
@@ -58,7 +58,7 @@ Gem::Specification.new do |s|
|
|
|
58
58
|
"lib/chicago/schema/table.rb",
|
|
59
59
|
"lib/chicago/star_schema.rb",
|
|
60
60
|
"spec/data/month_spec.rb",
|
|
61
|
-
"spec/database/
|
|
61
|
+
"spec/database/concrete_schema_strategies_spec.rb",
|
|
62
62
|
"spec/database/migration_file_writer_spec.rb",
|
|
63
63
|
"spec/database/schema_generator_spec.rb",
|
|
64
64
|
"spec/db_connections.yml.dist",
|
|
@@ -103,8 +103,13 @@ module Chicago
|
|
|
103
103
|
protected
|
|
104
104
|
|
|
105
105
|
def in_numeric_range?(min, max, unsigned_limit)
|
|
106
|
+
in_signed_limit?(min, max, unsigned_limit) ||
|
|
107
|
+
(min >= 0 && max <= unsigned_limit)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def in_signed_limit?(min, max, unsigned_limit)
|
|
106
111
|
signed_limit = (unsigned_limit + 1) / 2
|
|
107
|
-
(min >= -signed_limit && max <= signed_limit - 1)
|
|
112
|
+
(min >= -signed_limit && max <= signed_limit - 1)
|
|
108
113
|
end
|
|
109
114
|
end
|
|
110
115
|
|
|
@@ -149,6 +154,11 @@ module Chicago
|
|
|
149
154
|
def indexes(table)
|
|
150
155
|
[]
|
|
151
156
|
end
|
|
157
|
+
|
|
158
|
+
# Redshift does not support unsigned Integers
|
|
159
|
+
def in_numeric_range?(min, max, unsigned_limit)
|
|
160
|
+
in_signed_limit?(min, max, unsigned_limit)
|
|
161
|
+
end
|
|
152
162
|
end
|
|
153
163
|
|
|
154
164
|
# MySql-specific database schema strategy
|
|
@@ -85,7 +85,7 @@ describe "Generic DbTypeConverter" do
|
|
|
85
85
|
it "should have an unsigned integer id column" do
|
|
86
86
|
@tc.id_column.should == {
|
|
87
87
|
:name => :id,
|
|
88
|
-
:column_type => :integer
|
|
88
|
+
:column_type => :integer,
|
|
89
89
|
:unsigned => true
|
|
90
90
|
}
|
|
91
91
|
end
|
|
@@ -99,10 +99,20 @@ describe Chicago::Database::RedshiftStrategy do
|
|
|
99
99
|
it "should have an integer id column (not unsigned)" do
|
|
100
100
|
@tc.id_column.should == {
|
|
101
101
|
:name => :id,
|
|
102
|
-
:column_type => :integer
|
|
102
|
+
:column_type => :integer,
|
|
103
103
|
:unsigned => false
|
|
104
104
|
}
|
|
105
105
|
end
|
|
106
|
+
|
|
107
|
+
it "creates an integer column for an unsigned small int" do
|
|
108
|
+
column = Schema::Column.new(:id, :integer, :max => 65535, :min => 0)
|
|
109
|
+
@tc.db_type(column).should == :integer
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
it "multiplies the space requirements for string columns by 4" do
|
|
113
|
+
column = Schema::Column.new(:id, :string, :max => 25)
|
|
114
|
+
expect(@tc.column_hash(column)[:size]).to eql(100)
|
|
115
|
+
end
|
|
106
116
|
end
|
|
107
117
|
|
|
108
118
|
describe Chicago::Database::MysqlStrategy do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chicagowarehouse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roland Swingler
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-09-
|
|
11
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sequel
|
|
@@ -211,7 +211,7 @@ files:
|
|
|
211
211
|
- lib/chicago/schema/table.rb
|
|
212
212
|
- lib/chicago/star_schema.rb
|
|
213
213
|
- spec/data/month_spec.rb
|
|
214
|
-
- spec/database/
|
|
214
|
+
- spec/database/concrete_schema_strategies_spec.rb
|
|
215
215
|
- spec/database/migration_file_writer_spec.rb
|
|
216
216
|
- spec/database/schema_generator_spec.rb
|
|
217
217
|
- spec/db_connections.yml.dist
|