From: Reid Thompson Date: 2007-08-01T04:30:42+09:00 Subject: Re: ActiveRecord without Rails in case you're not limiting yourself to ActiveRecord... see Og http://www.nitroproject.org/docs/rdoc/index.html rthompso@jhereg: ~$ cat simpleSqlite3.rb require 'rubygems' require 'sqlite3' require 'og' class SimpleTest property :name, String property :ts, String # property :oid, Integer # set_table :simpletest end $DBG=true og_sqlite = { :destroy_tables => false, :store => :sqlite, :user => 'rthompso', :password => 'rthompso', :name => 'test' } db = Og.setup(og_sqlite) store = db.get_store st = SimpleTest.new st.name = 'Test entry' st.ts = Time.now.to_s st.save rthompso@jhereg: ~$ ruby simpleSqlite3.rb INFO: Og uses the Sqlite store. DEBUG: Og manageable classes: [SimpleTest] DEBUG: CREATE TABLE ogsimpletest (name text, ts text, oid integer PRIMARY KEY) INFO: Created table 'ogsimpletest'. DEBUG: SELECT * FROM ogsimpletest LIMIT 1 DEBUG: SELECT * FROM ogsimpletest LIMIT 1 DEBUG: INSERT INTO ogsimpletest (oid, name, ts) VALUES (NULL, 'Test entry', 'Tue Jul 31 15:28:10 -0400 2007') DEBUG: SELECT last_insert_rowid() rthompso@jhereg: ~$ sqlite3 ./test.db "select * from ogsimpletest" Test entry|Tue Jul 31 15:28:10 -0400 2007|1