sqlite3-ruby 1.2.2-mswin32 → 1.2.3-mswin32
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.
Potentially problematic release.
This version of sqlite3-ruby might be problematic. Click here for more details.
- data/ext/sqlite3_api/sqlite3_api.i +8 -0
- data/ext/sqlite3_api/win32/build.bat +7 -7
- data/lib/sqlite3/resultset.rb +19 -7
- data/lib/sqlite3/version.rb +1 -1
- data/lib/sqlite3_api.dll +0 -0
- metadata +2 -6
- data/ext/sqlite3_api/sqlite3_api_wrap.dll +0 -0
- data/ext/sqlite3_api/sqlite3_api_wrap.exp +0 -0
- data/ext/sqlite3_api/sqlite3_api_wrap.lib +0 -0
- data/ext/sqlite3_api/sqlite3_api_wrap.obj +0 -0
@@ -4,6 +4,14 @@
|
|
4
4
|
#include <sqlite3.h>
|
5
5
|
#include "ruby.h"
|
6
6
|
|
7
|
+
#ifndef RSTRING_PTR
|
8
|
+
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
9
|
+
#endif
|
10
|
+
|
11
|
+
#ifndef RSTRING_LEN
|
12
|
+
#define RSTRING_LEN(s) (RSTRING(s)->len)
|
13
|
+
#endif
|
14
|
+
|
7
15
|
#define Init_API Init_sqlite3_api
|
8
16
|
|
9
17
|
struct CallbackData {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
REM This is not guaranteed to work, ever. It's just a little helper
|
2
|
-
REM script that I threw together to help me build the win32 version of
|
3
|
-
REM the library. If someone with more win32-fu than I wants to make
|
4
|
-
REM something more robust, please feel free! I'd love to include it.
|
5
|
-
REM -- Jamis Buck
|
6
|
-
|
7
|
-
cl /LD /Ie:\WinSDK\Include /Ic:\ruby\lib\ruby\1.8\i386-mswin32 /Ic:\ruby\sqlite3 /Ic:\ruby\src\ruby-1.8.4_2006-04-14 sqlite3_api_wrap.c /link /LIBPATH:c:\ruby\sqlite3 /LIBPATH:e:\WinSDK\Lib /LIBPATH:c:\ruby\lib sqlite3.lib msvcrt-ruby18.lib
|
1
|
+
REM This is not guaranteed to work, ever. It's just a little helper
|
2
|
+
REM script that I threw together to help me build the win32 version of
|
3
|
+
REM the library. If someone with more win32-fu than I wants to make
|
4
|
+
REM something more robust, please feel free! I'd love to include it.
|
5
|
+
REM -- Jamis Buck
|
6
|
+
|
7
|
+
cl /LD /Ie:\WinSDK\Include /Ic:\ruby\lib\ruby\1.8\i386-mswin32 /Ic:\ruby\sqlite3\src /Ic:\ruby\src\ruby-1.8.4_2006-04-14 sqlite3_api_wrap.c /link /LIBPATH:c:\ruby\sqlite3 /LIBPATH:e:\WinSDK\Lib /LIBPATH:c:\ruby\lib sqlite3.lib msvcrt-ruby18.lib
|
data/lib/sqlite3/resultset.rb
CHANGED
@@ -10,16 +10,25 @@ module SQLite3
|
|
10
10
|
class ResultSet
|
11
11
|
include Enumerable
|
12
12
|
|
13
|
-
#
|
14
|
-
|
13
|
+
# The class of which we return an object in case we want an Array as
|
14
|
+
# result. (ArrayFields is installed.)
|
15
|
+
class ArrayWithTypes < Array
|
15
16
|
attr_accessor :types
|
16
17
|
end
|
17
18
|
|
18
|
-
#
|
19
|
-
|
19
|
+
# The class of which we return an object in case we want an Array as
|
20
|
+
# result. (ArrayFields is not installed.)
|
21
|
+
class ArrayWithTypesAndFields < Array
|
22
|
+
attr_accessor :types
|
20
23
|
attr_accessor :fields
|
21
24
|
end
|
22
25
|
|
26
|
+
# The class of which we return an object in case we want a Hash as
|
27
|
+
# result.
|
28
|
+
class HashWithTypes < Hash
|
29
|
+
attr_accessor :types
|
30
|
+
end
|
31
|
+
|
23
32
|
# Create a new ResultSet attached to the given database, using the
|
24
33
|
# given sql text.
|
25
34
|
def initialize( db, stmt )
|
@@ -112,15 +121,18 @@ module SQLite3
|
|
112
121
|
end
|
113
122
|
|
114
123
|
if @db.results_as_hash
|
115
|
-
new_row =
|
124
|
+
new_row = HashWithTypes[ *( @stmt.columns.zip( row ).to_a.flatten ) ]
|
116
125
|
row.each_with_index { |value,idx| new_row[idx] = value }
|
117
126
|
row = new_row
|
118
127
|
else
|
119
|
-
|
128
|
+
if row.respond_to?(:fields)
|
129
|
+
row = ArrayWithTypes.new(row)
|
130
|
+
else
|
131
|
+
row = ArrayWithTypesAndFields.new(row)
|
132
|
+
end
|
120
133
|
row.fields = @stmt.columns
|
121
134
|
end
|
122
135
|
|
123
|
-
row.extend TypesContainer
|
124
136
|
row.types = @stmt.types
|
125
137
|
|
126
138
|
return row
|
data/lib/sqlite3/version.rb
CHANGED
data/lib/sqlite3_api.dll
CHANGED
Binary file
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: sqlite3-ruby
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.2.
|
7
|
-
date: 2008-
|
6
|
+
version: 1.2.3
|
7
|
+
date: 2008-08-26 00:00:00 -06:00
|
8
8
|
summary: SQLite3/Ruby is a module to allow Ruby scripts to interface with a SQLite database.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -37,10 +37,6 @@ files:
|
|
37
37
|
- ext/sqlite3_api/MANIFEST
|
38
38
|
- ext/sqlite3_api/sqlite3_api.i
|
39
39
|
- ext/sqlite3_api/sqlite3_api_wrap.c
|
40
|
-
- ext/sqlite3_api/sqlite3_api_wrap.dll
|
41
|
-
- ext/sqlite3_api/sqlite3_api_wrap.exp
|
42
|
-
- ext/sqlite3_api/sqlite3_api_wrap.lib
|
43
|
-
- ext/sqlite3_api/sqlite3_api_wrap.obj
|
44
40
|
- ext/sqlite3_api/win32
|
45
41
|
- ext/sqlite3_api/win32/build.bat
|
46
42
|
- lib/sqlite3
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|