gamma 0.1.3 → 0.1.4

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af47131d64f8eec9d36bb22306a67efbe6f3837e
4
- data.tar.gz: aeb5dcd92f6a8c4f03a6dcb4c4ca91448458beb0
3
+ metadata.gz: f298e700e2a66f7cd5cf45b3d7f1904a0fa6ee83
4
+ data.tar.gz: 3727dff9e1238cf0bbaf03386b120e5700165b20
5
5
  SHA512:
6
- metadata.gz: 5589763d3b31b5a449f5c9be96666ec387cd3109ba4275bf7cd4496a2dec3a3671886480b8caa84c8ad4c72e32014508d793eda1f92709489850f457a9cbdf66
7
- data.tar.gz: b827fe6fc3dbdcbada76c3fa70f239d5985841477eae8f7b8b314abdad4bebe057066eb56bba2610a620246d5021f08770bae8c26d23f68f7158af4673dd7fe0
6
+ metadata.gz: fc195be6dc26994490946b20101c925748199736bf94246df12ec28cc1e8e66e0d85e55b9635c25d071183996916713aa153a9e0c6eb28cde391f07db29f3071
7
+ data.tar.gz: 8cee68931520d35f73a1c1c3d42236c40b39533a86c9ea28f62b4b143ecf59001efd46ce5412b9141f7bbb3b77ee5fe66595d5e5ee9c4964cb814a7eef164cde
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gamma (0.1.3)
4
+ gamma (0.1.4)
5
5
  activesupport
6
6
  colorize (~> 0.8.1)
7
7
  mysql2
@@ -43,4 +43,4 @@ DEPENDENCIES
43
43
  rake (~> 10.0)
44
44
 
45
45
  BUNDLED WITH
46
- 1.16.0
46
+ 1.16.1
data/bin/console CHANGED
@@ -3,12 +3,5 @@
3
3
  require "bundler/setup"
4
4
  require "gamma"
5
5
 
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
6
+ require "pry"
7
+ Pry.start
@@ -22,12 +22,11 @@ class Gamma::Importer::Replace < Gamma::Importer
22
22
  primary_key = "id" # TODO: Fixme
23
23
 
24
24
  current_in_pid = 0
25
- current_in_offset = 0
26
25
  while true do
27
26
  select_columns = columns.map { |c| "`#{c}`" }.join(",")
28
27
  break unless select_columns.present?
29
28
 
30
- in_query = "SELECT #{select_columns} FROM #{@table.table_name} WHERE id > #{current_in_pid} LIMIT #{BATCH_SIZE}"
29
+ in_query = "SELECT #{select_columns} FROM #{@table.table_name} WHERE #{primary_key} > #{current_in_pid} ORDER BY #{primary_key} ASC LIMIT #{BATCH_SIZE}"
31
30
  logger.info(in_query) if ENV["DEBUG"]
32
31
  in_records = @in_client.client.query(in_query).to_a
33
32
 
@@ -44,7 +43,6 @@ class Gamma::Importer::Replace < Gamma::Importer
44
43
  end
45
44
 
46
45
  current_in_pid = in_records.last[primary_key]
47
- current_in_offset = current_in_offset + BATCH_SIZE
48
46
  end
49
47
  rescue => e
50
48
  logger.error("Sync Error #{@table.table_name} \n #{e}\n #{e.backtrace.join("\n")}".red)
data/lib/gamma/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gamma
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinsuke Nishio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-04 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  requirements: []
182
182
  rubyforge_project:
183
- rubygems_version: 2.6.13
183
+ rubygems_version: 2.6.8
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: DBSync