amalgalite 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +12 -0
- data/ext/amalgalite/amalgalite3.c +34 -5
- data/ext/amalgalite/sqlite3.c +3116 -2793
- data/ext/amalgalite/sqlite3.h +206 -187
- data/lib/amalgalite/sqlite3/version.rb +19 -0
- data/lib/amalgalite/type_maps/default_map.rb +2 -2
- data/lib/amalgalite/version.rb +2 -2
- data/spec/default_map_spec.rb +9 -1
- data/spec/sqlite3/version_spec.rb +10 -2
- metadata +2 -2
@@ -28,6 +28,9 @@ module Amalgalite
|
|
28
28
|
[ MAJOR, MINOR, RELEASE ]
|
29
29
|
end
|
30
30
|
|
31
|
+
def self.compiled_matches_runtime?
|
32
|
+
self.compiled_version == self.runtime_version
|
33
|
+
end
|
31
34
|
end
|
32
35
|
|
33
36
|
# Version of SQLite that ships with Amalgalite
|
@@ -35,3 +38,19 @@ module Amalgalite
|
|
35
38
|
end
|
36
39
|
Version.freeze
|
37
40
|
end
|
41
|
+
|
42
|
+
unless Amalgalite::SQLite3::Version.compiled_matches_runtime? then
|
43
|
+
warn <<eom
|
44
|
+
You are seeing something odd. The compiled version of SQLite that
|
45
|
+
is embedded in this extension is for some reason, not being used.
|
46
|
+
The version in the extension is #{Amalgalite::SQLite3::Version.compiled_version} and the version that
|
47
|
+
as been loaded as a shared library is #{Amalgalite::SQLite3::Version.runtime_version}. These versions
|
48
|
+
should be the same, but they are not.
|
49
|
+
|
50
|
+
One known issue is if you are using this libary in conjunction with
|
51
|
+
Hitimes on Mac OS X. You should make sure that "require 'amalgalite'"
|
52
|
+
appears before "require 'hitimes'" in your ruby code.
|
53
|
+
|
54
|
+
This is a non-trivial problem, and I am working on it.
|
55
|
+
eom
|
56
|
+
end
|
@@ -22,9 +22,9 @@ module Amalgalite::TypeMaps
|
|
22
22
|
'date' => %w[ date ],
|
23
23
|
'datetime' => %w[ datetime ],
|
24
24
|
'time' => %w[ timestamp time ],
|
25
|
-
'float' => %w[ double real numeric decimal ],
|
25
|
+
'float' => %w[ double float real numeric decimal ],
|
26
26
|
'integer' => %w[ integer tinyint smallint int int2 int4 int8 bigint serial bigserial ],
|
27
|
-
'string' => %w[ text char varchar character ],
|
27
|
+
'string' => %w[ text char string varchar character ],
|
28
28
|
'boolean' => %w[ bool boolean ],
|
29
29
|
'blob' => %w[ binary blob ],
|
30
30
|
}
|
data/lib/amalgalite/version.rb
CHANGED
data/spec/default_map_spec.rb
CHANGED
@@ -62,6 +62,10 @@ describe Amalgalite::TypeMaps::DefaultMap do
|
|
62
62
|
@map.result_value_of( "double", "3.14" ).should be_kind_of(Float)
|
63
63
|
end
|
64
64
|
|
65
|
+
it "Float is returned for declared types of 'float'" do
|
66
|
+
@map.result_value_of( "float", "3.14" ).should be_kind_of(Float)
|
67
|
+
end
|
68
|
+
|
65
69
|
it "Integer is returned for declared types of 'int'" do
|
66
70
|
@map.result_value_of( "int", "42" ).should be_kind_of(Integer)
|
67
71
|
end
|
@@ -70,11 +74,15 @@ describe Amalgalite::TypeMaps::DefaultMap do
|
|
70
74
|
@map.result_value_of( "bool", "True" ).should == true
|
71
75
|
end
|
72
76
|
|
73
|
-
it "Blob is returned for
|
77
|
+
it "Blob is returned for declared types of 'blob'" do
|
74
78
|
blob = @map.result_value_of( "blob", "stuff")
|
75
79
|
blob.to_s.should == "stuff"
|
76
80
|
end
|
77
81
|
|
82
|
+
it "String is returned for delcared types of 'string'" do
|
83
|
+
@map.result_value_of( "string", "stuff").should == "stuff"
|
84
|
+
end
|
85
|
+
|
78
86
|
it "raises and error if an unknown sql type is returned" do
|
79
87
|
x = nil
|
80
88
|
lambda{ x = @map.result_value_of( "footype", "foo" ) }.should raise_error( ::Amalgalite::Error )
|
@@ -5,10 +5,18 @@ describe "Amalgalite::SQLite3::Version" do
|
|
5
5
|
it "should have the sqlite3 version" do
|
6
6
|
Amalgalite::SQLite3::VERSION.should =~ /\d\.\d\.\d/
|
7
7
|
Amalgalite::SQLite3::Version.to_s.should =~ /\d\.\d\.\d/
|
8
|
-
Amalgalite::SQLite3::Version.
|
8
|
+
Amalgalite::SQLite3::Version.runtime_version.should =~ /\d\.\d\.\d/
|
9
|
+
|
10
|
+
Amalgalite::SQLite3::Version.to_i.should eql(3006017)
|
11
|
+
Amalgalite::SQLite3::Version.runtime_version_number.should eql(3006017)
|
12
|
+
|
9
13
|
Amalgalite::SQLite3::Version::MAJOR.should eql(3)
|
10
14
|
Amalgalite::SQLite3::Version::MINOR.should eql(6)
|
11
|
-
Amalgalite::SQLite3::Version::RELEASE.should eql(
|
15
|
+
Amalgalite::SQLite3::Version::RELEASE.should eql(17)
|
12
16
|
Amalgalite::SQLite3::Version.to_a.should have(3).items
|
17
|
+
|
18
|
+
Amalgalite::SQLite3::Version.compiled_version.should == "3.6.17"
|
19
|
+
Amalgalite::SQLite3::Version.compiled_version_number.should == 3006017
|
20
|
+
Amalgalite::SQLite3::Version.compiled_matches_runtime?.should == true
|
13
21
|
end
|
14
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amalgalite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-23 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|