Re: Finding by Dates

2009-07-02 Thread Jeremy Evans
On Jul 2, 6:54 am, Scott LaBounty slabou...@gmail.com wrote: What date format(s) is/are accepted if I want to use Sequel models and do a Model.find.(date = ???). It looks like for sqlite, I can do something like 2009-01-07 (July 1st, 2009). Are there other formats that will / will not work?

Re: Finding by Dates

2009-07-02 Thread Scott LaBounty
Jeremy, By Date objects, you mean a Ruby Date object, correct? If so, that actually makes things easier. On Thu, Jul 2, 2009 at 8:13 AM, Jeremy Evans jeremyeva...@gmail.com wrote: On Jul 2, 6:54 am, Scott LaBounty slabou...@gmail.com wrote: What date format(s) is/are accepted if I want to

Sequel 3.2.0 Released

2009-07-02 Thread Jeremy Evans
Sequel 3.2.0 has been released and should be available on the gem mirrors. The 3.2.0 release adds numerous improvements: New Features * Common table expressions (CTEs) are now supported. CTEs use the SQL WITH clause, and specify inline views that queries can use. They also

Re: Finding by Dates

2009-07-02 Thread Jeremy Evans
On Jul 2, 8:19 am, Scott LaBounty slabou...@gmail.com wrote: By Date objects, you mean a Ruby Date object, correct? If so, that actually makes things easier. Yes. Jeremy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Finding by Dates

2009-07-02 Thread Scott LaBounty
Jeremy, Here's what I'm trying: date = Date.new(Time.now.year,Time.now.month,Time.now.day) today_poll = Poll.find(:date = date); It doesn't seem to work. Should it or am I missing something (as is usual)? Scott On Thu, Jul 2, 2009 at 9:32 AM, Jeremy Evans

Re: Finding by Dates

2009-07-02 Thread David Fisher
In my experience, Sqlite3 doesn't handle most strings well for date comparisons. It works sometimes, but not always. Postgres has treated me much better so far in this regard. dave On Thu, Jul 2, 2009 at 12:49 PM, Scott LaBountyslabou...@gmail.com wrote: Jeremy, Here's what I'm trying:

Re: Finding by Dates

2009-07-02 Thread Jeremy Evans
On Jul 2, 9:52 am, David Fisher tib...@gmail.com wrote: In my experience, Sqlite3 doesn't handle most strings well for date comparisons. It works sometimes, but not always. Postgres has treated me much better so far in this regard. Yes. As I mentioned, on SQLite, it requires the strings

Re: sequel command line tool: fail

2009-07-02 Thread Steve H
Jeremey, thanks so much for replying to my question! Does it also work with em-mysql (if not, it could be that sequel is trying to load that)?   em-mysql isn't really a standalone mysql driver. It requires mysqlplus itself to work. Can you try using the RUBYLIB environment variable and

Re: Finding by Dates

2009-07-02 Thread Scott LaBounty
Jeremy, Isn't that what I'm doing with this: date = Date.new(Time.now.year,Time.now.month,Time.now.day) today_poll = Poll.find(:date = date); that doesn't seem to work. Scott On Thu, Jul 2, 2009 at 11:24 AM, Jeremy Evans jeremyeva...@gmail.comwrote: On Jul 2, 9:52 am,

Re: sequel command line tool: fail

2009-07-02 Thread Jeremy Evans
On Jul 2, 12:08 pm, Steve H p.wi...@gmail.com wrote: Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this.  It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for

Re: Finding by Dates

2009-07-02 Thread Jeremy Evans
On Jul 2, 12:28 pm, Scott LaBounty slabou...@gmail.com wrote: Jeremy, Isn't that what I'm doing with this:         date = Date.new(Time.now.year,Time.now.month,Time.now.day)         today_poll = Poll.find(:date = date); that doesn't seem to work. That's only going to work on SQLite if

Re: sequel command line tool: fail

2009-07-02 Thread Steve H
Hmmm. Perhaps I missed something, but Sequel::Migrator is not defined: require 'sequel' = true DB = Sequel.connect(:adapter = 'mysql', :user = 'root', :database = 'castle_gameserver') = #Sequel::MySQL::Database: mysql:root@/castle_gameserver Sequel::Migrator.apply(DB,

Re: sequel command line tool: fail

2009-07-02 Thread Steve H
Ahh! Aman to my rescue. Glad you're on this list as well as the EM one :) Yes, I installed the pure ruby mysql driver back when I had accidentally downloaded and installed MySQL x86_64, and my connection was super slow so I didn't replace it with x86 right away. I installed the pure ruby

Re: sequel command line tool: fail

2009-07-02 Thread Aman Gupta
On Thu, Jul 2, 2009 at 1:58 PM, Steve Hp.wi...@gmail.com wrote: Ahh!  Aman to my rescue.  Glad you're on this list as well as the EM one :) Yes, I installed the pure ruby mysql driver back when I had accidentally downloaded and installed MySQL x86_64, and my connection was super slow so I

Re: Finding by Dates

2009-07-02 Thread Scott LaBounty
Jeremy, That would be my guess too (string format issue). I'm just doing this for learning / teaching purposes, so I can certainly work around it. I think what I missed earlier is that sqlite actually stores a Date as a string (true?) and so I'll have to convert to match. In a real database

Re: sequel command line tool: fail

2009-07-02 Thread Steve H
Aman, Jeremy, thanks so much! I deleted that mysql.rb file, and migrations are running quite nicely from both the command line utility and from within irb as well now. I have *other* problems now, but at least this one is solved. Cheers! -Steve On Jul 2, 1:59 pm, Aman Gupta

to_xml

2009-07-02 Thread daniel_spaniel
Hi Jeremy, I have seen a few posts about people asking for a to_xml method for a Sequel Model. Is there something around with all the flair that AR has with its XMLSerializer? It easy to make something super basic though, but I was curious. ~ Daniel