Red ORM for the Raku language - #red logs are going to be saved on, and later
Set by SmokeMachine on 1 June 2021.
07:41 abraxxa joined, abraxxa left 07:42 abraxxa joined 07:46 abraxxa left 07:47 abraxxa joined 08:56 patrickb joined 13:47 abraxxa left 14:07 ecocode left 14:12 ecocode joined 15:07 ecocode left 15:12 ecocode joined 17:05 samebchase joined
samebchase Hi, I have a Red model, in which a column is of the Json type, and can be null in some situations. When I fetch the rows, I get the "Use of uninitialized value element of type Any in string context." message printed on the console, seems to be coming from where from-json is called on a 17:06
Nil value. What can I do here, to prevent this from being printed. I'm trying various default values, but no luck so far.
My code is similar to
lizmat It's not very busy here, but SmokeMachine hangs out here... :-) 17:10
SmokeMachine samebchase: Sorry, I'll have to take a look at it later today, after day job 17:15
samebchase: could you share how are you using that model to get that error, please? 17:16
samebchase I can share the full code with you on email 17:17
Turns out, its still happening on latest Raku and latest Red (unless I am doing something horribly wrong)
17:25 TempIRCLogger left, TempIRCLogger joined 17:26 TempIRCLogger left, TempIRCLogger joined, TempIRCLogger left, TempIRCLogger joined
samebchase Okay, I have been able to reproduce it, let me share a gist here 17:35 17:38
It happens when a JSON field has a nested field which is NULL. 17:39
Here I was thinking it happens when the entire JSON field itself is NULL
, but this happens on nested fields.
This is PG, btw
SmokeMachine does that work on SQLite as well? 17:41
I mean: does that happens on SQLite as well?
*happen sorry 17:42
just reproduced! 18:09
samebchase: I finally fixed that! sorry for the delay! 21:38