sqlite3 1.7.3-x86_64-darwin → 2.0.0-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +152 -0
- data/CONTRIBUTING.md +23 -1
- data/FAQ.md +0 -43
- data/INSTALLATION.md +13 -5
- data/LICENSE +18 -22
- data/README.md +75 -4
- data/dependencies.yml +10 -11
- data/ext/sqlite3/aggregator.c +142 -145
- data/ext/sqlite3/aggregator.h +2 -4
- data/ext/sqlite3/backup.c +74 -65
- data/ext/sqlite3/backup.h +2 -2
- data/ext/sqlite3/database.c +535 -482
- data/ext/sqlite3/database.h +7 -4
- data/ext/sqlite3/exception.c +111 -92
- data/ext/sqlite3/exception.h +3 -1
- data/ext/sqlite3/extconf.rb +21 -22
- data/ext/sqlite3/sqlite3.c +159 -115
- data/ext/sqlite3/sqlite3_ruby.h +2 -2
- data/ext/sqlite3/statement.c +516 -300
- data/ext/sqlite3/statement.h +3 -3
- data/ext/sqlite3/timespec.h +20 -0
- data/lib/sqlite3/3.0/sqlite3_native.bundle +0 -0
- data/lib/sqlite3/3.1/sqlite3_native.bundle +0 -0
- data/lib/sqlite3/3.2/sqlite3_native.bundle +0 -0
- data/lib/sqlite3/3.3/sqlite3_native.bundle +0 -0
- data/lib/sqlite3/constants.rb +171 -47
- data/lib/sqlite3/database.rb +105 -165
- data/lib/sqlite3/errors.rb +26 -1
- data/lib/sqlite3/pragmas.rb +126 -136
- data/lib/sqlite3/resultset.rb +14 -97
- data/lib/sqlite3/statement.rb +58 -13
- data/lib/sqlite3/value.rb +17 -20
- data/lib/sqlite3/version.rb +1 -21
- data/lib/sqlite3.rb +6 -4
- metadata +3 -28
- data/API_CHANGES.md +0 -49
- data/ChangeLog.cvs +0 -88
- data/Gemfile +0 -10
- data/LICENSE-DEPENDENCIES +0 -20
- data/lib/sqlite3/translator.rb +0 -117
- data/test/helper.rb +0 -27
- data/test/test_backup.rb +0 -33
- data/test/test_collation.rb +0 -82
- data/test/test_database.rb +0 -668
- data/test/test_database_flags.rb +0 -95
- data/test/test_database_readonly.rb +0 -36
- data/test/test_database_readwrite.rb +0 -41
- data/test/test_deprecated.rb +0 -49
- data/test/test_encoding.rb +0 -165
- data/test/test_integration.rb +0 -507
- data/test/test_integration_aggregate.rb +0 -336
- data/test/test_integration_open_close.rb +0 -30
- data/test/test_integration_pending.rb +0 -115
- data/test/test_integration_resultset.rb +0 -142
- data/test/test_integration_statement.rb +0 -194
- data/test/test_pragmas.rb +0 -22
- data/test/test_result_set.rb +0 -47
- data/test/test_sqlite3.rb +0 -30
- data/test/test_statement.rb +0 -290
- data/test/test_statement_execute.rb +0 -39
data/lib/sqlite3/resultset.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "sqlite3/constants"
|
2
|
+
require "sqlite3/errors"
|
3
3
|
|
4
4
|
module SQLite3
|
5
|
-
|
6
5
|
# The ResultSet object encapsulates the enumerability of a query's output.
|
7
6
|
# It is a simple cursor over the data that the query returns. It will
|
8
7
|
# very rarely (if ever) be instantiated directly. Instead, clients should
|
@@ -10,68 +9,18 @@ module SQLite3
|
|
10
9
|
class ResultSet
|
11
10
|
include Enumerable
|
12
11
|
|
13
|
-
class ArrayWithTypes < Array # :nodoc:
|
14
|
-
attr_accessor :types
|
15
|
-
end
|
16
|
-
|
17
|
-
class ArrayWithTypesAndFields < Array # :nodoc:
|
18
|
-
attr_writer :types
|
19
|
-
attr_writer :fields
|
20
|
-
|
21
|
-
def types
|
22
|
-
warn(<<-eowarn) if $VERBOSE
|
23
|
-
#{caller[0]} 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.
|
24
|
-
eowarn
|
25
|
-
@types
|
26
|
-
end
|
27
|
-
|
28
|
-
def fields
|
29
|
-
warn(<<-eowarn) if $VERBOSE
|
30
|
-
#{caller[0]} 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.
|
31
|
-
eowarn
|
32
|
-
@fields
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# The class of which we return an object in case we want a Hash as
|
37
|
-
# result.
|
38
|
-
class HashWithTypesAndFields < Hash # :nodoc:
|
39
|
-
attr_writer :types
|
40
|
-
attr_writer :fields
|
41
|
-
|
42
|
-
def types
|
43
|
-
warn(<<-eowarn) if $VERBOSE
|
44
|
-
#{caller[0]} 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.
|
45
|
-
eowarn
|
46
|
-
@types
|
47
|
-
end
|
48
|
-
|
49
|
-
def fields
|
50
|
-
warn(<<-eowarn) if $VERBOSE
|
51
|
-
#{caller[0]} 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.
|
52
|
-
eowarn
|
53
|
-
@fields
|
54
|
-
end
|
55
|
-
|
56
|
-
def [] key
|
57
|
-
key = fields[key] if key.is_a? Numeric
|
58
|
-
super key
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
12
|
# Create a new ResultSet attached to the given database, using the
|
63
13
|
# given sql text.
|
64
14
|
def initialize db, stmt
|
65
|
-
@db
|
15
|
+
@db = db
|
66
16
|
@stmt = stmt
|
67
17
|
end
|
68
18
|
|
69
19
|
# Reset the cursor, so that a result set which has reached end-of-file
|
70
20
|
# can be rewound and reiterated.
|
71
|
-
def reset(
|
21
|
+
def reset(*bind_params)
|
72
22
|
@stmt.reset!
|
73
|
-
@stmt.bind_params(
|
74
|
-
@eof = false
|
23
|
+
@stmt.bind_params(*bind_params)
|
75
24
|
end
|
76
25
|
|
77
26
|
# Query whether the cursor has reached the end of the result set or not.
|
@@ -80,9 +29,7 @@ module SQLite3
|
|
80
29
|
end
|
81
30
|
|
82
31
|
# Obtain the next row from the cursor. If there are no more rows to be
|
83
|
-
# had, this will return +nil+.
|
84
|
-
# corresponding database, the values in the row will be translated
|
85
|
-
# according to their types.
|
32
|
+
# had, this will return +nil+.
|
86
33
|
#
|
87
34
|
# The returned value will be an array, unless Database#results_as_hash has
|
88
35
|
# been set to +true+, in which case the returned value will be a hash.
|
@@ -93,36 +40,13 @@ module SQLite3
|
|
93
40
|
# For hashes, the column names are the keys of the hash, and the column
|
94
41
|
# types are accessible via the +types+ property.
|
95
42
|
def next
|
96
|
-
|
97
|
-
return next_hash
|
98
|
-
end
|
99
|
-
|
100
|
-
row = @stmt.step
|
101
|
-
return nil if @stmt.done?
|
102
|
-
|
103
|
-
row = @db.translate_from_db @stmt.types, row
|
104
|
-
|
105
|
-
if row.respond_to?(:fields)
|
106
|
-
# FIXME: this can only happen if the translator returns something
|
107
|
-
# that responds to `fields`. Since we're removing the translator
|
108
|
-
# in 2.0, we can remove this branch in 2.0.
|
109
|
-
row = ArrayWithTypes.new(row)
|
110
|
-
else
|
111
|
-
# FIXME: the `fields` and `types` methods are deprecated on this
|
112
|
-
# object for version 2.0, so we can safely remove this branch
|
113
|
-
# as well.
|
114
|
-
row = ArrayWithTypesAndFields.new(row)
|
115
|
-
end
|
116
|
-
|
117
|
-
row.fields = @stmt.columns
|
118
|
-
row.types = @stmt.types
|
119
|
-
row
|
43
|
+
@stmt.step
|
120
44
|
end
|
121
45
|
|
122
46
|
# Required by the Enumerable mixin. Provides an internal iterator over the
|
123
47
|
# rows of the result set.
|
124
48
|
def each
|
125
|
-
while node = self.next
|
49
|
+
while (node = self.next)
|
126
50
|
yield node
|
127
51
|
end
|
128
52
|
end
|
@@ -130,7 +54,7 @@ module SQLite3
|
|
130
54
|
# Provides an internal iterator over the rows of the result set where
|
131
55
|
# each row is yielded as a hash.
|
132
56
|
def each_hash
|
133
|
-
while node = next_hash
|
57
|
+
while (node = next_hash)
|
134
58
|
yield node
|
135
59
|
end
|
136
60
|
end
|
@@ -162,18 +86,11 @@ module SQLite3
|
|
162
86
|
row = @stmt.step
|
163
87
|
return nil if @stmt.done?
|
164
88
|
|
165
|
-
|
166
|
-
# in 2.0
|
167
|
-
row = @db.translate_from_db @stmt.types, row
|
168
|
-
|
169
|
-
# FIXME: this can be switched to a regular hash in 2.0
|
170
|
-
row = HashWithTypesAndFields[*@stmt.columns.zip(row).flatten]
|
171
|
-
|
172
|
-
# FIXME: these methods are deprecated for version 2.0, so we can remove
|
173
|
-
# this code in 2.0
|
174
|
-
row.fields = @stmt.columns
|
175
|
-
row.types = @stmt.types
|
176
|
-
row
|
89
|
+
@stmt.columns.zip(row).to_h
|
177
90
|
end
|
178
91
|
end
|
92
|
+
|
93
|
+
class HashResultSet < ResultSet # :nodoc:
|
94
|
+
alias_method :next, :next_hash
|
95
|
+
end
|
179
96
|
end
|
data/lib/sqlite3/statement.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "sqlite3/errors"
|
2
|
+
require "sqlite3/resultset"
|
3
3
|
|
4
4
|
class String
|
5
5
|
def to_blob
|
6
|
-
SQLite3::Blob.new(
|
6
|
+
SQLite3::Blob.new(self)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -19,6 +19,23 @@ module SQLite3
|
|
19
19
|
# this will be the empty string.
|
20
20
|
attr_reader :remainder
|
21
21
|
|
22
|
+
# call-seq: SQLite3::Statement.new(db, sql)
|
23
|
+
#
|
24
|
+
# Create a new statement attached to the given Database instance, and which
|
25
|
+
# encapsulates the given SQL text. If the text contains more than one
|
26
|
+
# statement (i.e., separated by semicolons), then the #remainder property
|
27
|
+
# will be set to the trailing text.
|
28
|
+
def initialize(db, sql)
|
29
|
+
raise ArgumentError, "prepare called on a closed database" if db.closed?
|
30
|
+
|
31
|
+
sql = sql.encode(Encoding::UTF_8) if sql && sql.encoding != Encoding::UTF_8
|
32
|
+
|
33
|
+
@connection = db
|
34
|
+
@columns = nil
|
35
|
+
@types = nil
|
36
|
+
@remainder = prepare db, sql
|
37
|
+
end
|
38
|
+
|
22
39
|
# Binds the given variables to the corresponding placeholders in the SQL
|
23
40
|
# text.
|
24
41
|
#
|
@@ -32,7 +49,7 @@ module SQLite3
|
|
32
49
|
#
|
33
50
|
# See also #execute, #bind_param, Statement#bind_param, and
|
34
51
|
# Statement#bind_params.
|
35
|
-
def bind_params(
|
52
|
+
def bind_params(*bind_vars)
|
36
53
|
index = 1
|
37
54
|
bind_vars.flatten.each do |var|
|
38
55
|
if Hash === var
|
@@ -58,16 +75,16 @@ module SQLite3
|
|
58
75
|
# end
|
59
76
|
#
|
60
77
|
# See also #bind_params, #execute!.
|
61
|
-
def execute(
|
78
|
+
def execute(*bind_vars)
|
62
79
|
reset! if active? || done?
|
63
80
|
|
64
81
|
bind_params(*bind_vars) unless bind_vars.empty?
|
65
|
-
|
82
|
+
results = @connection.build_result_set self
|
66
83
|
|
67
|
-
step if
|
84
|
+
step if column_count == 0
|
68
85
|
|
69
|
-
yield
|
70
|
-
|
86
|
+
yield results if block_given?
|
87
|
+
results
|
71
88
|
end
|
72
89
|
|
73
90
|
# Execute the statement. If no block was given, this returns an array of
|
@@ -84,9 +101,9 @@ module SQLite3
|
|
84
101
|
# end
|
85
102
|
#
|
86
103
|
# See also #bind_params, #execute.
|
87
|
-
def execute!(
|
104
|
+
def execute!(*bind_vars, &block)
|
88
105
|
execute(*bind_vars)
|
89
|
-
|
106
|
+
block ? each(&block) : to_a
|
90
107
|
end
|
91
108
|
|
92
109
|
# Returns true if the statement is currently active, meaning it has an
|
@@ -100,7 +117,7 @@ module SQLite3
|
|
100
117
|
# a (potentially) expensive operation.
|
101
118
|
def columns
|
102
119
|
get_metadata unless @columns
|
103
|
-
|
120
|
+
@columns
|
104
121
|
end
|
105
122
|
|
106
123
|
def each
|
@@ -128,7 +145,35 @@ module SQLite3
|
|
128
145
|
end
|
129
146
|
end
|
130
147
|
|
148
|
+
# Returns a Hash containing information about the statement.
|
149
|
+
# The contents of the hash are implementation specific and may change in
|
150
|
+
# the future without notice. The hash includes information about internal
|
151
|
+
# statistics about the statement such as:
|
152
|
+
# - +fullscan_steps+: the number of times that SQLite has stepped forward
|
153
|
+
# in a table as part of a full table scan
|
154
|
+
# - +sorts+: the number of sort operations that have occurred
|
155
|
+
# - +autoindexes+: the number of rows inserted into transient indices
|
156
|
+
# that were created automatically in order to help joins run faster
|
157
|
+
# - +vm_steps+: the number of virtual machine operations executed by the
|
158
|
+
# prepared statement
|
159
|
+
# - +reprepares+: the number of times that the prepare statement has been
|
160
|
+
# automatically regenerated due to schema changes or changes to bound
|
161
|
+
# parameters that might affect the query plan
|
162
|
+
# - +runs+: the number of times that the prepared statement has been run
|
163
|
+
# - +filter_misses+: the number of times that the Bloom filter returned
|
164
|
+
# a find, and thus the join step had to be processed as normal
|
165
|
+
# - +filter_hits+: the number of times that a join step was bypassed
|
166
|
+
# because a Bloom filter returned not-found
|
167
|
+
def stat key = nil
|
168
|
+
if key
|
169
|
+
stat_for(key)
|
170
|
+
else
|
171
|
+
stats_as_hash
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
131
175
|
private
|
176
|
+
|
132
177
|
# A convenience method for obtaining the metadata about the query. Note
|
133
178
|
# that this will actually execute the SQL, which means it can be a
|
134
179
|
# (potentially) expensive operation.
|
@@ -138,7 +183,7 @@ module SQLite3
|
|
138
183
|
end
|
139
184
|
@types = Array.new(column_count) do |column|
|
140
185
|
val = column_decltype(column)
|
141
|
-
val
|
186
|
+
val&.downcase
|
142
187
|
end
|
143
188
|
end
|
144
189
|
end
|
data/lib/sqlite3/value.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require "sqlite3/constants"
|
2
2
|
|
3
3
|
module SQLite3
|
4
|
-
|
5
4
|
class Value
|
6
5
|
attr_reader :handle
|
7
6
|
|
8
|
-
def initialize(
|
7
|
+
def initialize(db, handle)
|
9
8
|
@driver = db.driver
|
10
9
|
@handle = handle
|
11
10
|
end
|
@@ -15,43 +14,41 @@ module SQLite3
|
|
15
14
|
end
|
16
15
|
|
17
16
|
def to_blob
|
18
|
-
@driver.value_blob(
|
17
|
+
@driver.value_blob(@handle)
|
19
18
|
end
|
20
19
|
|
21
|
-
def length(
|
20
|
+
def length(utf16 = false)
|
22
21
|
if utf16
|
23
|
-
@driver.value_bytes16(
|
22
|
+
@driver.value_bytes16(@handle)
|
24
23
|
else
|
25
|
-
@driver.value_bytes(
|
24
|
+
@driver.value_bytes(@handle)
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
29
28
|
def to_f
|
30
|
-
@driver.value_double(
|
29
|
+
@driver.value_double(@handle)
|
31
30
|
end
|
32
31
|
|
33
32
|
def to_i
|
34
|
-
@driver.value_int(
|
33
|
+
@driver.value_int(@handle)
|
35
34
|
end
|
36
35
|
|
37
36
|
def to_int64
|
38
|
-
@driver.value_int64(
|
37
|
+
@driver.value_int64(@handle)
|
39
38
|
end
|
40
39
|
|
41
|
-
def to_s(
|
42
|
-
@driver.value_text(
|
40
|
+
def to_s(utf16 = false)
|
41
|
+
@driver.value_text(@handle, utf16)
|
43
42
|
end
|
44
43
|
|
45
44
|
def type
|
46
|
-
case @driver.value_type(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
case @driver.value_type(@handle)
|
46
|
+
when Constants::ColumnType::INTEGER then :int
|
47
|
+
when Constants::ColumnType::FLOAT then :float
|
48
|
+
when Constants::ColumnType::TEXT then :text
|
49
|
+
when Constants::ColumnType::BLOB then :blob
|
50
|
+
when Constants::ColumnType::NULL then :null
|
52
51
|
end
|
53
52
|
end
|
54
|
-
|
55
53
|
end
|
56
|
-
|
57
54
|
end
|
data/lib/sqlite3/version.rb
CHANGED
@@ -1,23 +1,3 @@
|
|
1
1
|
module SQLite3
|
2
|
-
|
3
|
-
VERSION = "1.7.3"
|
4
|
-
|
5
|
-
module VersionProxy
|
6
|
-
MAJOR = 1
|
7
|
-
MINOR = 7
|
8
|
-
TINY = 3
|
9
|
-
BUILD = nil
|
10
|
-
|
11
|
-
STRING = [ MAJOR, MINOR, TINY, BUILD ].compact.join( "." )
|
12
|
-
|
13
|
-
VERSION = ::SQLite3::VERSION
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.const_missing(name)
|
17
|
-
return super unless name == :Version
|
18
|
-
warn(<<-eowarn) if $VERBOSE
|
19
|
-
#{caller[0]}: `SQLite::Version` will be removed in sqlite3-ruby version 2.0.0
|
20
|
-
eowarn
|
21
|
-
VersionProxy
|
22
|
-
end
|
2
|
+
VERSION = "2.0.0"
|
23
3
|
end
|
data/lib/sqlite3.rb
CHANGED
@@ -3,13 +3,15 @@ begin
|
|
3
3
|
RUBY_VERSION =~ /(\d+\.\d+)/
|
4
4
|
require "sqlite3/#{$1}/sqlite3_native"
|
5
5
|
rescue LoadError
|
6
|
-
require
|
6
|
+
require "sqlite3/sqlite3_native"
|
7
7
|
end
|
8
8
|
|
9
|
-
require
|
10
|
-
require
|
9
|
+
require "sqlite3/database"
|
10
|
+
require "sqlite3/version"
|
11
11
|
|
12
12
|
module SQLite3
|
13
13
|
# Was sqlite3 compiled with thread safety on?
|
14
|
-
def self.threadsafe
|
14
|
+
def self.threadsafe?
|
15
|
+
threadsafe > 0
|
16
|
+
end
|
15
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlite3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |
|
17
17
|
Ruby library to interface with the SQLite3 database engine (http://www.sqlite.org). Precompiled
|
@@ -20,7 +20,6 @@ email:
|
|
20
20
|
executables: []
|
21
21
|
extensions: []
|
22
22
|
extra_rdoc_files:
|
23
|
-
- API_CHANGES.md
|
24
23
|
- CHANGELOG.md
|
25
24
|
- README.md
|
26
25
|
- ext/sqlite3/aggregator.c
|
@@ -31,15 +30,11 @@ extra_rdoc_files:
|
|
31
30
|
- ext/sqlite3/statement.c
|
32
31
|
files:
|
33
32
|
- ".gemtest"
|
34
|
-
- API_CHANGES.md
|
35
33
|
- CHANGELOG.md
|
36
34
|
- CONTRIBUTING.md
|
37
|
-
- ChangeLog.cvs
|
38
35
|
- FAQ.md
|
39
|
-
- Gemfile
|
40
36
|
- INSTALLATION.md
|
41
37
|
- LICENSE
|
42
|
-
- LICENSE-DEPENDENCIES
|
43
38
|
- README.md
|
44
39
|
- dependencies.yml
|
45
40
|
- ext/sqlite3/aggregator.c
|
@@ -55,6 +50,7 @@ files:
|
|
55
50
|
- ext/sqlite3/sqlite3_ruby.h
|
56
51
|
- ext/sqlite3/statement.c
|
57
52
|
- ext/sqlite3/statement.h
|
53
|
+
- ext/sqlite3/timespec.h
|
58
54
|
- lib/sqlite3.rb
|
59
55
|
- lib/sqlite3/3.0/sqlite3_native.bundle
|
60
56
|
- lib/sqlite3/3.1/sqlite3_native.bundle
|
@@ -66,29 +62,8 @@ files:
|
|
66
62
|
- lib/sqlite3/pragmas.rb
|
67
63
|
- lib/sqlite3/resultset.rb
|
68
64
|
- lib/sqlite3/statement.rb
|
69
|
-
- lib/sqlite3/translator.rb
|
70
65
|
- lib/sqlite3/value.rb
|
71
66
|
- lib/sqlite3/version.rb
|
72
|
-
- test/helper.rb
|
73
|
-
- test/test_backup.rb
|
74
|
-
- test/test_collation.rb
|
75
|
-
- test/test_database.rb
|
76
|
-
- test/test_database_flags.rb
|
77
|
-
- test/test_database_readonly.rb
|
78
|
-
- test/test_database_readwrite.rb
|
79
|
-
- test/test_deprecated.rb
|
80
|
-
- test/test_encoding.rb
|
81
|
-
- test/test_integration.rb
|
82
|
-
- test/test_integration_aggregate.rb
|
83
|
-
- test/test_integration_open_close.rb
|
84
|
-
- test/test_integration_pending.rb
|
85
|
-
- test/test_integration_resultset.rb
|
86
|
-
- test/test_integration_statement.rb
|
87
|
-
- test/test_pragmas.rb
|
88
|
-
- test/test_result_set.rb
|
89
|
-
- test/test_sqlite3.rb
|
90
|
-
- test/test_statement.rb
|
91
|
-
- test/test_statement_execute.rb
|
92
67
|
homepage: https://github.com/sparklemotion/sqlite3-ruby
|
93
68
|
licenses:
|
94
69
|
- BSD-3-Clause
|
data/API_CHANGES.md
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
# API Changes
|
2
|
-
|
3
|
-
* SQLite3::Database#execute only accepts an array for bind parameters.
|
4
|
-
|
5
|
-
* SQLite3::ResultSet used to query the database for the first row, regardless
|
6
|
-
of whether the user asked for it or not. I have removed that so that rows
|
7
|
-
will not be returned until the user asks for them. This is a subtle but
|
8
|
-
sometimes important change in behavior.
|
9
|
-
|
10
|
-
83882d2208ed189361617d5ab8532a325aaf729d
|
11
|
-
|
12
|
-
* SQLite3::Database#trace now takes either a block or an object that responds
|
13
|
-
to "call". The previous implementation passed around a VALUE that was cast
|
14
|
-
to a void *. This is dangerous because the value could get garbage collected
|
15
|
-
before the proc was called. If the user wants data passed around with the
|
16
|
-
block, they should use variables available to the closure or create an
|
17
|
-
object.
|
18
|
-
|
19
|
-
* SQLite3::Statement#step automatically converts to ruby types, where before
|
20
|
-
all values were automatically yielded as strings. This will only be a
|
21
|
-
problem for people who were accessing information about the database that
|
22
|
-
wasn't previously passed through the pure ruby conversion code.
|
23
|
-
|
24
|
-
* SQLite3::Database#errmsg no longer takes a parameter to return error
|
25
|
-
messages as UTF-16. Do people even use that? I opt for staying UTF-8 when
|
26
|
-
possible. See test_integration.rb test_errmsg_utf16
|
27
|
-
|
28
|
-
* SQLite3::Database#authorize same changes as trace
|
29
|
-
|
30
|
-
* test/test_tc_database.rb was removed because we no longer use the Driver
|
31
|
-
design pattern.
|
32
|
-
|
33
|
-
# Garbage Collection Strategy
|
34
|
-
|
35
|
-
All statements keep pointers back to their respective database connections.
|
36
|
-
The @connection instance variable on the Statement handle keeps the database
|
37
|
-
connection alive. Memory allocated for a statement handler will be freed in
|
38
|
-
two cases:
|
39
|
-
|
40
|
-
* close is called on the statement
|
41
|
-
* The SQLite3::Database object gets garbage collected
|
42
|
-
|
43
|
-
We can't free the memory for the statement in the garbage collection function
|
44
|
-
for the statement handler. The reason is because there exists a race
|
45
|
-
condition. We cannot guarantee the order in which objects will be garbage
|
46
|
-
collected. So, it is possible that a connection and a statement are up for
|
47
|
-
garbage collection. If the database connection were to be free'd before the
|
48
|
-
statement, then boom. Instead we'll be conservative and free unclosed
|
49
|
-
statements when the connection is terminated.
|
data/ChangeLog.cvs
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
2005-01-05 09:40 minam
|
2
|
-
|
3
|
-
* Rakefile, sqlite3-ruby-win32.gemspec, sqlite3-ruby.gemspec: Added
|
4
|
-
win32 gem.
|
5
|
-
|
6
|
-
2005-01-05 07:31 minam
|
7
|
-
|
8
|
-
* Rakefile, test/tc_integration.rb, test/tests.rb: Added
|
9
|
-
native-vs-dl benchmark to Rakefile. Added SQLITE3_DRIVERS
|
10
|
-
environment variable to integration test to specify which
|
11
|
-
driver(s) should be tested (defaults to "Native").
|
12
|
-
|
13
|
-
2005-01-04 14:26 minam
|
14
|
-
|
15
|
-
* ext/sqlite3_api/sqlite3_api.i, lib/sqlite3/database.rb,
|
16
|
-
lib/sqlite3/driver/native/driver.rb, test/tc_database.rb,
|
17
|
-
test/tc_integration.rb, test/tests.rb: Unit tests: done. Bugs:
|
18
|
-
fixed.
|
19
|
-
|
20
|
-
2005-01-03 23:13 minam
|
21
|
-
|
22
|
-
* ext/sqlite3_api/sqlite3_api.i, lib/sqlite3/database.rb,
|
23
|
-
lib/sqlite3/driver/dl/driver.rb,
|
24
|
-
lib/sqlite3/driver/native/driver.rb, test/tc_integration.rb:
|
25
|
-
Custom functions (aggregate and otherwise) are supported by the
|
26
|
-
native driver now. Test cases for the same.
|
27
|
-
|
28
|
-
2005-01-03 13:51 minam
|
29
|
-
|
30
|
-
* ext/sqlite3_api/MANIFEST, ext/sqlite3_api/extconf.rb,
|
31
|
-
ext/sqlite3_api/post-clean.rb, ext/sqlite3_api/post-distclean.rb,
|
32
|
-
ext/sqlite3_api/sqlite3_api.i, lib/sqlite3/database.rb,
|
33
|
-
lib/sqlite3/resultset.rb, lib/sqlite3/version.rb,
|
34
|
-
lib/sqlite3/driver/dl/driver.rb,
|
35
|
-
lib/sqlite3/driver/native/driver.rb, test/native-vs-dl.rb,
|
36
|
-
test/tc_integration.rb: Added preliminary implementation of
|
37
|
-
native driver (swig-based), and integration tests.
|
38
|
-
|
39
|
-
2004-12-29 19:37 minam
|
40
|
-
|
41
|
-
* lib/sqlite3/driver/dl/driver.rb: Some fixes to allow the DL
|
42
|
-
driver to work with Ruby 1.8.1.
|
43
|
-
|
44
|
-
2004-12-29 14:52 minam
|
45
|
-
|
46
|
-
* lib/sqlite3/: database.rb, version.rb: Made #quote a class method
|
47
|
-
(again). Bumped version to 0.6.
|
48
|
-
|
49
|
-
2004-12-25 22:59 minam
|
50
|
-
|
51
|
-
* lib/sqlite3/driver/dl/api.rb: Added check for darwin in supported
|
52
|
-
platforms (thanks to bitsweat).
|
53
|
-
|
54
|
-
2004-12-22 12:38 minam
|
55
|
-
|
56
|
-
* Rakefile: Rakefile wasn't packaging the README file.
|
57
|
-
|
58
|
-
2004-12-21 22:28 minam
|
59
|
-
|
60
|
-
* Rakefile, sqlite3-ruby.gemspec, test/bm.rb: Packaging now works.
|
61
|
-
Added benchmarks.
|
62
|
-
|
63
|
-
2004-12-21 21:45 minam
|
64
|
-
|
65
|
-
* LICENSE, README, Rakefile, setup.rb, sqlite3-ruby.gemspec,
|
66
|
-
doc/faq/faq.rb, doc/faq/faq.yml, lib/sqlite3.rb,
|
67
|
-
lib/sqlite3/statement.rb, lib/sqlite3/constants.rb,
|
68
|
-
lib/sqlite3/database.rb, lib/sqlite3/resultset.rb,
|
69
|
-
lib/sqlite3/translator.rb, lib/sqlite3/value.rb,
|
70
|
-
lib/sqlite3/version.rb, lib/sqlite3/errors.rb,
|
71
|
-
lib/sqlite3/pragmas.rb, lib/sqlite3/driver/dl/api.rb,
|
72
|
-
lib/sqlite3/driver/dl/driver.rb, test/mocks.rb,
|
73
|
-
test/tc_database.rb, test/tests.rb, test/driver/dl/tc_driver.rb:
|
74
|
-
Initial import
|
75
|
-
|
76
|
-
2004-12-21 21:45 minam
|
77
|
-
|
78
|
-
* LICENSE, README, Rakefile, setup.rb, sqlite3-ruby.gemspec,
|
79
|
-
doc/faq/faq.rb, doc/faq/faq.yml, lib/sqlite3.rb,
|
80
|
-
lib/sqlite3/statement.rb, lib/sqlite3/constants.rb,
|
81
|
-
lib/sqlite3/database.rb, lib/sqlite3/resultset.rb,
|
82
|
-
lib/sqlite3/translator.rb, lib/sqlite3/value.rb,
|
83
|
-
lib/sqlite3/version.rb, lib/sqlite3/errors.rb,
|
84
|
-
lib/sqlite3/pragmas.rb, lib/sqlite3/driver/dl/api.rb,
|
85
|
-
lib/sqlite3/driver/dl/driver.rb, test/mocks.rb,
|
86
|
-
test/tc_database.rb, test/tests.rb, test/driver/dl/tc_driver.rb:
|
87
|
-
Initial revision
|
88
|
-
|
data/Gemfile
DELETED
data/LICENSE-DEPENDENCIES
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# Vendored Dependency Licenses
|
2
|
-
|
3
|
-
The library `sqlite3-ruby` (which lives at https://github.com/sparklemotion/sqlite3-ruby) may include the source code for `sqlite` (which lives at https://www.sqlite.org/)
|
4
|
-
|
5
|
-
`sqlite` source code is licensed under the public domain:
|
6
|
-
|
7
|
-
> https://www.sqlite.org/copyright.html
|
8
|
-
|
9
|
-
The license terms shipped with `sqlite` are included here for your convenience:
|
10
|
-
|
11
|
-
```
|
12
|
-
The author disclaims copyright to this source code. In place of
|
13
|
-
a legal notice, here is a blessing:
|
14
|
-
|
15
|
-
May you do good and not evil.
|
16
|
-
May you find forgiveness for yourself and forgive others.
|
17
|
-
May you share freely, never taking more than you give.
|
18
|
-
```
|
19
|
-
|
20
|
-
Note that these license terms do not apply to the `sqlite3-ruby` library itself.
|