From: Michael Neumann Date: 2002-07-10T18:04:25+09:00 Subject: Re: How to connect to sql host using dbi On Wed, Jul 10, 2002 at 05:48:48PM +0900, Radek Hnilica wrote: > In article <20020709185451.GE62567@ninja1.internal>, Sean Chittenden wrote: > > You were very close: > > > > #!/usr/bin/env ruby > > # $Id$ > > require 'dbi' > > DBI.connect('DBI:Pg:testdb;sql', nil, nil) do |dbh| > > puts "selecting..." > > end > > this doesn't work to. > > After some experimenting I come with this code which works. It means > it doesn't fail. The data fetch will be tested in near future. > > --->code<--- > #!/usr/bin/env ruby > # $Id: list_records.rb,v 1.1 2002/07/09 14:48:41 radek Exp $ > > require 'dbi' > > DBI.connect('DBI:Pg:dbname=testdb;host=sql', 'radek') do |dbh| > puts "selecting..." > end > --->end code<--- This is correct. Following options are available: - dbname (or database) - host - port - options - tty Regards, Michael