gloo-sqlite 1.4 → 1.5
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 +4 -4
- data/lib/sqlite.rb +12 -10
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 031ece6c532c4d196d93fd11988d615a6d1ebaccdf94fee1565718007e1149dc
|
|
4
|
+
data.tar.gz: 1f20a1df8a62839a19714bae542568eff0d194167266f284a5603ac879f06a0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffa43408b50f6d1c10b38e75cd62b5841899e2606c9f763755a50b29e77f044f1c123ba8dc80f06115f77f2fdfa403980f8d623677998ae66a00510353c7cf25
|
|
7
|
+
data.tar.gz: 1a8b4d9456a7015c62bda6f7323e6498bafa87f035596e95c944cc0960f7af8b8660f749edd1032a76ca331ecb9bce4f616b6bf5892f02b25b1ac82428a7c73d
|
data/lib/sqlite.rb
CHANGED
|
@@ -110,26 +110,28 @@ class Sqlite < Gloo::Core::Obj
|
|
|
110
110
|
name = db_value
|
|
111
111
|
unless name
|
|
112
112
|
@engine.err DB_REQUIRED_ERR
|
|
113
|
-
return
|
|
113
|
+
return [ [], [] ]
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
db = SQLite3::Database.open name
|
|
117
117
|
# db.results_as_hash = true
|
|
118
118
|
results = db.query( sql, params )
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
rows = []
|
|
121
|
+
while ( row = results.next ) do
|
|
122
|
+
rows << row
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Return [ column names, rows ] - the same shape as gloo-mysql and
|
|
126
|
+
# gloo-pg, so callers (Query, Table) can treat every backend alike.
|
|
127
|
+
return [ results.columns, rows ]
|
|
121
128
|
end
|
|
122
129
|
|
|
123
|
-
#
|
|
130
|
+
#
|
|
124
131
|
# Based on the result set, build a QueryResult object.
|
|
125
|
-
#
|
|
132
|
+
#
|
|
126
133
|
def get_query_result( result )
|
|
127
|
-
|
|
128
|
-
while ( row = result.next ) do
|
|
129
|
-
rows << row
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
return QueryResult.new( result.columns, rows )
|
|
134
|
+
return QueryResult.new( result[0], result[1], @engine )
|
|
133
135
|
end
|
|
134
136
|
|
|
135
137
|
|