Re: Variable into Sequel.cast

2020-01-20 Thread Jeremy Evans
On Monday, January 20, 2020 at 11:53:45 AM UTC-8, BeeRich33 wrote: > > OK, it was apparently working for me somehow. Anyway, in Sequel, is this > the proper sequence for a var placeholder? It works but I'm confused about > the *:interval* casting type, and its position within that Sequel.cast:

Re: Variable into Sequel.cast

2020-01-20 Thread BeeRich33
OK, it was apparently working for me somehow. Anyway, in Sequel, is this the proper sequence for a var placeholder? It works but I'm confused about the *:interval* casting type, and its position within that Sequel.cast: where(Sequel.cast(:login_date, Date) > Sequel.cast(Sequel::CURRENT_DATE -

Re: Variable into Sequel.cast

2020-01-20 Thread Jeremy Evans
On Sunday, January 19, 2020 at 8:56:04 PM UTC-8, BeeRich33 wrote: > > This is how I've been using it, now currently replaced with "30 days" > manually. I'd like to shove a variable in there. > > tm = PG::TypeMapByColumn.new([ > PG::TextEncoder::String.new > ]) > d = d.to_s > > res = $conn.e

Re: Variable into Sequel.cast

2020-01-19 Thread BeeRich33
This is how I've been using it, now currently replaced with "30 days" manually. I'd like to shove a variable in there. tm = PG::TypeMapByColumn.new([ PG::TextEncoder::String.new ]) d = d.to_s res = $conn.exec_params( %Q{ SELECT search_phrase, count(search_phrase) FROM searches WHERE

Re: Variable into Sequel.cast

2020-01-08 Thread Jeremy Evans
On Wednesday, January 8, 2020 at 8:00:36 AM UTC-8, BeeRich33 wrote: > > My PG syntax has a variable into an interval: > > WHERE creation_date::timestamp::date > (CURRENT_DATE - interval '$1 days' > )::date > That's interesting, it's not something I would expect to work because the placeholder is

Variable into Sequel.cast

2020-01-08 Thread BeeRich33
My PG syntax has a variable into an interval: WHERE creation_date::timestamp::date > (CURRENT_DATE - interval '$1 days'):: date Can I use a variable in Sequel as a parameter passed to this method, for use inside this interval integer? Sequel.cast('? days', 30, :interval) -- You received this