File: README.markdown

package info (click to toggle)
libdataobjects-sqlite3-ruby 0.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 216 kB
  • ctags: 107
  • sloc: ansic: 814; ruby: 294; makefile: 2
file content (102 lines) | stat: -rw-r--r-- 3,205 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# do_sqlite3

* <http://dataobjects.info>

## Description

A SQLite3 driver for DataObjects.

## Features/Problems

This driver implements the DataObjects API for the SQLite3 relational database.

## Synopsis

An example of usage:

    @connection = DataObjects::Connection.new("sqlite3://employees")
    @reader = @connection.create_command('SELECT * FROM users').execute_reader
    @reader.next!

In the future, the `Connection` constructor will be able to be passed either a
DataObjects-style URL or JDBC style URL, when using do\_sqlite3 on JRuby.
However, this feature is not currently working reliably and is a known issue.

## Requirements

This driver is provided for the following platforms:
 * Ruby MRI (1.8.6/7), 1.9: tested on Linux, Mac OS X and Windows platforms.
 * JRuby 1.3.1 + (1.4+ recommended).
 * Rubinius (experimental).

Additionally you should have the following prerequisites:
 * `data_objects` gem
 * `do_jdbc` gem (shared library), if running on JRuby.

## Install

To install the gem:

    gem install do_sqlite3

To compile and install from source:

 * Install rake-compiler: `gem install rake-compiler`.

 * For MRI/Rubinius extensions:
   * Install the `gcc` compiler. On OS X, you should install XCode tools. On
     Ubuntu, run `apt-get install build-essential`.
   * Install Ruby and SQLite3.
   * Install the Ruby and SQLite3 development headers.
     * On Debian-Linux distributions, you can install the following packages
       with `apt`: `ruby-dev` `libsqlite3-dev`.
   * If you want to cross-compile for Windows:
     * Install MinGW:
       * On Debian-Linux distributions, you can install the following package
         with `apt`: `mingw32`.
       * On OS X, this can install the following package with MacPorts: `i386-mingw32-gcc`.
     * Run `rake-compiler cross-ruby`.
     * Run `rake-compiler update-config`.

 * For JRuby extensions:
   * Install the Java Development Kit (provided if you are
     on a recent version of Mac OS X) from <http://java.sun.com>.
   * Install a recent version of JRuby. Ensure `jruby` is in your `PATH` and/or
     you have configured the `JRUBY_HOME` environment variable to point to your
     JRuby installation.
   * Install `data_objects` and `do_jdbc` with `jruby -S rake install`.

 * Then, install this driver with `(jruby -S) rake install`.

For more information, see the SQLite3 driver wiki page:
<http://wiki.github.com/datamapper/do/sqlite3>.

## Developers

Follow the above installation instructions. Additionally, you'll need:
  * `bacon` gem for running specs.
  * `YARD` gem for generating documentation.

See the DataObjects wiki for more comprehensive information on installing and
contributing to the JRuby-variant of this driver:
<http://wiki.github.com/datamapper/do/jruby>.

To run specs:

    rake spec

To run specs without compiling extensions first:

    rake spec_no_compile

To run individual specs:

    rake spec TEST=spec/connection_spec.rb

(Note that the `rake` task uses a `TEST` parameter, not `SPEC`. This is because
the `Rake::TestTask` is used for executing the Bacon specs).

## License

This code is licensed under an **MIT (X11) License**. Please see the
accompanying `LICENSE` file.