Perl 6 - the future is here, just unevenly distributed

IRC log for #askriba, 2017-09-08

| Channels | #askriba index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
04:04 dboehmer_ joined #askriba
08:25 Relequestual joined #askriba
08:44 Releques_ joined #askriba
12:20 ashimema just been asked an interesting one by a colleague
12:21 ashimema is there a nice dbic way of saying 'Order by the order of values in a SQL IN() clause'
12:21 ashimema that's portable.. (all the answers he's come up with rely on passing an sql literal with mysql only (I think) sql
12:24 ashimema as an example.. we got to: `->search({ borrowernumber => [5, 3, 1] }, { order_by => \[ "field(borrowernumber, 5, 3, 1)" ]});`
13:17 ribasushi a "neat" builtin way - no
13:18 ribasushi but it's not hard to have a function which you pass a list of ordered values, and a column name, and it spits out a programmatically built \[ CASE IF... ] chain that returns the correct "number" for each value
13:19 ribasushi then you plug the output of that into order_by and that's it
13:22 * ashimema passes that on and tells the original person who asked to get his ass in here ;)
13:22 ashimema seems he understood that first time.. thanks riba
13:22 ribasushi ashimema: you can always pass a link: https://irclog.perlgeek.de/askriba/2017-09-08#i_15135525
13:23 ashimema :)
13:23 ashimema that's a very helpful log.. as I was just wondering how I could find trace of a conversation I'm sure I had with you recently but can't for the life of me find now :)
13:24 * ashimema needs to centralise his IRC :(.. looks like that conversation must have been a pm on another pc :(
13:27 Topic for #askriba is now Where random Perl5-related questions get definitive answers. Conversation log: https://is.gd/askriba_irclog (searchable). Currently no preset business hours due to low demand: just highlight my name and I'll answer ASAP \o/
13:27 ribasushi ashimema: thanks for reminding me, currently it is only mentioned on join
13:28 ashimema :)
15:50 karjala_ joined #askriba
15:53 karjala_ Hello, I have a question.
15:53 karjala_ I generate my schema classes, which I think is ok
15:53 karjala_ with Schema::Loader
15:55 karjala_ a table has a FOREIGN KEY, and it causes a has_many relationship to be generated. However I'd like to *modify* slightly that relationship, with cascade_delete => 0 (since cascading is handled by the database itself and I don't want perl to issue an extra DELETE)
15:55 karjala_ But if I modify that line, I break the "checksum", and then regeneration of the schema will either fail, or overwrite my modification
15:55 karjala_ What should I do? How should I handle that?
15:56 karjala_ thanks
16:03 ribasushi karjala_: re-declare the relationship with the same name after the "it's ok to write here" lines
16:03 ribasushi karjala_: it's not ideal but that's the best you can currently do
16:03 karjala_ thanks
16:03 ribasushi you can *also* ask S::L to alter the thing it writes out ( there are options for that )
16:04 karjala_ ok
16:04 ribasushi but that's way more involved than what is justified in your single one-off case
16:04 karjala_ like "please dont write relationships"?
16:04 karjala_ i see
16:04 ribasushi no "write the rel names foo_bar using these options instead"
16:04 ribasushi s/names/named/
21:32 karjala_ joined #askriba
22:15 vanstyn__ joined #askriba
22:22 haarg joined #askriba
22:23 dboehmer joined #askriba
22:27 SysPete joined #askriba
22:27 frew joined #askriba

| Channels | #askriba index | Today | | Search | Google Search | Plain-Text | summary