From rubysqlml at contextgarden.net Sun May 8 13:00:10 2005 From: rubysqlml at contextgarden.net (Patrick Gundlach) Date: Sun May 8 12:53:36 2005 Subject: [sqlite-ruby-users] count and type_translation Message-ID: Hello out there, the following program gives me an error: -------------------------------------------------- #!/opt/ruby/1.8/bin/ruby require 'sqlite3' $db = SQLite3::Database.open("foo.db") $db.type_translation = true $db.execute "SELECT COUNT (*) FROM 'sqlite_master' where type='table' and name='sometable'" $db.close -------------------------------------------------- /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/translator.rb:85:in `type_name': undefined method `upcase' for nil:NilClass (NoMethodError) from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/translator.rb:77:in `translate' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:135:in `next' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:134:in `map' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:134:in `next' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:160:in `each' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:215:in `inject' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:215:in `execute' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:210:in `prepare' from /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:210:in `execute' from ./test.rb:6 -------------------------------------------------- I'd expect to return either 1 (Fixnum) or "1" or [["1"]] or something else. (Or 0 of course.) Any workarounds/patches/ideas? Patrick From jamis at 37signals.com Sun May 8 21:47:55 2005 From: jamis at 37signals.com (Jamis Buck) Date: Sun May 8 21:41:36 2005 Subject: [sqlite-ruby-users] count and type_translation In-Reply-To: References: Message-ID: This bug has been fixed in the repository for some time... I'm embarrassed that I've taken so long to package a release. I hope to have more time this next week in which to release an updated sqlite3-ruby (as well as net-ssh, net-sftp, and a few others). Again, sorry about that. - Jamis On May 8, 2005, at 11:00 AM, Patrick Gundlach wrote: > Hello out there, > > the following program gives me an error: > > -------------------------------------------------- > #!/opt/ruby/1.8/bin/ruby > > require 'sqlite3' > $db = SQLite3::Database.open("foo.db") > $db.type_translation = true > $db.execute "SELECT COUNT (*) FROM 'sqlite_master' where type='table' > and name='sometable'" > $db.close > -------------------------------------------------- > > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/translator.rb:85:in > `type_name': undefined method `upcase' for nil:NilClass > (NoMethodError) > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/translator.rb:77:in > `translate' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:135:in > `next' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:134:in > `map' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:134:in > `next' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/resultset.rb:160:in > `each' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:215:in > `inject' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:215:in > `execute' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:210:in > `prepare' > from > /opt/ruby/1.8.2/lib/ruby/site_ruby/1.8/sqlite3/database.rb:210:in > `execute' > from ./test.rb:6 > -------------------------------------------------- > > I'd expect to return either 1 (Fixnum) or "1" or [["1"]] or something > else. (Or 0 of course.) > > > Any workarounds/patches/ideas? > > Patrick > _______________________________________________ > sqlite-ruby-users mailing list > sqlite-ruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/sqlite-ruby-users > From rubysqlml at contextgarden.net Mon May 9 03:38:46 2005 From: rubysqlml at contextgarden.net (Patrick Gundlach) Date: Mon May 9 03:32:10 2005 Subject: [sqlite-ruby-users] Re: count and type_translation In-Reply-To: (Jamis Buck's message of "Sun, 8 May 2005 19:47:55 -0600") References: Message-ID: Hello Jamis, > This bug has been fixed in the repository for some time... I tried the cvs repository sqlite3-ruby on rubyforge and I still get the same error. I wonder why. > Again, sorry about that. Don't be sorry. Thanks for providing sqlite3-ruby - it is very nice so far! Patrick From rubysqlml at contextgarden.net Mon May 9 04:02:38 2005 From: rubysqlml at contextgarden.net (Patrick Gundlach) Date: Mon May 9 03:56:01 2005 Subject: [sqlite-ruby-users] updated to cvs: query undefined? Message-ID: Hi, while upgrading to the cvs version, I get another error: -------------------------------------------------- #!/opt/ruby/1.8/bin/ruby require 'sqlite3' $db = SQLite3::Database.open("foo.db") $db.type_translation = true result=($db.query "SELECT * FROM 'sqlite_master'") result.close $db.close -------------------------------------------------- ./test.rb:6: undefined method `query' for # (NoMethodError) Perhaps I did something wrong upgrading (just installed over previous location)? Is this the right place to ask? Patrick From jamis at 37signals.com Mon May 9 10:31:19 2005 From: jamis at 37signals.com (Jamis Buck) Date: Mon May 9 10:25:00 2005 Subject: [sqlite-ruby-users] updated to cvs: query undefined? In-Reply-To: References: Message-ID: <22eccbcbd1f79da3266bf665d8c3da87@37signals.com> Patrick, I'm not sure how to go about turning off the CVS repo on RubyForge, but it is no longer the authoritative repository. The code for sqlite3-ruby is under the control of subversion, at http://www.jamisbuck.org/svn/sqlite3-ruby The version in the RubyForge CVS repository is fairly old. Sorry about that. - Jamis On May 9, 2005, at 2:02 AM, Patrick Gundlach wrote: > Hi, > > while upgrading to the cvs version, I get another error: > > -------------------------------------------------- > #!/opt/ruby/1.8/bin/ruby > > require 'sqlite3' > $db = SQLite3::Database.open("foo.db") > $db.type_translation = true > result=($db.query "SELECT * FROM 'sqlite_master'") > result.close > $db.close > -------------------------------------------------- > ./test.rb:6: undefined method `query' for # > (NoMethodError) > > Perhaps I did something wrong upgrading (just installed over previous > location)? > > Is this the right place to ask? > > > Patrick > _______________________________________________ > sqlite-ruby-users mailing list > sqlite-ruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/sqlite-ruby-users >