<    April 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
03:28 glennpratt joined
03:57 claw joined
04:30 mikeyhew joined
04:30 mikeyhew left
05:41 aidalgol joined
06:57 mewp joined
09:31 jaequery joined
09:43 jaequery joined
14:12 banditron joined
14:17 banditro_ joined
14:20 glennpratt joined
14:59 glennpratt joined
16:46 jaequery joined
18:02 glennpratt joined
18:21 contradictioned joined
18:25 Arney_ joined
18:25 <Arney_> DB.select { Sequel.lit('d::date') }.from { generate_series(Sequel.lit("timestamp 'now' - interval '30 day'"),Sequel.lit("timestamp 'now'"),Sequel.lit("interval '1 day'")).as(d) }
18:25 <Arney_> jeremyevans: can i get rid of the Sequel.lits there, just curious
18:31 <jeremyevans> Arney_: DB.select{Sequel.cast(:d, Date)}.from{generate_series(Sequel::CURRENT_TIMESTAMP - '30 day', Sequel::CURRENT_TIMESTAMP, Sequel.cast('1 day', :interval)).as(:d)}
18:32 <jeremyevans> Arney_: You may want to use CURRENT_DATE instead of CURRENT_TIMESTAMP, and then drop the cast
18:33 <Arney_> jeremyevans: great, thanks
18:36 <flips> jeremyevans: Do/did you see any apparent error source in my timestamps.rb error yesterday? (https://pastebin.com/dGnBfL13) I switched to a project using rodauth now, but would be interesting to know what went wrong ... :)
18:39 <jeremyevans> flips: I looked into it briefly but could not see why it would happen. If you could reduce it to a minimal self contained example, I could probably debug.
18:45 <flips> jeremyevans: Ok, thanks. Maybe I'll do that a bit later. Trying to built my own datamodels from scratch now (instead of that mrcook blog tutorial example). Made a basic static page app with admin backend protected by rodauth. Will add some models now. :)
18:50 <adam12> jeremyevans: just noticed that my hash_id plugin might not be using the chained dataset module. Should I be calling anything inside my plugin? I was sure everything looked right. https://github.com/adam12/sequel-hash_id/blob/master/lib/sequel/plugins/hash_id.rb
18:50 <adam12> Maybe it's the with_pk or [] method usage?
18:51 <adam12> Nope. with_pk on a normal chain works fine. I must be missing something.
18:51 <jeremyevans> adam12: Unless your hash_id plugin is designed to modify behavior inside dataset_module blocks, you probably don't need to worry about it
18:52 <adam12> jeremyevans: My with_pk method calls are "naked" inside the hash_id plugin - ie, they don't use the scope I've built up before calling the with_hashid finder method in the plugin.
18:53 <jeremyevans> adam12: It does look questionable that dataset.with_hashid calls model.with_hashid instead of the other way around
18:53 <adam12> ie. Model.some_scope_defined_in_dataset_module.with_hashid ignores the first scope method call (in SQL generated)
18:53 <adam12> Hm. Maybe I have the order off?
18:53 <jeremyevans> adam12: that's a bug that would be fixed by having the model method call the dataset method instead of vice versa
18:54 <adam12> Model method is defined in InstanceMethods?
18:54 <jeremyevans> adam12: define those methods in DatasetMethods, use model.hasher in them
18:55 <adam12> Should I move them from ClassMethods then?
18:55 <adam12> ie - leave ClassMethods empty? or just use the def_dataset_methods call in it.
18:55 <jeremyevans> adam12: to define the class methods, use Plugins.def_dataset_methods(self, :with_hashid, :with_hashid!)
18:56 <jeremyevans> adam12: hasher will probably still need to be in ClassMethods
18:56 <adam12> Yeah.
18:57 <adam12> I wonder how I can get access to the ClassMethods from DatasetMethods.
18:58 <jeremyevans> adam12: as I said above, call model.hasher inside the dataset methods
18:58 <adam12> Thanks - I missed that.
19:04 <adam12> That did it.
19:35 <foxxx0> hey
19:35 <foxxx0> i'm having some trouble with prepared statements
19:35 <foxxx0> somehow the result set is way too small
19:36 <foxxx0> it returns only 4 rows where it should be ~346
19:36 <foxxx0> using the query with inserted hardcoded parameters works fine and returns everything i wanted
19:36 <jeremyevans> foxxx0: can you produce a minimal self contained example showing the problem?
19:36 <foxxx0> dunno if it occurs with simpler database structures
19:37 <foxxx0> i can just upload what i got
19:38 <foxxx0> https://paste.foxxx0.de/m-s6xK/#n-RV7-27
19:39 <foxxx0> i was trying to create the prepared statement during bootup
19:39 <foxxx0> as it states in the docs that creating those has a performance penalty
19:40 <foxxx0> i'm quite sure there is something wrong with the way I'm using the prepared statement through sequel
19:40 <foxxx0> sadly i didn't find a useful example in the docs showing the usage of prepared statements with custom sql queries
19:41 <foxxx0> oh wait
19:41 <foxxx0> that is the wrong query
19:41 <foxxx0> my bad
19:42 <jeremyevans> my work here is done :)
19:42 <foxxx0> nah
19:42 <foxxx0> just in the paste
19:42 <jeremyevans> doh!
19:42 <adam12> lol
19:42 <foxxx0> https://paste.foxxx0.de/m-oDCD/
19:42 <foxxx0> there is the correct one
19:43 <foxxx0> both the one i'm trying to use as a prepared statement and the debug version wich returns all desired rows
19:43 <jeremyevans> foxxx0: can you paste an SQL log for both the dataset and prepared statement loads?
19:43 <foxxx0> how do i turn that on?
19:44 <jeremyevans> foxxx0: db.loggers << Logger.new($stdout)
19:44 <foxxx0> alright, one sec
19:48 <foxxx0> https://paste.foxxx0.de/m-qkId3/
19:48 <foxxx0> looks to me exactly the same
19:49 <foxxx0> so it should^tm produce equal results
19:50 <foxxx0> oh hang on
19:50 <jeremyevans> looks like the values are different
19:50 <foxxx0> yes
19:50 <foxxx0> just spotted that
19:55 <foxxx0> hm ok nvm
19:56 <foxxx0> it seems it was me derping with actual parameter values
19:58 <foxxx0> oooohhhhhhh
19:58 <foxxx0> mm((((
20:17 <foxxx0> alright
20:17 <foxxx0> if I don't derp in the parameter calculation, everything works as expected
20:18 <jeremyevans> foxxx0: Yay!
20:18 <foxxx0> thanks anyway :D
20:19 <foxxx0> i'm really enjoying the simplicity of sinatra and sequel
21:10 banditron joined
22:11 GitHub113 joined
22:11 <GitHub113> [13sequel] 15jmettraux opened pull request #1334: Indicate in error message which is the file with the empty migration (06master...06master) 02https://git.io/vSi7Y
22:11 GitHub113 left
22:17 GitHub149 joined
22:17 <GitHub149> [13sequel] 15jeremyevans commented on issue #1334: Thanks for the patch. This looks good to me. I'll merge and test and assuming no problems it should be pushed up to GitHub shortly. 02https://git.io/vSi7A
22:17 GitHub149 left
22:34 GitHub146 joined
22:34 <GitHub146> [13sequel] 15jeremyevans closed pull request #1334: Indicate in error message which is the file with the empty migration (06master...06master) 02https://git.io/vSi7Y
22:34 GitHub146 left
22:34 GitHub77 joined
22:34 <GitHub77> [13sequel] 15jeremyevans pushed 3 new commits to 06master: 02https://git.io/vSidh
22:34 <GitHub77> 13sequel/06master 14b3efee5 15John Mettraux: Check migration error message upon empty migration
22:34 <GitHub77> 13sequel/06master 140a1a2f4 15John Mettraux: Indicate in error which file is an empty migration
22:34 <GitHub77> 13sequel/06master 149f9f6c8 15Jeremy Evans: Don't change specs for migration filename...
22:34 GitHub77 left
23:16 GitHub124 joined
23:16 <GitHub124> [13sequel] 15jmettraux commented on commit 149f9f6c8: My commit did not drop checking the exception class. 02https://git.io/vSipZ
23:16 GitHub124 left
23:18 GitHub86 joined
23:18 <GitHub86> [13sequel] 15jeremyevans commented on commit 149f9f6c8: Sorry, that was my mistake. But in general in Sequel we do not check exception messages as it makes the specs too brittle. 02https://git.io/vSipB
23:18 GitHub86 left
23:19 GitHub46 joined
23:19 <GitHub46> [13sequel] 15jmettraux commented on commit 149f9f6c8: Thanks for taking the time to explain. 02https://git.io/vSip2
23:19 GitHub46 left