tapsoob 0.4.16-java → 0.4.20-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapsoob/data_stream.rb +1 -1
- data/lib/tapsoob/utils.rb +16 -2
- data/lib/tapsoob/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09590b024cc8af1f11db6d4bc1a225d1b1281aed13ac127868eb4bb80aa181d1'
|
4
|
+
data.tar.gz: 46c40cdfc0ce3cb8ffa9a1eb048aedea915381e1f4e68bd6f3e741768c47f9fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 180093c7bdebaffd230445339d8cb11144eee6084bfa33c047ede66e1ef6c014791f9dfbec34a9516bd9421d4891864f27f442fafdb0c6d0b0ede2806e76bd33
|
7
|
+
data.tar.gz: 1d3a97cdf2da6f99888a780403f84f7ec92e04aa15c0d4986f123fed157a29ce61ca96d852bd52ec382ac0f0bc9bbacb0d8a0107fc7731cbd4683214a0a4ad6c
|
data/lib/tapsoob/data_stream.rb
CHANGED
@@ -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
|
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,21 @@ 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
|
-
|
78
|
+
db.extension :schema_dumper # Add schema dumper extension in case it hasn't been added until now
|
79
|
+
res[:types] = schema.map do |c|
|
80
|
+
case db.column_schema_to_ruby_type(c.last)[:type]
|
81
|
+
when BigDecimal
|
82
|
+
"float"
|
83
|
+
when :Bignum
|
84
|
+
"integer"
|
85
|
+
when File
|
86
|
+
"blob"
|
87
|
+
when TrueClass
|
88
|
+
"boolean"
|
89
|
+
else
|
90
|
+
db.column_schema_to_ruby_type(c.last)[:type].to_s.downcase
|
91
|
+
end
|
92
|
+
end unless schema.empty?
|
79
93
|
|
80
94
|
res
|
81
95
|
end
|
data/lib/tapsoob/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.20
|
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-
|
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
|