On Tue, 13 Jul 2004, Jamis Buck wrote:

> Meino Christian Cramer wrote:
>> From: Jamis Buck <jgb3 / email.byu.edu>
>> Subject: [ANN] SQLite-Ruby 1.3.0
>> Date: Mon, 12 Jul 2004 06:00:23 +0900
>>
>> Hi,
>>
>>  I tried to install with
>>
>>    sudo ruby install.rb
>>
>>  which works properly with previous versions (including 1.2.9.1)
>>  and got
>>
>>     cp ext/extconf.rb ext/sqlite.c build
>>     cp -r lib build
>>     cd build
>>     checking for main() in -lsqlite... no
>>     checking for sqlite.h... no
>>     make: *** No targets specified and no makefile found.  Stop.
>>     could not build sqlite module
>>
>>  but ls /usr/lib/libsqlite* gives me:
>>
>>     [sqlite-ruby-1.3.0/] :ls /usr/lib/libsqlite*
>>     /usr/lib/libsqlite-2.8.13.so.0      /usr/lib/libsqlite.so.0.8.6
>>     /usr/lib/libsqlite-2.8.13.so.0.8.6  /usr/lib/libsqlite3.la
>>     /usr/lib/libsqlite.la               /usr/lib/libsqlite3.so
>>     /usr/lib/libsqlite.so               /usr/lib/libsqlite3.so.0
>>     /usr/lib/libsqlite.so.0             /usr/lib/libsqlite3.so.0.8.6
>>
>>  and ls /usr/include/sqlite*
>>
>>     [sqlite-ruby-1.3.0/] :ls /usr/include/sqlite*
>>     /usr/include/sqlite.h  /usr/include/sqlite3.h
>>
>>  so it /seems/ that everything need is installed, but sqlite-ruby does
>>  not find it. What wnet wrong here ?
>
> Interesting. Has anyone else had problems? Nothing changed in the setup
> scripts between 1.2.9.1 and 1.3.0, so I'm surprised it doesn't work for
> you now, when it used to. Could you send me the contents of the mkmf.log
> file? (It should be in the 'build' subdirectory that gets created by the
> install scripts.) That might help to troubleshoot this.

jamis-

i just installed with no problem using

   Red Hat Enterprise Linux WS release 3 (Taroon Update 2)
   Linux 2.4.21-15.0.3.ELsmp i686
   ruby 1.8.1 (2003-12-25) [i686-linux]

and the --with-sqlite-dir=/full/path argument to install.rb

=====================================================================

i have a (important i think) feature request:

first of all i love the new format (Arrays as tuples)!  the only problem is
that if you want to use arrayfields (or some such) there doesn't seem to be an
easy way to get at the actual fields!  in otherwords if you do this

   require 'sqlite'
   db = SQLite::Database.new 'db', 0
   db.execute(schema = 'create table foo (bar)')
   db.execute 'insert into foo values (42)'
   tuples = db.execute 'select * from foo'
   p tuples

you'll see

   [["42"]]

how would you then set the fields?  it'd be cool if the results were returned
exactly as the sqlite API returned them: that is, with the field names as the
first tuple, eg.

   [["bar"], ["42"], etc...]

this would allow the following code:

   require 'arrayfields'

   fields, tuples = db.execute 'select * from foo'
   tuples.fields = fields
   tuple = tuples.first
   p tuple['bar']  # => 42


i think the 'original' ruby sqlite module did exactly this and it was quite
nice.  i especially like it when you do

   fields, tuples = db.select 'count * from foo'
   field = fields.first
   tuple = tuples.first
   p tuple[field]

since sqlite returns some whacky thing like 'count(*)' in these cases and i
can never remember if the dang field name is 'count (*)' or 'count( * )' etc.
this applies equally to the hash format: you never know the field name for
these types of queries.  using fieldnames and arrayfields - you don't need to
remember, you know it's the first one.

on the other hand there may be as easy way to determine the fieldnames of the
last query and all this is superfluous - if so please enlighten.

i could dig into this tomorrow if you are taxed for time.

kind regards.

-a
--
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it. 
|   --Dogen
===============================================================================