README.rdoc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. = SQLite3/Ruby Interface
  2. * http://github.com/luislavena/sqlite3-ruby
  3. * http://groups.google.com/group/sqlite3-ruby
  4. == DESCRIPTION
  5. This module allows Ruby programs to interface with the SQLite3
  6. database engine (http://www.sqlite.org). You must have the
  7. SQLite engine installed in order to build this module.
  8. Note that this module is only compatible with SQLite 3.6.16 or newer.
  9. == SYNOPSIS
  10. require "sqlite3"
  11. # Open a database
  12. db = SQLite3::Database.new "test.db"
  13. # Create a database
  14. rows = db.execute <<-SQL
  15. create table numbers (
  16. name varchar(30),
  17. val int
  18. );
  19. SQL
  20. # Execute a few inserts
  21. {
  22. "one" => 1,
  23. "two" => 2,
  24. }.each do |pair|
  25. db.execute "insert into numbers values ( ?, ? )", pair
  26. end
  27. # Find a few rows
  28. db.execute( "select * from numbers" ) do |row|
  29. p row
  30. end
  31. == Compilation and Installation
  32. Install SQLite3, enabling the option SQLITE_ENABLE_COLUMN_METADATA (see
  33. www.sqlite.org/compile.html for details).
  34. Then do the following:
  35. ruby setup.rb config
  36. ruby setup.rb setup
  37. ruby setup.rb install
  38. Alternatively, you can download and install the RubyGem package for
  39. SQLite3/Ruby (you must have RubyGems and SQLite3 installed, first):
  40. gem install sqlite3
  41. If you have sqlite3 installed in a non-standard location, you can specify the location of the include and lib files by doing:
  42. gem install sqlite3 -- --with-sqlite3-include=/opt/local/include \
  43. --with-sqlite3-lib=/opt/local/lib
  44. = SUPPORT!!!
  45. == OMG! Something has gone wrong! Where do I get help?
  46. The best place to get help is from the
  47. {sqlite3-ruby mailing list}[http://groups.google.com/group/sqlite3-ruby] which
  48. can be found here:
  49. * http://groups.google.com/group/sqlite3-ruby
  50. == I've found a bug! Where do I file it?
  51. Uh oh. After contacting the mailing list, you've found that you've actually
  52. discovered a bug. You can file the bug at the
  53. {github issues page}[http://github.com/luislavena/sqlite3-ruby/issues]
  54. which can be found here:
  55. * http://github.com/luislavena/sqlite3-ruby/issues
  56. == Usage
  57. For help figuring out the SQLite3/Ruby interface, check out the
  58. SYNOPSIS as well as the RDoc. It includes examples of
  59. usage. If you have any questions that you feel should be address in the
  60. FAQ, please send them to {the mailing list}[http://groups.google.com/group/sqlite3-ruby]
  61. == Source Code
  62. The source repository is accessible via git:
  63. git clone git://github.com/luislavena/sqlite3-ruby.git