You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/sqlite3/resultset.rb
+2-64Lines changed: 2 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -9,51 +9,6 @@ module SQLite3
9
9
classResultSet
10
10
includeEnumerable
11
11
12
-
classArrayWithTypesAndFields < Array# :nodoc:
13
-
attr_writer:types
14
-
attr_writer:fields
15
-
16
-
deftypes
17
-
warn(<<~EOWARN)if $VERBOSE
18
-
#{caller(1..1).first} is calling `#{self.class}#types` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `types` method on the SQLite3::ResultSet object that created this object.
19
-
EOWARN
20
-
@types
21
-
end
22
-
23
-
deffields
24
-
warn(<<~EOWARN)if $VERBOSE
25
-
#{caller(1..1).first} is calling `#{self.class}#fields` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `columns` method on the SQLite3::ResultSet object that created this object.
26
-
EOWARN
27
-
@fields
28
-
end
29
-
end
30
-
31
-
# The class of which we return an object in case we want a Hash as
32
-
# result.
33
-
classHashWithTypesAndFields < Hash# :nodoc:
34
-
attr_writer:types
35
-
attr_writer:fields
36
-
37
-
deftypes
38
-
warn(<<~EOWARN)if $VERBOSE
39
-
#{caller(1..1).first} is calling `#{self.class}#types` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `types` method on the SQLite3::ResultSet object that created this object.
40
-
EOWARN
41
-
@types
42
-
end
43
-
44
-
deffields
45
-
warn(<<~EOWARN)if $VERBOSE
46
-
#{caller(1..1).first} is calling `#{self.class}#fields` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `columns` method on the SQLite3::ResultSet object that created this object.
47
-
EOWARN
48
-
@fields
49
-
end
50
-
51
-
def [] key
52
-
key=fields[key]ifkey.is_a?Numeric
53
-
super(key)
54
-
end
55
-
end
56
-
57
12
# Create a new ResultSet attached to the given database, using the
58
13
# given sql text.
59
14
definitializedb,stmt
@@ -85,17 +40,7 @@ def eof?
85
40
# For hashes, the column names are the keys of the hash, and the column
86
41
# types are accessible via the +types+ property.
87
42
defnext
88
-
row=@stmt.step
89
-
returnnilif@stmt.done?
90
-
91
-
# FIXME: the `fields` and `types` methods are deprecated on this
92
-
# object for version 2.0, so we can safely remove this branch
93
-
# as well.
94
-
row=ArrayWithTypesAndFields.new(row)
95
-
96
-
row.fields=@stmt.columns
97
-
row.types=@stmt.types
98
-
row
43
+
@stmt.step
99
44
end
100
45
101
46
# Required by the Enumerable mixin. Provides an internal iterator over the
@@ -141,14 +86,7 @@ def next_hash
141
86
row=@stmt.step
142
87
returnnilif@stmt.done?
143
88
144
-
# FIXME: this can be switched to a regular hash in 2.0
0 commit comments