I've compiled libsqlite3-ruby1.8 for the iLiad. This allows you to talk to a sqlite3 database with Ruby.
- Please install sqlite3 from this post
- Next install the attached libruby1.8 ipkg. This is a temporary package and contains no data so far, but libsqlite3-ruby1.8 depends on it. In the future I will split up the Ruby package into the binary and the libraries, and this a little preparation to do so.
- Now you may install the libsqlite3-ruby1.8 ipkg.
The library uses ~250k of space and will be installed wherever you have installed Ruby. Some test code from the interactive Ruby shell:
Code:
root@ereader:/var/tmp$ irb
irb(main):001:0> require "sqlite3"
=> true
irb(main):002:0> db = SQLite3::Database.new("/tmp/test.db")
=> #<SQLite3::Database:0x402e2bac @handle=#<SWIG::TYPE_p_sqlite3:0x402daf9c>, @translator=nil, @statement_factory=SQLite3::Statement, @type_translation=false, @results_as_hash=false, @driver=#<SQLite3::Driver::Native::Driver:0x402e2b0c @busy_handler={}, @authorizer={}, @callback_data={}, @trace={}>, @transaction_active=false, @closed=false>
irb(main):003:0> db.execute("SELECT * FROM test") do |row|
irb(main):004:1* puts row[1]
irb(main):005:1> end
abc
=> nil
Have fun!