amalgalite 1.4.0-x86-mingw32 → 1.4.1-x86-mingw32
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 +7 -0
- data/HISTORY.md +8 -1
- data/README.md +8 -16
- data/Rakefile +1 -0
- data/TODO.md +9 -1
- data/ext/amalgalite/c/amalgalite_database.c +14 -13
- data/ext/amalgalite/c/extconf.rb +11 -4
- data/ext/amalgalite/c/sqlite3.c +36723 -26806
- data/ext/amalgalite/c/sqlite3.h +946 -629
- data/ext/amalgalite/c/sqlite3ext.h +10 -0
- data/lib/amalgalite/1.8/amalgalite.so +0 -0
- data/lib/amalgalite/1.9/amalgalite.so +0 -0
- data/lib/amalgalite/2.0/amalgalite.so +0 -0
- data/lib/amalgalite/2.1/amalgalite.so +0 -0
- data/lib/amalgalite/2.2/amalgalite.so +0 -0
- data/lib/amalgalite/database.rb +9 -9
- data/lib/amalgalite/version.rb +1 -1
- data/spec/aggregate_spec.rb +10 -6
- data/spec/database_spec.rb +3 -5
- data/spec/sqlite3/version_spec.rb +5 -5
- data/tasks/default.rake +1 -1
- metadata +43 -43
@@ -267,6 +267,11 @@ struct sqlite3_api_routines {
|
|
267
267
|
void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
|
268
268
|
void(*)(void*), unsigned char);
|
269
269
|
int (*strglob)(const char*,const char*);
|
270
|
+
/* Version 3.8.11 and later */
|
271
|
+
sqlite3_value *(*value_dup)(const sqlite3_value*);
|
272
|
+
void (*value_free)(sqlite3_value*);
|
273
|
+
int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
|
274
|
+
int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
|
270
275
|
};
|
271
276
|
|
272
277
|
/*
|
@@ -497,6 +502,11 @@ struct sqlite3_api_routines {
|
|
497
502
|
#define sqlite3_result_blob64 sqlite3_api->result_blob64
|
498
503
|
#define sqlite3_result_text64 sqlite3_api->result_text64
|
499
504
|
#define sqlite3_strglob sqlite3_api->strglob
|
505
|
+
/* Version 3.8.11 and later */
|
506
|
+
#define sqlite3_value_dup sqlite3_api->value_dup
|
507
|
+
#define sqlite3_value_free sqlite3_api->value_free
|
508
|
+
#define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64
|
509
|
+
#define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64
|
500
510
|
#endif /* SQLITE_CORE */
|
501
511
|
|
502
512
|
#ifndef SQLITE_CORE
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/amalgalite/database.rb
CHANGED
@@ -682,9 +682,9 @@ module Amalgalite
|
|
682
682
|
|
683
683
|
##
|
684
684
|
# call-seq:
|
685
|
-
# db.
|
686
|
-
# db.
|
687
|
-
# db.
|
685
|
+
# db.define_function( "name", MyDBFunction.new )
|
686
|
+
# db.define_function( "my_func", callable )
|
687
|
+
# db.define_function( "my_func" ) do |x,y|
|
688
688
|
# ....
|
689
689
|
# return result
|
690
690
|
# end
|
@@ -692,13 +692,13 @@ module Amalgalite
|
|
692
692
|
# register a callback to be exposed as an SQL function. There are multiple
|
693
693
|
# ways to register this function:
|
694
694
|
#
|
695
|
-
# 1. db.
|
696
|
-
# * pass +
|
697
|
-
# * The SQL function _name_ taking _arity_ parameters will be registered,
|
695
|
+
# 1. db.define_function( "name" ) { |a| ... }
|
696
|
+
# * pass +define_function+ a _name_ and a block.
|
697
|
+
# * The SQL function _name_ taking _arity_ parameters will be registered,
|
698
698
|
# where _arity_ is the _arity_ of the block.
|
699
699
|
# * The return value of the block is the return value of the registred
|
700
700
|
# SQL function
|
701
|
-
# 2. db.
|
701
|
+
# 2. db.define_function( "name", callable )
|
702
702
|
# * pass +function+ a _name_ and something that <tt>responds_to?( :to_proc )</tt>
|
703
703
|
# * The SQL function _name_ is registered taking _arity_ parameters is
|
704
704
|
# registered where _arity_ is the _arity_ of +callable.to_proc.call+
|
@@ -750,7 +750,7 @@ module Amalgalite
|
|
750
750
|
end
|
751
751
|
|
752
752
|
to_remove.each do |db_func|
|
753
|
-
@api.remove_function( db_func.name, db_func)
|
753
|
+
@api.remove_function( db_func.name, db_func )
|
754
754
|
@functions.delete( db_func.signature )
|
755
755
|
end
|
756
756
|
end
|
@@ -770,7 +770,7 @@ module Amalgalite
|
|
770
770
|
db_aggregate = klass
|
771
771
|
a = klass.new
|
772
772
|
raise AggregateError, "Use only mandatory or arbitrary parameters in an SQL Aggregate, not both" if a.arity < -1
|
773
|
-
raise AggregateError, "Aggregate implementation name '#{a.name}' does not match defined name '#{name}'"if a.name != name
|
773
|
+
raise AggregateError, "Aggregate implementation name '#{a.name}' does not match defined name '#{name}'" if a.name != name
|
774
774
|
@api.define_aggregate( name, a.arity, klass )
|
775
775
|
@aggregates[a.signature] = db_aggregate
|
776
776
|
nil
|
data/lib/amalgalite/version.rb
CHANGED
data/spec/aggregate_spec.rb
CHANGED
@@ -131,16 +131,20 @@ describe "Aggregate SQL Functions" do
|
|
131
131
|
|
132
132
|
it "handles an error being thrown during initialization in the C extension" do
|
133
133
|
class AggregateTest7 < AggregateTest1
|
134
|
-
|
134
|
+
def self.called?
|
135
|
+
if @called then
|
136
|
+
raise "Initialization error!"
|
137
|
+
else
|
138
|
+
@called = true
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
135
142
|
def initialize
|
143
|
+
super
|
136
144
|
@name = "atest7"
|
137
145
|
@count = 0
|
138
146
|
@arity = -1
|
139
|
-
|
140
|
-
raise "Initialization error!"
|
141
|
-
else
|
142
|
-
@@instance_count += 1
|
143
|
-
end
|
147
|
+
self.class.called?
|
144
148
|
end
|
145
149
|
end
|
146
150
|
@iso_db.define_aggregate( "atest7", AggregateTest7 )
|
data/spec/database_spec.rb
CHANGED
@@ -291,8 +291,6 @@ describe Amalgalite::Database do
|
|
291
291
|
|
292
292
|
r = @iso_db.execute( "select rtest1() AS r" )
|
293
293
|
r.first['r'].should eql("rtest1 called")
|
294
|
-
#@iso_db.remove_function("rtest1", -1)
|
295
|
-
# the arity of rtest1 is different in 1.9 vs. 1.8
|
296
294
|
@iso_db.remove_function("rtest1")
|
297
295
|
|
298
296
|
lambda { @iso_db.execute( "select rtest1() as r" )}.should raise_error( ::Amalgalite::SQLite3::Error, /no such function: rtest1/ )
|
@@ -344,13 +342,13 @@ describe Amalgalite::Database do
|
|
344
342
|
c = 0
|
345
343
|
loop do
|
346
344
|
begin
|
347
|
-
db.execute("select
|
345
|
+
db.execute("select * from subcountry")
|
348
346
|
executions += 1
|
349
347
|
if not looping_sent then
|
350
348
|
control_queue.enq :looping
|
351
349
|
looping_sent = true
|
352
350
|
end
|
353
|
-
if c >
|
351
|
+
if c > 20_000 then
|
354
352
|
break
|
355
353
|
end
|
356
354
|
c += 1
|
@@ -369,7 +367,7 @@ describe Amalgalite::Database do
|
|
369
367
|
loop do
|
370
368
|
@iso_db.interrupt!
|
371
369
|
break unless control_queue.empty?
|
372
|
-
if count >
|
370
|
+
if count > 20_000 then
|
373
371
|
break
|
374
372
|
end
|
375
373
|
count += 1
|
@@ -7,16 +7,16 @@ describe "Amalgalite::SQLite3::Version" do
|
|
7
7
|
expect(Amalgalite::SQLite3::Version.to_s).to match( /\d\.\d\.\d/ )
|
8
8
|
expect(Amalgalite::SQLite3::Version.runtime_version).to match( /\d\.\d\.\d/ )
|
9
9
|
|
10
|
-
Amalgalite::SQLite3::Version.to_i.should eql(
|
11
|
-
Amalgalite::SQLite3::Version.runtime_version_number.should eql(
|
10
|
+
Amalgalite::SQLite3::Version.to_i.should eql(3008011)
|
11
|
+
Amalgalite::SQLite3::Version.runtime_version_number.should eql(3008011)
|
12
12
|
|
13
13
|
Amalgalite::SQLite3::Version::MAJOR.should eql(3)
|
14
14
|
Amalgalite::SQLite3::Version::MINOR.should eql(8)
|
15
|
-
Amalgalite::SQLite3::Version::RELEASE.should eql(
|
15
|
+
Amalgalite::SQLite3::Version::RELEASE.should eql(11)
|
16
16
|
expect(Amalgalite::SQLite3::Version.to_a.size).to eql(3)
|
17
17
|
|
18
|
-
Amalgalite::SQLite3::Version.compiled_version.should be == "3.8.
|
19
|
-
Amalgalite::SQLite3::Version.compiled_version_number.should be ==
|
18
|
+
Amalgalite::SQLite3::Version.compiled_version.should be == "3.8.11.1"
|
19
|
+
Amalgalite::SQLite3::Version.compiled_version_number.should be == 3008011
|
20
20
|
Amalgalite::SQLite3::Version.compiled_matches_runtime?.should be == true
|
21
21
|
end
|
22
22
|
end
|
data/tasks/default.rake
CHANGED
metadata
CHANGED
@@ -1,129 +1,128 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amalgalite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
5
|
-
prerelease:
|
4
|
+
version: 1.4.1
|
6
5
|
platform: x86-mingw32
|
7
6
|
authors:
|
8
7
|
- Jeremy Hinegardner
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: arrayfields
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '4.9'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '4.9'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '3.0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '3.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '10.0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '10.0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rake-compiler
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0.9'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0.9'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake-compiler-dock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.4'
|
78
83
|
- !ruby/object:Gem::Dependency
|
79
84
|
name: rdoc
|
80
85
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
86
|
requirements:
|
83
|
-
- - ~>
|
87
|
+
- - "~>"
|
84
88
|
- !ruby/object:Gem::Version
|
85
89
|
version: '4.0'
|
86
90
|
type: :development
|
87
91
|
prerelease: false
|
88
92
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
93
|
requirements:
|
91
|
-
- - ~>
|
94
|
+
- - "~>"
|
92
95
|
- !ruby/object:Gem::Version
|
93
96
|
version: '4.0'
|
94
97
|
- !ruby/object:Gem::Dependency
|
95
98
|
name: simplecov
|
96
99
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
100
|
requirements:
|
99
|
-
- - ~>
|
101
|
+
- - "~>"
|
100
102
|
- !ruby/object:Gem::Version
|
101
103
|
version: '0.9'
|
102
104
|
type: :development
|
103
105
|
prerelease: false
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
107
|
requirements:
|
107
|
-
- - ~>
|
108
|
+
- - "~>"
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: '0.9'
|
110
111
|
- !ruby/object:Gem::Dependency
|
111
112
|
name: zip
|
112
113
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '2.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
121
|
requirements:
|
123
|
-
- - ~>
|
122
|
+
- - "~>"
|
124
123
|
- !ruby/object:Gem::Version
|
125
124
|
version: '2.0'
|
126
|
-
description:
|
125
|
+
description: 'Amalgalite embeds the SQLite database engine in a ruby extension. There
|
127
126
|
is no need to install SQLite separately. Look in the examples/ directory to see
|
128
127
|
* general usage * blob io * schema information * custom functions * custom aggregates
|
129
128
|
* requiring ruby code from a database * full text search Also Scroll through Amalgalite::Database
|
@@ -176,6 +175,11 @@ files:
|
|
176
175
|
- ext/amalgalite/c/sqlite3_options.h
|
177
176
|
- ext/amalgalite/c/sqlite3ext.h
|
178
177
|
- lib/amalgalite.rb
|
178
|
+
- lib/amalgalite/1.8/amalgalite.so
|
179
|
+
- lib/amalgalite/1.9/amalgalite.so
|
180
|
+
- lib/amalgalite/2.0/amalgalite.so
|
181
|
+
- lib/amalgalite/2.1/amalgalite.so
|
182
|
+
- lib/amalgalite/2.2/amalgalite.so
|
179
183
|
- lib/amalgalite/aggregate.rb
|
180
184
|
- lib/amalgalite/blob.rb
|
181
185
|
- lib/amalgalite/boolean.rb
|
@@ -247,37 +251,33 @@ files:
|
|
247
251
|
- tasks/default.rake
|
248
252
|
- tasks/extension.rake
|
249
253
|
- tasks/this.rb
|
250
|
-
- lib/amalgalite/1.9/amalgalite.so
|
251
|
-
- lib/amalgalite/2.0/amalgalite.so
|
252
|
-
- lib/amalgalite/2.1/amalgalite.so
|
253
254
|
homepage: http://github.com/copiousfreetime/amalgalite
|
254
255
|
licenses:
|
255
256
|
- BSD
|
257
|
+
metadata: {}
|
256
258
|
post_install_message:
|
257
259
|
rdoc_options:
|
258
|
-
- --main
|
260
|
+
- "--main"
|
259
261
|
- README.md
|
260
|
-
- --markup
|
262
|
+
- "--markup"
|
261
263
|
- tomdoc
|
262
264
|
require_paths:
|
263
265
|
- lib
|
264
266
|
required_ruby_version: !ruby/object:Gem::Requirement
|
265
|
-
none: false
|
266
267
|
requirements:
|
267
|
-
- -
|
268
|
+
- - ">="
|
268
269
|
- !ruby/object:Gem::Version
|
269
270
|
version: 1.9.3
|
270
271
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
271
|
-
none: false
|
272
272
|
requirements:
|
273
|
-
- -
|
273
|
+
- - ">="
|
274
274
|
- !ruby/object:Gem::Version
|
275
275
|
version: '0'
|
276
276
|
requirements: []
|
277
277
|
rubyforge_project:
|
278
|
-
rubygems_version:
|
278
|
+
rubygems_version: 2.4.8
|
279
279
|
signing_key:
|
280
|
-
specification_version:
|
280
|
+
specification_version: 4
|
281
281
|
summary: Amalgalite embeds the SQLite database engine in a ruby extension. There
|
282
282
|
is no need to install SQLite separately.
|
283
283
|
test_files:
|