sqlite3 1.6.3 → 2.10.2
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/CHANGELOG.md +615 -1
- data/CONTRIBUTING.md +103 -6
- data/{faq/faq.md → FAQ.md} +66 -79
- data/INSTALLATION.md +267 -0
- data/LICENSE +18 -22
- data/README.md +87 -124
- data/dependencies.yml +10 -11
- data/ext/sqlite3/aggregator.c +178 -178
- data/ext/sqlite3/aggregator.h +7 -4
- data/ext/sqlite3/backup.c +92 -65
- data/ext/sqlite3/backup.h +2 -2
- data/ext/sqlite3/database.c +964 -477
- data/ext/sqlite3/database.h +26 -4
- data/ext/sqlite3/exception.c +213 -94
- data/ext/sqlite3/exception.h +26 -1
- data/ext/sqlite3/extconf.rb +59 -29
- data/ext/sqlite3/sqlite3.c +190 -115
- data/ext/sqlite3/sqlite3_ruby.h +5 -2
- data/ext/sqlite3/statement.c +672 -297
- data/ext/sqlite3/statement.h +4 -3
- data/ext/sqlite3/timespec.h +29 -0
- data/lib/sqlite3/constants.rb +195 -47
- data/lib/sqlite3/database.rb +272 -225
- data/lib/sqlite3/errors.rb +54 -1
- data/lib/sqlite3/fork_safety.rb +66 -0
- data/lib/sqlite3/pragmas.rb +194 -141
- data/lib/sqlite3/resultset.rb +30 -111
- data/lib/sqlite3/statement.rb +105 -25
- data/lib/sqlite3/value.rb +17 -20
- data/lib/sqlite3/version.rb +2 -21
- data/lib/sqlite3/version_info.rb +17 -0
- data/lib/sqlite3.rb +8 -4
- data/ports/archives/sqlite-autoconf-3540100.tar.gz +0 -0
- metadata +16 -48
- data/API_CHANGES.md +0 -49
- data/ChangeLog.cvs +0 -88
- data/Gemfile +0 -11
- data/LICENSE-DEPENDENCIES +0 -20
- data/faq/faq.rb +0 -145
- data/faq/faq.yml +0 -426
- data/lib/sqlite3/translator.rb +0 -118
- data/ports/archives/sqlite-autoconf-3420000.tar.gz +0 -0
- 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 -569
- 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 -288
- data/test/test_statement_execute.rb +0 -39
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
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
source "https://rubygems.org"
|
|
2
|
-
|
|
3
|
-
gemspec
|
|
4
|
-
|
|
5
|
-
gem("minitest", "~> 5.15")
|
|
6
|
-
gem("rake-compiler", "~> 1.2.0")
|
|
7
|
-
gem("rake-compiler-dock", "1.3.0")
|
|
8
|
-
gem("rdoc", ">= 4.0", "< 7")
|
|
9
|
-
gem("psych", "~> 4.0") # psych 5 doesn't build on some CI platforms yet
|
|
10
|
-
|
|
11
|
-
gem("ruby_memcheck") if Gem::Platform.local.os == "linux"
|
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.
|
data/faq/faq.rb
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
require 'yaml'
|
|
2
|
-
require 'redcloth'
|
|
3
|
-
|
|
4
|
-
def process_faq_list( faqs )
|
|
5
|
-
puts "<ul>"
|
|
6
|
-
faqs.each do |faq|
|
|
7
|
-
process_faq_list_item faq
|
|
8
|
-
end
|
|
9
|
-
puts "</ul>"
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def process_faq_list_item( faq )
|
|
13
|
-
question = faq.keys.first
|
|
14
|
-
answer = faq.values.first
|
|
15
|
-
|
|
16
|
-
print "<li>"
|
|
17
|
-
|
|
18
|
-
question_text = RedCloth.new(question).to_html.gsub( %r{</?p>},"" )
|
|
19
|
-
if answer.is_a?( Array )
|
|
20
|
-
puts question_text
|
|
21
|
-
process_faq_list answer
|
|
22
|
-
else
|
|
23
|
-
print "<a href='##{question.object_id}'>#{question_text}</a>"
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
puts "</li>"
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def process_faq_descriptions( faqs, path=nil )
|
|
30
|
-
faqs.each do |faq|
|
|
31
|
-
process_faq_description faq, path
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def process_faq_description( faq, path )
|
|
36
|
-
question = faq.keys.first
|
|
37
|
-
path = ( path ? path + " " : "" ) + question
|
|
38
|
-
answer = faq.values.first
|
|
39
|
-
|
|
40
|
-
if answer.is_a?( Array )
|
|
41
|
-
process_faq_descriptions( answer, path )
|
|
42
|
-
else
|
|
43
|
-
title = RedCloth.new( path ).to_html.gsub( %r{</?p>}, "" )
|
|
44
|
-
answer = RedCloth.new( answer || "" )
|
|
45
|
-
|
|
46
|
-
puts "<a name='#{question.object_id}'></a>"
|
|
47
|
-
puts "<div class='faq-title'>#{title}</div>"
|
|
48
|
-
puts "<div class='faq-answer'>#{add_api_links(answer.to_html)}</div>"
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
API_OBJECTS = [ "Database", "Statement", "ResultSet",
|
|
53
|
-
"ParsedStatement", "Pragmas", "Translator" ].inject( "(" ) { |acc,name|
|
|
54
|
-
acc << "|" if acc.length > 1
|
|
55
|
-
acc << name
|
|
56
|
-
acc
|
|
57
|
-
} + ")"
|
|
58
|
-
|
|
59
|
-
def add_api_links( text )
|
|
60
|
-
text.gsub( /#{API_OBJECTS}(#(\w+))?/ ) do
|
|
61
|
-
disp_obj = obj = $1
|
|
62
|
-
|
|
63
|
-
case obj
|
|
64
|
-
when "Pragmas"; disp_obj = "Database"
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
method = $3
|
|
68
|
-
s = "<a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/#{obj}.html'>#{disp_obj}"
|
|
69
|
-
s << "##{method}" if method
|
|
70
|
-
s << "</a>"
|
|
71
|
-
s
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
faqs = YAML.load( File.read( "faq.yml" ) )
|
|
76
|
-
|
|
77
|
-
puts <<-EOF
|
|
78
|
-
<html>
|
|
79
|
-
<head>
|
|
80
|
-
<title>SQLite3/Ruby FAQ</title>
|
|
81
|
-
<style type="text/css">
|
|
82
|
-
a, a:visited, a:active {
|
|
83
|
-
color: #00F;
|
|
84
|
-
text-decoration: none;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
a:hover {
|
|
88
|
-
text-decoration: underline;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.faq-list {
|
|
92
|
-
color: #000;
|
|
93
|
-
font-family: vera-sans, verdana, arial, sans-serif;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.faq-title {
|
|
97
|
-
background: #007;
|
|
98
|
-
color: #FFF;
|
|
99
|
-
font-family: vera-sans, verdana, arial, sans-serif;
|
|
100
|
-
padding-left: 1em;
|
|
101
|
-
padding-top: 0.5em;
|
|
102
|
-
padding-bottom: 0.5em;
|
|
103
|
-
font-weight: bold;
|
|
104
|
-
font-size: large;
|
|
105
|
-
border: 1px solid #000;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.faq-answer {
|
|
109
|
-
margin-left: 1em;
|
|
110
|
-
color: #000;
|
|
111
|
-
font-family: vera-sans, verdana, arial, sans-serif;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.faq-answer pre {
|
|
115
|
-
margin-left: 1em;
|
|
116
|
-
color: #000;
|
|
117
|
-
background: #FFE;
|
|
118
|
-
font-size: normal;
|
|
119
|
-
border: 1px dotted #CCC;
|
|
120
|
-
padding: 1em;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
h1 {
|
|
124
|
-
background: #005;
|
|
125
|
-
color: #FFF;
|
|
126
|
-
font-family: vera-sans, verdana, arial, sans-serif;
|
|
127
|
-
padding-left: 1em;
|
|
128
|
-
padding-top: 1em;
|
|
129
|
-
padding-bottom: 1em;
|
|
130
|
-
font-weight: bold;
|
|
131
|
-
font-size: x-large;
|
|
132
|
-
border: 1px solid #00F;
|
|
133
|
-
}
|
|
134
|
-
</style>
|
|
135
|
-
</head>
|
|
136
|
-
<body>
|
|
137
|
-
<h1>SQLite/Ruby FAQ</h1>
|
|
138
|
-
<div class="faq-list">
|
|
139
|
-
EOF
|
|
140
|
-
|
|
141
|
-
process_faq_list( faqs )
|
|
142
|
-
puts "</div>"
|
|
143
|
-
process_faq_descriptions( faqs )
|
|
144
|
-
|
|
145
|
-
puts "</body></html>"
|