sqlite3-ruby

Ruby bindings for the SQLite3 embedded database

  • 所有者: sparklemotion/sqlite3-ruby
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

= SQLite3/Ruby Interface

{}[https://travis-ci.org/sparklemotion/sqlite3-ruby]

== DESCRIPTION

This module allows Ruby programs to interface with the SQLite3
database engine (http://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}[http://groups.google.com/group/sqlite3-ruby] which
can be found here:

== 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}[https://github.com/sparklemotion/sqlite3-ruby/issues]
which can be found here:

== 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}[http://groups.google.com/group/sqlite3-ruby]

== Source Code

The source repository is accessible via git:

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

主要指标

概览
名称与所有者sparklemotion/sqlite3-ruby
主编程语言Ruby
编程语言Ruby (语言数: 3)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2008-07-01 13:03:27
推送于2025-06-23 05:49:05
最后一次提交
发布数74
最新版本名称v2.7.0 (发布于 )
第一版名称v1_0_0 (发布于 2005-02-06 13:21:51)
用户参与
星数805
关注者数29
派生数204
提交数1.4k
已启用问题?
问题数265
打开的问题数15
拉请求数277
打开的拉请求数8
关闭的拉请求数58
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?