SQLite3/Ruby Interface


This module allows Ruby programs to interface with the SQLite3 database engine (www.sqlite.org). You must have the SQLite engine installed in order to build this module.

INTEGRATED Sqlite3 distribution

This gem (sqlite3-full) differs from sqlite3 only in so far, as it embeds a standardized sqlite3 engine: instead of compiling against whatever version exists on the target system this gem comes always with the same feature set.

The current feature set includes:


require "sqlite3"

# Open a database
db = SQLite3::Database.new "test.db"

# Create a database
rows = db.execute <<-SQL
  create table numbers (
    name varchar(30),
    val int

# Execute a few inserts
  "one" => 1,
  "two" => 2,
}.each do |pair|
  db.execute "insert into numbers values ( ?, ? )", pair

# Execute inserts with parameter markers
db.execute("INSERT INTO students (name, email, grade, blog) 
            VALUES (?, ?, ?, ?)", [@name, @email, @grade, @blog])

# Find a few rows
db.execute( "select * from numbers" ) do |row|
  p row

Compilation and Installation

gem install sqlite3-full


OMG! Something has gone wrong! Where do I get help?

If you can replicate the bug with the sqlite3-ruby gem, the best place to get help might be the sqlite3-ruby mailing list which can be found here:

* http://groups.google.com/group/sqlite3-ruby

Otherwise file the bug at sqlite3-full's bugtracker here:

* https://github.com/radiospiel/sqlite3-full/issues


For help figuring out the SQLite3/Ruby interface, check out the SYNOPSIS as well as the RDoc. It includes examples of usage. If you have any questions that you feel should be address in the FAQ, please send them to the mailing list

Source Code

The source repository is accessible via git:

git clone git://github.com/radiospiel/sqlite3-full.git