monetdb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.rdoc +4 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/monetdb/version.rb +1 -1
- data/lib/monetdb.rb +33 -27
- data/test/unit/test_monetdb.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWY3ZDg1YzZlMDc5MDk4YTIyNWIwMmZlMjBhNzhmYTFhZGZiYjhhZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjJiZWNiZDM2MjA5Zjg2ZmNkNGU1YTllNmU2YjA5MjkwYjNjNWEzMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmEyNTZjNDE2NWQ5ZjIyOTMyZTNjM2NiOGQ0MWMwMjBkMjFjYTdkZWViZDUx
|
10
|
+
ZGVjNzM1OWQ1YjFiNGZkNDVkYzUyYTlkOTZkODNlMDhhNjQyMjk4NTJlMDUx
|
11
|
+
YWM1ZGYzMTdiMTlhNThmNGYzMjU0OThlY2MzYzYwZjAwZjFjZWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjY3NTY2ZDMzYzAzMGRhNTU4MTM2YzEwZTg2OWFiZGY1MDU1ZGZjMzUwMWVi
|
14
|
+
MTMwNThmMTI1N2FlYWQ2OGNhZjI4ZmQ5MWYzZjNiYTMxMjEzYTk3YWE2NDQx
|
15
|
+
ZGNiOTNhN2JmOGUzOTRjODY1NGVhY2EyYzNjZDBjOTc4NzQ3ZTM=
|
data/CHANGELOG.rdoc
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/monetdb/version.rb
CHANGED
data/lib/monetdb.rb
CHANGED
@@ -188,43 +188,49 @@ class MonetDB
|
|
188
188
|
|
189
189
|
start = Time.now
|
190
190
|
@connection.send(data.send(:format_query, qry))
|
191
|
-
|
192
|
-
log :info, "\n [1m[35mSQL (#{((Time.now - start) * 1000).round(1)}ms)[0m #{qry}[0m"
|
191
|
+
response = @connection.receive.split("\n")
|
193
192
|
|
194
|
-
if (row =
|
193
|
+
if (row = response[0]).chr == MSG_INFO
|
195
194
|
raise QueryError, row
|
196
195
|
end
|
197
196
|
|
198
|
-
|
199
|
-
data.send :receive_record_set,
|
200
|
-
|
201
|
-
|
202
|
-
|
197
|
+
headers, rows = response.partition{|x| [MSG_SCHEMA_HEADER, MSG_QUERY].include? x[0]}
|
198
|
+
data.send :receive_record_set, headers.join("\n")
|
199
|
+
query_header = data.send :parse_header_query, headers.shift
|
200
|
+
table_header = data.send :parse_header_table, headers
|
201
|
+
rows = rows.join("\n")
|
202
|
+
|
203
|
+
row_count = rows.split("\t]\n").size
|
204
|
+
while row_count < query_header["rows"].to_i
|
205
|
+
received = @connection.receive
|
206
|
+
row_count += received.scan("\t]\n").size
|
207
|
+
rows << received
|
203
208
|
end
|
209
|
+
rows = rows.split("\t]\n")
|
204
210
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
211
|
+
log :info, "\n [1m[35mSQL (#{((Time.now - start) * 1000).round(1)}ms)[0m #{qry}[0m"
|
212
|
+
|
213
|
+
column_types = table_header["columns_type"]
|
214
|
+
types = table_header["columns_name"].collect{|x| column_types[x]}
|
215
|
+
|
216
|
+
rows.collect do |row|
|
217
|
+
parsed, values = [], row.gsub(/^\[\s*/, "").split(",\t")
|
218
|
+
values.each_with_index do |value, index|
|
219
|
+
parsed << begin
|
220
|
+
unless value.strip == "NULL"
|
221
|
+
case types[index]
|
222
|
+
when "bigint", "int"
|
223
|
+
value.to_i
|
224
|
+
when "double"
|
225
|
+
value.to_f
|
226
|
+
else
|
227
|
+
value.strip.gsub(/(^"|"$|\\|\")/, "").force_encoding("UTF-8")
|
222
228
|
end
|
223
229
|
end
|
224
230
|
end
|
225
|
-
row
|
226
231
|
end
|
227
|
-
|
232
|
+
parsed
|
233
|
+
end
|
228
234
|
end
|
229
235
|
|
230
236
|
# Returns whether a "connection" object exists.
|
data/test/unit/test_monetdb.rb
CHANGED
@@ -5,7 +5,7 @@ module Unit
|
|
5
5
|
|
6
6
|
describe MonetDB do
|
7
7
|
it "has the current version" do
|
8
|
-
version = File.read
|
8
|
+
version = File.read(path("VERSION")).strip
|
9
9
|
assert_equal version, MonetDB::VERSION
|
10
10
|
assert File.read(path "CHANGELOG.rdoc").include?("Version #{version}")
|
11
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monetdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Engel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|