<    March 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:35 <adam12> jaequery: Not sure if you have an answer but i use the `inet` column type
01:27 <jaequery> so, in the migration, where you have String :first_name
01:27 <jaequery> Inet :ip ?
01:28 filterfish_ joined
01:28 <jaequery> ah, INET worked
01:28 <jaequery> heh
01:28 <jaequery> wouldve been nice if that was also listed in the docs
01:38 <adam12> jaequery: I used something like this: "inet :address, null: false, unique: true"
01:38 <adam12> I am not sure it's required for docs, as it's postgresql specific.
01:39 <adam12> I think anything not a Ruby class gets passed through to the adapter anyways. So if you used `foo :column_name`, Sequel would try to use `foo` as the column type. jeremyevans might correct me on this.
02:15 filterfish joined
03:44 glennpratt joined
03:46 claw joined
04:13 glennpratt joined
05:23 aidalgol joined
07:00 filterfish_ joined
07:21 jaequery joined
07:42 filterfish joined
08:10 filterfish_ joined
11:44 <Bish> ~ /channel #postgresql
11:44 <Bish> whopsie
13:55 <Bish> i use .filter(:column=>/#{user_input}/) alot, and learned i shouldn't do that
13:55 <Bish> what is a clever way around that
13:58 <Caesium> don't take user input as regexp, would be my view :p
13:58 <Caesium> so hard to do properly
13:58 <Bish> basicially i only need "starts with, ends with, containts"
13:58 <Bish> so regex is way to powerful either way
13:59 <Bish> maybe i should reduce it to string, and use some.. Sequel.ilike or whatever
13:59 <Caesium> I believe sequel will escape that for you and everything, but its still not hard to craft regexps that grind a machine to a halt, from what I gather
13:59 <Caesium> not a regexp expert though
13:59 <Bish> well, i feel the same way
13:59 <Caesium> ilike is good for "starts with" as it can be trivially indexed
13:59 <Caesium> but contains and ends with might be slow
13:59 <Bish> well, even if it is, i think postgres will help me out there
14:00 <Bish> but how would i actually do "containts" and "ends with"
14:00 <Bish> without regexes?
14:03 <Caesium> the wildcard character in LIKE is %
14:03 <Caesium> so append/prepend that to your string
14:03 <Bish> so, Sequel.ilike('%containts%')
14:03 <Bish> so, Sequel.ilike('ends%')
14:03 <Bish> so, Sequel.ilike('%begins') ( just the other way around :p)
14:03 <Bish> ?
14:03 <Bish> well that is simple
14:04 <Caesium> other way around but yes :)
14:04 <Caesium> remember to escape your user input
14:04 <Bish> well, the security doc page doesn't mention like as "scary" function
14:05 <Bish> shouldn't it be safe to put something in there?
14:05 <Caesium> oh, yeah, you're right
14:05 <Caesium> sequel will escape for you
14:06 <Caesium> I think :)
14:52 glennpratt joined
19:18 AYGHOR joined
19:40 AYGHOR joined
22:11 claw joined
22:38 kith joined
23:02 tercenya joined