tapsoob 0.4.15-java → 0.4.19-java

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
  SHA256:
3
- metadata.gz: bf90aef94141e6d998c8ec0661f8d0b2d6f4340b40a565113bee04865c881314
4
- data.tar.gz: 4123d828e01e86483c8ebf0a2a600e2eeb1c5a7788fc699e6348bee62fd95304
3
+ metadata.gz: a478b81adfae4bae3508db6802b7b9a7280f8579e4da19cd1d575d741dacd0f3
4
+ data.tar.gz: 2b29446e1aa6ce40c4aabacbfd2d2e227b75d11f7426706de97948489ee2d87d
5
5
  SHA512:
6
- metadata.gz: ac7bba0277b68116b4a46673d90f0f6bef88d35293ad47d517f3f23928c65fc42041e4da6ecb7bf6ddf3028828d7c85858b703fdb3c9d25685a806f29a1d12f3
7
- data.tar.gz: fe2aeb16c60b303db8190e0b20de0e4129410c50ad17b0a71ef7e64793a0ea80df35582b1747098270f40f83d0ceb4c07ec60021d9c21e1456e996f07e692e90
6
+ metadata.gz: e4c76f4fb86ef9b0358e24657ea12911dacdd118a484210a97b206ba6b486c7afa1126d0d2fb7f52dc40bca96da9d29317dea687581ff953f4c92d0ca3f43878
7
+ data.tar.gz: fcfe1fc46dce2b88616557c419c04e451307a0c86e295663a750564efb6de1bf67c1f108d1ea86e9294d6a133abc258995562df657c038a127a3f4b2f9e160b4
@@ -75,7 +75,7 @@ module Tapsoob
75
75
  state[:chunksize] = fetch_chunksize
76
76
  ds = table.order(*order_by).limit(state[:chunksize], state[:offset])
77
77
  log.debug "DataStream#fetch_rows SQL -> #{ds.sql}"
78
- rows = Tapsoob::Utils.format_data(ds.all,
78
+ rows = Tapsoob::Utils.format_data(db, ds.all,
79
79
  :string_columns => string_columns,
80
80
  :schema => db.schema(table_name),
81
81
  :table => table_name
@@ -152,15 +152,15 @@ module Tapsoob
152
152
 
153
153
  rows = parse_encoded_data(encoded_data, json[:checksum])
154
154
 
155
- @complete = rows[:data] == [ ]
155
+ @complete = rows == { }
156
156
 
157
157
  # update local state
158
158
  state.merge!(json[:state].merge(:chunksize => state[:chunksize]))
159
159
 
160
160
  unless @complete
161
161
  yield rows if block_given?
162
- state[:offset] += (rows[:data].nil? ? 0 : rows[:data].size)
163
- (rows[:data].nil? ? 0 : rows[:data].size)
162
+ state[:offset] += rows[:data].size
163
+ rows[:data].size
164
164
  else
165
165
  0
166
166
  end
data/lib/tapsoob/utils.rb CHANGED
@@ -37,7 +37,7 @@ module Tapsoob
37
37
  data.unpack("m").first
38
38
  end
39
39
 
40
- def format_data(data, opts = {})
40
+ def format_data(db, data, opts = {})
41
41
  return {} if data.size == 0
42
42
  string_columns = opts[:string_columns] || []
43
43
  schema = opts[:schema] || []
@@ -75,7 +75,20 @@ Data : #{data}
75
75
  res = { table_name: table, header: header, data: only_data }
76
76
 
77
77
  # Add types if schema isn't empty
78
- res[:types] = schema.map { |c| c.last[:type] } unless schema.empty?
78
+ res[:types] = schema.map do |c|
79
+ case db.column_schema_to_ruby_type(c.last)[:type]
80
+ when BigDecimal
81
+ "float"
82
+ when :Bignum
83
+ "integer"
84
+ when File
85
+ "blob"
86
+ when TrueClass
87
+ "boolean"
88
+ else
89
+ db.column_schema_to_ruby_type(c.last)[:type].to_s.downcase
90
+ end
91
+ end unless schema.empty?
79
92
 
80
93
  res
81
94
  end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.4.15".freeze
3
+ VERSION = "0.4.19".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapsoob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.15
4
+ version: 0.4.19
5
5
  platform: java
6
6
  authors:
7
7
  - Félix Bellanger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-08 00:00:00.000000000 Z
12
+ date: 2021-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement