[Q] ActiveRecord - Sqlite

Hi

First of all is there an activerecord tutorial available anywhere?
Tutorial as in
' Lets do this app with all these cases of table relations and
map it to ActiveRecord for SQLite|Mysql'.

I have a table Orders as
'create table Orders (id int primary key not null,order_desc varchar(50));'
in sqlite.

I am getting an error message( 'id shouldn't be null') when I try the following.

require 'active_record'
require 'sqlite'
ActiveRecord::Base.establish_connection(
:adapter=>'sqlite',
:dbfile=>'c:\sqlite\test_dbs\data_test.db')

class Order < ActiveRecord::Base; end

o=Order.new('order_desc'=>'test')
o.save

I get the error message even when i try

o=Order.new('order_desc'=>'test','id'=>10)

instead.

Any clues?
Thanks

PS IDs declared like that in sqlite are autoincremental

I'm working on one with SQlite. It's a phonebook database with four
tables and showing off as many AR features as I can. Not too far off
now.

Gavin

ยทยทยท

On Thursday, August 12, 2004, 11:16:10 PM, Iki wrote:

Hi

First of all is there an activerecord tutorial available anywhere?