On Sat, Jul 05, 2008 at 07:21:44PM +0900, Une B?vue wrote:
> Jeremy Hinegardner <jeremy / hinegardner.org> wrote:
> 
> > Amalgalite embeds the SQLite database engine in a ruby extension.
> > There is no need to install SQLite separately.
> > Look in the examples/ directory for examples
> > on:
> > 
> > * general usage
> > * blob io
> > * schema information
> 
> i've tested your online example "gem-db.rb", looks good at insertion,
> however get :
> >>> gem-db.rb
> 
> Opening database (version 0.2.0)
> Establishing taps
> Create schema
> Inserting 99 rows of gem information...
> Took 0.246415 seconds
> Done Inserting
> NoMethodError: undefined method 'columns' for nil:NilClass
> method is_column_rowid?
> in statement.rb at line 349
> method result_meta
> in statement.rb at line 333
> method times
> in statement.rb at line 320
> method result_meta
> in statement.rb at line 320
> method next_row
> in statement.rb at line 250
> method all_rows
> in statement.rb at line 298
> method execute
> in database.rb at line 252
> at top level
> in gem-db.rb at line 72

This would be a bug in the example. I've run it so many times that the db
already existed all the time ran it. This is the patch:

  @@ -37,6 +37,7 @@ unless schema.tables['gems']
       author  VARCHAR(128)
     );
     SQL
  +  db.reload_schema!
   end
   
   #

Or download a new example script from github:

  http://github.com/copiousfreetime/amalgalite/tree/master/examples/gem-db.rb
  
> notice i'm now able to read the Firefox 3 bookmarks file
> ("places.sqlite") having "LONGVARCHAR" (wasn't OK with version 0.1).

I haven't done any testing with a Firefox 3 bookmarks file.  I haven't done
anything specifically to address this, but I could see if SQLite internally had
decided that one of the values in there was to be stored as a BLOB storage type
that amalgalite would have failed before.

enjoy,

-jeremy

-- 
========================================================================
 Jeremy Hinegardner                              jeremy / hinegardner.org