sqlite3-ironruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +51 -0
- data/lib/sqlite3/constants.rb +49 -0
- data/lib/sqlite3/database.rb +711 -0
- data/lib/sqlite3/driver/native/Community.Data.SQLite.dll +0 -0
- data/lib/sqlite3/driver/native/driver.rb +175 -0
- data/lib/sqlite3/errors.rb +68 -0
- data/lib/sqlite3/pragmas.rb +271 -0
- data/lib/sqlite3/resultset.rb +176 -0
- data/lib/sqlite3/statement.rb +231 -0
- data/lib/sqlite3/translator.rb +109 -0
- data/lib/sqlite3/value.rb +57 -0
- data/lib/sqlite3/version.rb +14 -0
- data/lib/sqlite3.rb +1 -0
- data/test/bm.rb +140 -0
- data/test/mocks.rb +45 -0
- data/test/native-vs-dl.rb +126 -0
- data/test/tc_database.rb +198 -0
- data/test/tc_errors.rb +21 -0
- data/test/tc_integration.rb +1044 -0
- data/test/tests.rb +5 -0
- metadata +75 -0
data/README.rdoc
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
= SQLite3/Ruby Interface
|
2
|
+
|
3
|
+
This module allows Ruby programs to interface with the SQLite3
|
4
|
+
database engine (http://www.sqlite.org). You must have the
|
5
|
+
SQLite engine installed in order to build this module.
|
6
|
+
|
7
|
+
Note that this module is NOT compatible with SQLite 2.x.
|
8
|
+
|
9
|
+
|
10
|
+
== Compilation and Installation
|
11
|
+
|
12
|
+
Simply do the following, after installing SQLite3:
|
13
|
+
|
14
|
+
ruby setup.rb config
|
15
|
+
ruby setup.rb setup
|
16
|
+
ruby setup.rb install
|
17
|
+
|
18
|
+
Alternatively, you can download and install the RubyGem package for
|
19
|
+
SQLite3/Ruby (you must have RubyGems and SQLite3 installed, first):
|
20
|
+
|
21
|
+
gem install sqlite3-ruby
|
22
|
+
|
23
|
+
If you have sqlite3 installed in a non-standard location, you can specify the location of the include and lib files by doing:
|
24
|
+
|
25
|
+
gem install sqlite3-ruby -- --with-sqlite3-include=/opt/local/include \
|
26
|
+
--with-sqlite3-lib=/opt/local/lib
|
27
|
+
|
28
|
+
Also, the gem ships with the C source-code pre-built, so (as of version 1.1.1)
|
29
|
+
you no longer need to have SWIG installed. However, if you have SWIG installed
|
30
|
+
and you want to generate the C file yourself, you can specify the
|
31
|
+
<code>--with-swig</code> option.
|
32
|
+
|
33
|
+
== Usage
|
34
|
+
|
35
|
+
For help figuring out the SQLite3/Ruby interface, check out the
|
36
|
+
FAQ[http://sqlite-ruby.rubyforge.org/sqlite3/faq.html]. It includes examples of
|
37
|
+
usage. If you have any questions that you feel should be address in the
|
38
|
+
FAQ, please send them to jamis@37signals.com
|
39
|
+
|
40
|
+
== Source Code
|
41
|
+
|
42
|
+
The source repository is accessible via git:
|
43
|
+
|
44
|
+
git clone git://github.com/jamis/sqlite3-ruby.git
|
45
|
+
|
46
|
+
== Contact Information
|
47
|
+
|
48
|
+
The project page is http://rubyforge.org/projects/sqlite-ruby. There, you can
|
49
|
+
find links to mailing lists and forums that you can use to discuss this
|
50
|
+
library. Additionally, there are trackers for submitting bugs and feature
|
51
|
+
requests. Feel free to use them!
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module SQLite3 ; module Constants
|
2
|
+
|
3
|
+
module TextRep
|
4
|
+
UTF8 = 1
|
5
|
+
UTF16LE = 2
|
6
|
+
UTF16BE = 3
|
7
|
+
UTF16 = 4
|
8
|
+
ANY = 5
|
9
|
+
end
|
10
|
+
|
11
|
+
module ColumnType
|
12
|
+
INTEGER = 1
|
13
|
+
FLOAT = 2
|
14
|
+
TEXT = 3
|
15
|
+
BLOB = 4
|
16
|
+
NULL = 5
|
17
|
+
end
|
18
|
+
|
19
|
+
module ErrorCode
|
20
|
+
OK = 0 # Successful result
|
21
|
+
ERROR = 1 # SQL error or missing database
|
22
|
+
INTERNAL = 2 # An internal logic error in SQLite
|
23
|
+
PERM = 3 # Access permission denied
|
24
|
+
ABORT = 4 # Callback routine requested an abort
|
25
|
+
BUSY = 5 # The database file is locked
|
26
|
+
LOCKED = 6 # A table in the database is locked
|
27
|
+
NOMEM = 7 # A malloc() failed
|
28
|
+
READONLY = 8 # Attempt to write a readonly database
|
29
|
+
INTERRUPT = 9 # Operation terminated by sqlite_interrupt()
|
30
|
+
IOERR = 10 # Some kind of disk I/O error occurred
|
31
|
+
CORRUPT = 11 # The database disk image is malformed
|
32
|
+
NOTFOUND = 12 # (Internal Only) Table or record not found
|
33
|
+
FULL = 13 # Insertion failed because database is full
|
34
|
+
CANTOPEN = 14 # Unable to open the database file
|
35
|
+
PROTOCOL = 15 # Database lock protocol error
|
36
|
+
EMPTY = 16 # (Internal Only) Database table is empty
|
37
|
+
SCHEMA = 17 # The database schema changed
|
38
|
+
TOOBIG = 18 # Too much data for one row of a table
|
39
|
+
CONSTRAINT = 19 # Abort due to contraint violation
|
40
|
+
MISMATCH = 20 # Data type mismatch
|
41
|
+
MISUSE = 21 # Library used incorrectly
|
42
|
+
NOLFS = 22 # Uses OS features not supported on host
|
43
|
+
AUTH = 23 # Authorization denied
|
44
|
+
|
45
|
+
ROW = 100 # sqlite_step() has another row ready
|
46
|
+
DONE = 101 # sqlite_step() has finished executing
|
47
|
+
end
|
48
|
+
|
49
|
+
end ; end
|