sqlite3-ruby 1.2.5-x86-mingw32 → 1.3.0.beta.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/API_CHANGES.rdoc +48 -0
- data/{History.txt → CHANGELOG.rdoc} +24 -0
- data/Manifest.txt +14 -14
- data/{README.txt → README.rdoc} +1 -6
- data/Rakefile +8 -3
- data/ext/sqlite3/database.c +687 -0
- data/ext/sqlite3/database.h +15 -0
- data/ext/sqlite3/exception.c +94 -0
- data/ext/sqlite3/exception.h +8 -0
- data/ext/sqlite3/extconf.rb +26 -0
- data/ext/sqlite3/sqlite3.c +33 -0
- data/ext/sqlite3/sqlite3_ruby.h +43 -0
- data/ext/sqlite3/statement.c +412 -0
- data/ext/sqlite3/statement.h +16 -0
- data/lib/sqlite3/1.8/sqlite3_native.so +0 -0
- data/lib/sqlite3/1.9/sqlite3_native.so +0 -0
- data/lib/sqlite3/database.rb +94 -302
- data/lib/sqlite3/errors.rb +0 -24
- data/lib/sqlite3/pragmas.rb +16 -7
- data/lib/sqlite3/resultset.rb +25 -81
- data/lib/sqlite3/statement.rb +22 -107
- data/lib/sqlite3/version.rb +4 -4
- data/lib/sqlite3.rb +9 -0
- data/setup.rb +2 -2
- data/tasks/native.rake +13 -17
- data/tasks/vendor_sqlite3.rake +10 -7
- data/test/helper.rb +1 -65
- data/test/test_database.rb +239 -189
- data/test/test_encoding.rb +115 -0
- data/test/test_integration.rb +38 -35
- data/test/test_integration_open_close.rb +1 -1
- data/test/test_integration_pending.rb +6 -4
- data/test/test_integration_resultset.rb +20 -8
- data/test/test_integration_statement.rb +1 -2
- data/test/test_sqlite3.rb +9 -0
- data/test/test_statement.rb +193 -0
- metadata +84 -49
- data/ext/sqlite3_api/extconf.rb +0 -10
- data/ext/sqlite3_api/sqlite3_api.i +0 -362
- data/ext/sqlite3_api/sqlite3_api_wrap.c +0 -5018
- data/lib/1.8/sqlite3_api.so +0 -0
- data/lib/1.9/sqlite3_api.so +0 -0
- data/lib/sqlite3/driver/dl/api.rb +0 -152
- data/lib/sqlite3/driver/dl/driver.rb +0 -307
- data/lib/sqlite3/driver/native/driver.rb +0 -219
- data/tasks/benchmark.rake +0 -9
- data/tasks/gem.rake +0 -32
- data/test/bm.rb +0 -140
- data/test/driver/dl/tc_driver.rb +0 -292
- data/test/native-vs-dl.rb +0 -126
- data/test/test_errors.rb +0 -17
data/test/native-vs-dl.rb
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
$:.unshift "../lib", "../ext/sqlite3_api"
|
2
|
-
|
3
|
-
require 'sqlite3'
|
4
|
-
|
5
|
-
require 'benchmark'
|
6
|
-
|
7
|
-
N = 1000
|
8
|
-
|
9
|
-
$VERBOSE=nil
|
10
|
-
|
11
|
-
puts "database creation..."
|
12
|
-
Benchmark.bm( 7 ) do |x|
|
13
|
-
x.report('dl') do
|
14
|
-
N.times do
|
15
|
-
File.delete "test.db" rescue nil
|
16
|
-
SQLite3::Database.open( "test.db", :driver => "DL" ).close
|
17
|
-
end
|
18
|
-
end
|
19
|
-
x.report('native') do
|
20
|
-
N.times do
|
21
|
-
File.delete "test.db" rescue nil
|
22
|
-
SQLite3::Database.open( "test.db", :driver => "Native" ).close
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
File.delete "test.db" rescue nil
|
27
|
-
|
28
|
-
SQLite3::Database.open( "test.db" ).close
|
29
|
-
|
30
|
-
puts
|
31
|
-
puts "database open..."
|
32
|
-
Benchmark.bm( 7 ) do |x|
|
33
|
-
x.report('dl') do
|
34
|
-
N.times do
|
35
|
-
SQLite3::Database.open( "test.db", :driver => "DL" ).close
|
36
|
-
end
|
37
|
-
end
|
38
|
-
x.report('native') do
|
39
|
-
N.times do
|
40
|
-
SQLite3::Database.open( "test.db", :driver => "Native" ).close
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
File.delete "test.db" rescue nil
|
45
|
-
|
46
|
-
dl = SQLite3::Database.open( "test-dl.db", :driver => "DL" )
|
47
|
-
native = SQLite3::Database.open( "test-native.db", :driver => "Native" )
|
48
|
-
|
49
|
-
dl.execute "create table foo (a,b)"
|
50
|
-
native.execute "create table foo (a,b)"
|
51
|
-
|
52
|
-
puts
|
53
|
-
puts "insertions"
|
54
|
-
Benchmark.bm( 7 ) do |x|
|
55
|
-
x.report('dl') do
|
56
|
-
dl.transaction do
|
57
|
-
N.times do |i|
|
58
|
-
dl.execute "insert into foo values (#{i}, #{i+1})"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
x.report('native') do
|
63
|
-
native.transaction do
|
64
|
-
N.times do |i|
|
65
|
-
native.execute "insert into foo values (#{i}, #{i+1})"
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
puts
|
72
|
-
puts "insertions using prepared statement"
|
73
|
-
Benchmark.bm( 7 ) do |x|
|
74
|
-
x.report('dl') do
|
75
|
-
dl.transaction do
|
76
|
-
dl.prepare "insert into foo values (?,?)" do |stmt|
|
77
|
-
N.times { |i| stmt.execute i, i+1 }
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
x.report('native') do
|
82
|
-
native.transaction do
|
83
|
-
native.prepare( "insert into foo values (?,?)" ) do |stmt|
|
84
|
-
N.times { |i| stmt.execute i, i+1 }
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
dl.close
|
91
|
-
native.close
|
92
|
-
File.delete "test-dl.db" rescue nil
|
93
|
-
File.delete "test-native.db" rescue nil
|
94
|
-
|
95
|
-
dl = SQLite3::Database.open( "test-dl.db", :driver => "DL" )
|
96
|
-
native = SQLite3::Database.open( "test-native.db", :driver => "Native" )
|
97
|
-
|
98
|
-
dl.execute "create table foo (a,b)"
|
99
|
-
dl.execute "insert into foo values (1,2)"
|
100
|
-
dl.execute "insert into foo values (3,4)"
|
101
|
-
dl.execute "insert into foo values (5,6)"
|
102
|
-
|
103
|
-
native.execute "create table foo (a,b)"
|
104
|
-
native.execute "insert into foo values (1,2)"
|
105
|
-
native.execute "insert into foo values (3,4)"
|
106
|
-
native.execute "insert into foo values (5,6)"
|
107
|
-
|
108
|
-
puts
|
109
|
-
puts "queries"
|
110
|
-
Benchmark.bm( 7 ) do |x|
|
111
|
-
x.report('dl') do
|
112
|
-
N.times do
|
113
|
-
dl.execute "select * from foo"
|
114
|
-
end
|
115
|
-
end
|
116
|
-
x.report('native') do
|
117
|
-
N.times do
|
118
|
-
native.execute "select * from foo"
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
dl.close
|
124
|
-
native.close
|
125
|
-
File.delete "test-dl.db" rescue nil
|
126
|
-
File.delete "test-native.db" rescue nil
|
data/test/test_errors.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
-
|
3
|
-
class TC_Errors < Test::Unit::TestCase
|
4
|
-
(1..26).each do |code|
|
5
|
-
define_method( "test_error_code_%02d" % code ) do
|
6
|
-
db = stub('database', :errmsg => 'message')
|
7
|
-
begin
|
8
|
-
SQLite3::Error.check( code, db )
|
9
|
-
rescue SQLite3::Exception => e
|
10
|
-
assert_instance_of SQLite3::EXCEPTIONS[code], e
|
11
|
-
assert_equal code, e.code
|
12
|
-
assert_equal code, e.class.code
|
13
|
-
assert_equal "message", e.message
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|