tapsoob 0.4.16 → 0.4.17
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 +11 -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: fb5c1ed1e219ec2410ed346a7c9cbee4e75990c706d1d8afba596d0494db4571
|
4
|
+
data.tar.gz: dff7182a190b95f92b18c348aeb0b58212e3d1b3e282c8edd38249a3fcd04af2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2c71ef98ebc8b9354aed85dc11b6530ac6d83192125a94dbf71736947286fcd7584d4b81849e02fea8a7c638dab41c51bc97671eba0ad70c5fe372e40a2aa0d
|
7
|
+
data.tar.gz: c441227f8249ff7bfe47c09b436e4fd628f186847563fbf44d75134ed0b73619248edccd0451c891ec4aa40b4f23dc3adaa615eb097e6118515d34c6c219a395
|
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,16 @@ 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
|
78
|
+
res[:types] = schema.map do |c|
|
79
|
+
case db.column_schema_to_ruby_type(c.last[:type])[:type]
|
80
|
+
when BigDecimal
|
81
|
+
"float"
|
82
|
+
when File
|
83
|
+
"blob"
|
84
|
+
else
|
85
|
+
db.column_schema_to_ruby_type(c.last[:type])[:type].to_s.downcase
|
86
|
+
end
|
87
|
+
end unless schema.empty?
|
79
88
|
|
80
89
|
res
|
81
90
|
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.17
|
5
5
|
platform: ruby
|
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
|
name: ripl
|