samidare 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/samidare/bigquery_utility.rb +3 -2
- data/lib/samidare/version.rb +1 -1
- data/spec/samidare/bigquery_utility_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaced8c4bed3cea616f56ffe1bd1bf72776f103c
|
4
|
+
data.tar.gz: d3ef165a96055bc1dd51fbafef03268a76550ba1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7a324305a0c9221fbcc505e91ff12f7171a9584d549502b9c1a55c755cb92a6fce0da381e11b044c35c24c29bd1a9ae97466a2caadb81e61261916e4f873de
|
7
|
+
data.tar.gz: 2db8446c60c1be68741871681c686c5a4fb3e08a9c087fa3f96ca9cdce8d1527e5abacd2d052c3b31e784ecee45c250d98b6c70f2baf4389367735f07115dae3
|
@@ -47,8 +47,9 @@ module Samidare
|
|
47
47
|
def self.generate_sql(table_info, column_infos)
|
48
48
|
columns = column_infos.map { |column_info| column_info.converted_value }
|
49
49
|
sql = "SELECT " + columns.join(",")
|
50
|
-
sql << " FROM #{table_info.name}
|
51
|
-
sql << "WHERE #{table_info.condition}
|
50
|
+
sql << " FROM #{table_info.name}"
|
51
|
+
sql << " WHERE #{table_info.condition}" if table_info.condition
|
52
|
+
sql << "\n"
|
52
53
|
sql
|
53
54
|
end
|
54
55
|
|
data/lib/samidare/version.rb
CHANGED
@@ -40,7 +40,7 @@ describe Samidare::BigQueryUtility do
|
|
40
40
|
|
41
41
|
context 'has condition' do
|
42
42
|
let(:table_info) { Samidare::EmbulkUtility::TableInfo.new({ 'name' => 'simple', 'condition' => 'created_at >= CURRENT_DATE() - INTERVAL 3 MONTH' }) }
|
43
|
-
let(:sql) { "SELECT `id`,`name`,UNIX_TIMESTAMP(`created_at`) AS `created_at` FROM simple
|
43
|
+
let(:sql) { "SELECT `id`,`name`,UNIX_TIMESTAMP(`created_at`) AS `created_at` FROM simple WHERE created_at >= CURRENT_DATE() - INTERVAL 3 MONTH\n" }
|
44
44
|
it { expect(subject).to eq sql }
|
45
45
|
end
|
46
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samidare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryoji Kobori
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|