bigquery_migration 0.1.0.pre1 → 0.1.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 305437e02b080f7394ac109f9ccde37f7cf9a02f
4
- data.tar.gz: c3f890726c06b6cfa7830240bf8f701a7957d14f
3
+ metadata.gz: f0252b004ebb12b8b9811410d3340ef96f24f536
4
+ data.tar.gz: 896836c4306cc278cbcc761f66ae5b6f4c35deb9
5
5
  SHA512:
6
- metadata.gz: 4ace45d55a36b4c62e1561c754ac83c18ae7ed1b8148bde2c8e8c40136a852346ee7a30ebda0731e5ee8d390bf3e34d660393c5d040adae1c9889de0f03cd5f9
7
- data.tar.gz: 7626f505d9580eee34731800bee1e1a655e5d64be5e192895898e3ac5d1fbea21ffc47d134cfbfa6ceaa85e52e63e18506bf5d9eea87b4dacfed4654513638b1
6
+ metadata.gz: 17adead80000680261ee459ce8a590b09c3ad4723326f2354dcbdb353e388c5e0bcb3b896a919e8beb989250a1637f9865be2b1ba76ad75b400eaeec8d249fbf
7
+ data.tar.gz: 0aadefd1fb891fdb7b6b3f9e41d71138b833626600b6804521e4c4c39e982ee7ef0ef0147696467a832f6b306cf955732a26854a5f315be70be5eab2e716b1d8
data/README.md CHANGED
@@ -20,6 +20,8 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
+ Define your desired schema, this tool automatically detects differences with the target table, and takes core of adding columns, or dropping columns (actually, select & copy is issued), or changing types.
24
+
23
25
  ### CLI
24
26
 
25
27
  config.yml
@@ -23,7 +23,7 @@ class BigqueryMigration
23
23
 
24
24
  def configure
25
25
  if json_keyfile = config[:json_keyfile]
26
- config[:json_key] =
26
+ json_key =
27
27
  case json_keyfile
28
28
  when String
29
29
  File.read(json_keyfile)
@@ -32,24 +32,21 @@ class BigqueryMigration
32
32
  else
33
33
  raise ConfigError.new "Unsupported json_keyfile type"
34
34
  end
35
- else
36
- config[:json_key] = {
37
- project_id: config[:project_id],
38
- service_email: config[:service_email],
39
- private_key: config[:private_key],
40
- }.to_json
41
- end
42
-
43
- if config[:json_key]
44
- begin
45
- jsonkey_params = JSON.parse(config[:json_key])
46
- rescue => e
47
- raise ConfigError.new "json_keyfile is not a JSON file"
48
- end
35
+ json_keyparams =
36
+ begin
37
+ case json_key
38
+ when String
39
+ HashUtil.deep_symbolize_keys(JSON.parse(json_key))
40
+ when Hash
41
+ HashUtil.deep_symbolize_keys(json_key)
42
+ end
43
+ rescue => e
44
+ raise ConfigError.new "json_keyfile is not a JSON file"
45
+ end
49
46
  end
50
47
 
51
- if jsonkey_params
52
- config[:project] ||= jsonkey_params['project_id']
48
+ if json_keyparams
49
+ config[:project] ||= json_keyparams[:project_id]
53
50
  end
54
51
 
55
52
  config[:retries] ||= 5
@@ -1,3 +1,3 @@
1
1
  class BigqueryMigration
2
- VERSION = "0.1.0.pre1"
2
+ VERSION = "0.1.0.pre2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigquery_migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre1
4
+ version: 0.1.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client