motion-sqlite3 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/motion-sqlite3/result_set.rb +9 -21
- data/lib/motion-sqlite3/version.rb +1 -1
- data/motion-sqlite3.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d329d5a42393437772f5c9ee8088fef09477c858
|
4
|
+
data.tar.gz: e87168233adef2a754d1b1a9e317a155288a9412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e3f733abdb0b23b3bc370043d67269d449136905f1ac8c34d617849ed689c42b813bfc80191229195f1ad79337f475fc3ac83bc9351934cd670f766059868fd
|
7
|
+
data.tar.gz: 80337a1f5293b53b72d2d9ffafbd2377c516b57767f8304fe0da70d41425aca03428e0cdd2831ddc82a7a6711a163436168717447fac4a8418a98f0aa436fef8
|
@@ -15,41 +15,29 @@ module SQLite3
|
|
15
15
|
|
16
16
|
private
|
17
17
|
|
18
|
-
def
|
19
|
-
|
18
|
+
def current_row
|
19
|
+
row = {}
|
20
20
|
|
21
|
-
|
22
|
-
0.upto(
|
21
|
+
column_count = sqlite3_column_count(@handle.value)
|
22
|
+
0.upto(column_count - 1) do |i|
|
23
23
|
name = sqlite3_column_name(@handle.value, i).to_sym
|
24
24
|
type = sqlite3_column_type(@handle.value, i)
|
25
25
|
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
columns
|
30
|
-
end
|
31
|
-
|
32
|
-
def current_row
|
33
|
-
row = {}
|
34
|
-
|
35
|
-
columns.each do |name, metadata|
|
36
|
-
case metadata.type
|
26
|
+
case type
|
37
27
|
when SQLITE_NULL
|
38
28
|
row[name] = nil
|
39
29
|
when SQLITE_TEXT
|
40
|
-
row[name] = sqlite3_column_text(@handle.value,
|
30
|
+
row[name] = sqlite3_column_text(@handle.value, i)
|
41
31
|
when SQLITE_BLOB
|
42
|
-
row[name] = NSData.dataWithBytes(sqlite3_column_blob(@handle.value,
|
32
|
+
row[name] = NSData.dataWithBytes(sqlite3_column_blob(@handle.value, i), length: sqlite3_column_bytes(@handle.value, i))
|
43
33
|
when SQLITE_INTEGER
|
44
|
-
row[name] = sqlite3_column_int(@handle.value,
|
34
|
+
row[name] = sqlite3_column_int(@handle.value, i)
|
45
35
|
when SQLITE_FLOAT
|
46
|
-
row[name] = sqlite3_column_double(@handle.value,
|
36
|
+
row[name] = sqlite3_column_double(@handle.value, i)
|
47
37
|
end
|
48
38
|
end
|
49
39
|
|
50
40
|
row
|
51
41
|
end
|
52
42
|
end
|
53
|
-
|
54
|
-
class ColumnMetadata < Struct.new(:index, :type); end
|
55
43
|
end
|
data/motion-sqlite3.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-sqlite3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Green
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.0.
|
40
|
+
version: 0.0.4
|
41
41
|
description: A minimal wrapper over the SQLite 3 C API for RubyMotion
|
42
42
|
email:
|
43
43
|
- mattgreenrocks@gmail.com
|