<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:05 <adam12> jeremyevans: any chance you recognize this query? I'm debugging something and I suspect it might be from Sequel or Rodauth? https://gist.githubusercontent.com/adam12/4fa365b7c9ed5e5f46a51a244ba2df28/raw/fffb74d22678e1e33d9841899c80b3622c11c29e/query.sql
00:10 GitHub131 joined
00:10 <GitHub131> [13sequel] 15jeremyevans pushed 1 new commit to 06master: 02https://git.io/vHOEh
00:10 <GitHub131> 13sequel/06master 14e660d12 15Jeremy Evans: Deprecate setting invalid datasets for models unless required_valid_table = false...
00:10 GitHub131 left
00:12 <jeremyevans> adam12: I think that's from a Database#indexes call on PostgreSQL
00:12 <adam12> jeremyevans: ok thanks.
03:00 tercenya joined
03:57 claw joined
04:00 GitHub11 joined
04:00 <GitHub11> [13sequel] 15vhtien opened issue #1366: Using lower function in query get unexpected result 02https://git.io/vHOXK
04:00 GitHub11 left
05:37 GitHub36 joined
05:37 <GitHub36> [13sequel] 15jeremyevans commented on issue #1366: This is expected behavior. If you use an expression, Sequel uses the name the database driver gives for the column. On same databases, that will be `lower`, on some `lower(role)`, on others it will be nil and Sequel will use `untitled`. The best practice is to always alias expressions when selecting them in Sequel. 02https://git.io/vHOH3
05:37 GitHub36 left
05:37 GitHub83 joined
05:37 <GitHub83> [13sequel] 15jeremyevans closed issue #1366: Using lower function in query get unexpected result 02https://git.io/vHOXK
05:37 GitHub83 left
09:35 dreinull joined
12:36 pdrakeweb joined
13:36 pdrakeweb joined
15:18 pdrakeweb joined
17:21 Renich joined
17:48 pdrakeweb joined
18:57 bendit joined
19:02 <bendit> If I have a table "subnet" and a table "ipaddr", I can make a one_to_many association easily because ipaddr has a column that references base id
19:02 <bendit> Subnet.first.ipaddrs
19:02 <bendit> Very handy
19:03 <bendit> I have another table "range" which just consists of ranges, and ipaddr doesn't have a column referencing it
19:03 <bendit> I'd like to make a function, Range.first.ipaddrs, which gives me all the ipaddrs in the range
19:04 <bendit> SELECT * FROM range JOIN ipaddr on (ipaddr.addr <<= range.range)
19:04 <bendit> But I can't figure out how to do it
19:07 <bendit> So really, I want to make a fake association, just for selects (not updates or deletes)
19:07 <jeremyevans> bendit: class Range; def ipaddrs; Ipaddr.where(Sequel.lit('ipaddr.addr <<= ?', range)).all end end
19:08 <bendit> Thank you, that makes a lot more sense, just avoid the join altogether
19:11 pdrakeweb joined
19:53 pdrakeweb joined
19:55 tercenya joined
20:05 <bendit> Another one, probably equally simple… def foo(filter) return Subnet.join(:ipaddr).where(filter) end
20:05 <bendit> It gets called like foo(:descrip => 'bar')
20:06 <bendit> Both Subnet and Ipaddr have :descrip columns, and I know the caller wants to filter on ipaddr__descrip, not subnet__descrip
20:07 <bendit> How do I mangle the filter I was passed so :descrip becomes :ipaddr__descrip ?
20:13 tercenya joined
20:17 <jeremyevans> bendit: Sequel.qualify(:ipaddr, column)
20:17 tercenya joined
20:18 <bendit> But I have a whole filter already prepared… I don't know which columns the filter references, I just need them all prefixed with "ipaddr."
20:24 <jeremyevans> bendit: You can use Sequel.deep_qualify to qualify expressions: Sequel.deep_qualify(:ipaddr, expr)
20:26 <bendit> Ah clever, I was behing in version and I didn't have that. Now I do! Thanks again!
21:22 bendit left
21:33 pdrakeweb joined
21:59 tercenya joined
22:11 pdrakeweb joined
22:30 banditro_ joined
23:46 <adam12> Anybody know best way to get "TIMESTAMP 'today'" to work in dataset filter?