sparklemotion/sqlite3-ruby


Ruby bindings for the SQLite3 embedded database

https://github.com/sparklemotion/sqlite3-ruby/

License: Other

Language: Ruby

Keywords: ruby, sqlite


SQLite3/Ruby Interface

Build Status

DESCRIPTION

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.

Note that this module is only compatible with SQLite 3.6.16 or newer.

SYNOPSIS

require "sqlite3"

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

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

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

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

# Create another table with multiple columns

db.execute <<-SQL
  create table students (
    name varchar(50),
    email varchar(50),
    grade varchar(5),
    blog varchar(50)
  );
SQL

# Execute inserts with parameter markers
db.execute("INSERT INTO students (name, email, grade, blog) 
            VALUES (?, ?, ?, ?)", ["Jane", "me@janedoe.com", "A", "http://blog.janedoe.com"])

db.execute( "select * from students" ) do |row|
  p row
end

Compilation and Installation

Install SQLite3, enabling the option SQLITE_ENABLE_COLUMN_METADATA (see www.sqlite.org/compile.html for details).

Then do the following:

ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Alternatively, you can download and install the RubyGem package for SQLite3/Ruby (you must have RubyGems and SQLite3 installed, first):

gem install sqlite3

If you have sqlite3 installed in a non-standard location, you can specify the location of the include and lib files by doing:

gem install sqlite3 -- --with-sqlite3-include=/opt/local/include \
   --with-sqlite3-lib=/opt/local/lib

SUPPORT!!!

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

The best place to get help is from the sqlite3-ruby mailing list which can be found here:

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

I've found a bug! Where do I file it?

Uh oh. After contacting the mailing list, you've found that you've actually discovered a bug. You can file the bug at the github issues page which can be found here:

* https://github.com/sparklemotion/sqlite3-ruby/issues

Usage

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 addressed in the FAQ, please send them to the mailing list

Source Code

The source repository is accessible via git:

git clone git://github.com/sparklemotion/sqlite3-ruby.git

Project Statistics

Sourcerank 22
Repository Size 951 KB
Stars 498
Forks 132
Watchers 25
Open issues 45
Dependencies 8
Contributors 53
Tags 28
Created
Last updated
Last pushed

Top Contributors See all

Aaron Patterson Luis Lavena Jamis Buck jmetter NARUSE, Yui Gabriel Zayas Lars Kanis Jim Flood Caleb Albritton James Berry Rich Meyers mwojo Nobuyoshi Nakada Dr. Kashif Rasul Robert McLeod Hongli Lai Vipul A M Mike Dalessio Nicolas Leger Kevin Curtin

Packages Referencing this Repo

arsea
Active Record Sqlite Embedded Adapter © Luis Lavena
Latest release 0.0.4 - Updated - 498 stars
sqlite3-full
This module allows Ruby programs to interface with the SQLite3 database engine (http://www.sqlite...
Latest release 1.3.9.3 - Updated - 498 stars
sqlite3-ruby
This module allows Ruby programs to interface with the SQLite3 database engine (http://www.sqlite...
Latest release 1.3.3 - Updated - 498 stars
openaustralia-sqlite3
This module allows Ruby programs to interface with the SQLite3 database engine (http://www.sqlite...
Latest release 1.0.0 - Published - 498 stars
femto-sqlite3
This module allows Ruby programs to interface with the SQLite3 database engine (http://www.sqlite...
Latest release 1.3.7 - Published - 498 stars
sqlite3
This module allows Ruby programs to interface with the SQLite3 database engine (http://www.sqlite...
Latest release 1.4.1 - Updated - 498 stars
dawanda-sqlite3
This module allows Ruby programs to interface with the SQLite3 database engine (http://www.sqlite...
Latest release 1.3.3 - Published - 498 stars

Recent Tags See all

v1.4.1 April 29, 2019
v1.4.0 February 04, 2019
v1.3.13 January 04, 2017
v1.3.12 October 09, 2016
v1.3.11 October 10, 2015
v1.3.10 October 31, 2014
v1.3.9 February 25, 2014
v1.3.8 August 17, 2013
v1.3.7 January 12, 2013
v1.3.6 April 16, 2012
v1.3.5 December 03, 2011
v1.3.4 July 25, 2011
dummy1.3.3 January 16, 2011
v1.3.3 January 16, 2011
v1_3_2 October 30, 2010

Interesting Forks See all

larskanis/sqlite3-ruby
Ruby bindings for the SQLite3 embedded database
Ruby - Other - Last pushed - 1 stars - 4 forks
threez/sqlite3-fiddle
Ruby bindings for the SQLite3 embedded database - without compiling
Ruby - BSD-3-Clause - Last pushed - 1 stars
socialcast/sqlite3-ruby
Ruby bindings for the SQLite3 embedded database
Ruby - BSD-3-Clause - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-04-29 23:14:19 UTC

Login to resync this repository