🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
tbrowder__ hello 00:47
hi 00:48
ho 00:49
tbrowder__ hekko 00:51
SmokeMachine aruniecrisps: Red is always a priority… how can I help? 00:59
librasteve japhb: sorry for slow reply - yes i agree that we have each solved a similar need and I will work to merge them as / when i do incremental changes … the timing column in my README refers to the build time when rebuilding from scratch (which my Dockerfile chains automatically do weekly). 02:25
antononcube: happy that you are using PDF::Extract - it’s deliberately minimal and was written since all I wanted was a fast text dump (and I had never heard of popper either) 02:28
Rog: also github.com/Raku/old-design-docs which I hope is the “maintained archive” 02:35
^^ in which case i guess we need to grab the apocalypse and exegesis and put them here too … or perhaps someone knows better than i what the curation plan is!!!? [i do not like relying on web archive except as a last resort) 02:39
japhb librasteve: No worries, thanks for getting back to me! 03:11
ericst Hello 07:22
Starting out, and I stumbled on something that I don't understand: pastebin.com/SCNvZNnX 07:23
In that exemple, how come the chargers has only one element ?
Thanks in advance 07:24
nahita3882 hi, Hashes store their values in scalar contaners (so they are mutable), therefore the value you reach has an implicit $ sigil in front if you will. Then the assignment to array will treat it as a 1 thing because scalar, hence elems being 1. There are some ways to strip out the container (decontainerize), for example my @a = %h<key>.self or %h<key>[] or %h<key><> or %h<key>{}. Then the array assignment will see 07:37
through and do what you expected
my @a = $x then @a.elems is always 1. my @a = @b then @a.elems is equal to @b.elems 07:38
with decontainerization, the array assignment sees that the Right hand side is a Positional, so it copies elements one by one 07:39
otherwise, if it sees a scalar, it doesn't copy N elements at all -- you can see it doesn't copy by doing, e.g., @chargers[0][1] = -99 and see that %body<Data> is affected too 07:40
maybe this page helps docs.raku.org/language/containers 07:41
ericst Thanks for the explaination 07:42
I will look into it
tbrowder__ hi 12:40
howdy 12:41
antononcube @Nahita Good description. 13:09
aruniecrisps @SmokeMachine So I've been managing with manual migrations for the time being but I feel like there's a disconnect between the ORM schema side of things and the migration side of things. I was wondering if you wanted to pair up on that 14:43
SmokeMachine aruniecrisps: sure, how would you like to do that? 16:10
tbrowder__ \o 16:52
tbrowder__ \o 16:58
tbrowder__ hi 17:00
_grenzo Shh...they're sleeping 18:30
lizmat drops a pin 18:47
aruniecrisps @SmokeMachine I've already forked Red, I'll make a separate branch to work on migrations, and I'll use the github issue discussion as a starting point, but if you could give me an quick and rough idea of how you envision migrations now I think that would be a great starting point 18:55
SmokeMachine aruniecrisps: there is some code written for it behind a “experimental” tag (have you seen that (github.com/FCO/Red/blob/3e318994d1...umod#L90)? 19:46
Maybe we should continue this conversation on #red 19:50
aruniecrisps I don't have irc, i'm trying to get that set up @SmokeMachine 19:52
SmokeMachine I’m adding a new comment on that issue adding what I’m planning for migration… 19:53
Have you ever seen the bin/red? I was planing using that to control migrations… 19:54
(Currently that’s mostly broken…)
aruniecrisps I looked at it once and forgot about it 19:55
tbrowder__ \o 20:03
aruniecrisps hi @tbrowder__! 21:10
SmokeMachine aruniecrisps: I just added this comment there: github.com/FCO/Red/issues/15#issue...1984646787 22:29
does anyone have an opinion about this? github.com/FCO/Red/issues/15#issue...1984646787 22:31
tbrowder__ erg, thnx, but i still can't see my own msgs after i send them 22:50
Voldenet uh, isn't irc client supposed to save the lines you send (since server doesn't send them back to you) 22:52
Voldenet SmokeMachine: I think there should be `red migrate prepare` that would generate "migration commands" (something like `.add-column(:table<x> :type<nvarchar(20)> :name<col>` or `.add-index…`) that would be not specific to any db 23:21
and executing migrations would generate sql commands on the fly 23:22
it's important because user might then migrate the data when `.drop-column(…) .add-column(…)` commands are generated by using `.add-column(…); .raw("update target from tbl1 src join tbl2 target on target.id = src.id"); .drop-column(…)` 23:24
or user may even choose to not drop the column or fool RED into using views as tables 23:25
Ofc, `red generate-migration-script v1 v2` could still generate sql for production dbs 23:26
the flow I described would probably require keeping the old state of the database before applying changes somehow 23:27
SmokeMachine Voldenet: that also makes sense... would you mind to add it on that thread?
I think having the option to edit the SQL important... but what you said also makes sense... 23:28
you could do something like that on my description using the form `red migrate update -e 'MyModel.^migration: { .new-column = .old-col1 . " " . .old-col2 }'`, but using DB change commands instead of data manipulation ones... 23:30
no?
Voldenet migrations very often require manipulations that are hard to describe with migration languages 23:33
SmokeMachine in that case you can use the `red migrate update --sql 'ALTER TABLE my_model ...'` option 23:36
Voldenet also, there's one additional thing, when you use git with multiple people doing migrations, you may not know which changes should be appied 23:37
so, the db needs to track what migrations were applied
I'll describe my thoughts on github 23:39
SmokeMachine the table storing the migration version will do that
please
now thinking about multiple people writing code, maybe the number on the migration path should be an UUID instead of a int... and use a different way to decide the order... 23:42