Skip to content

Instantly share code, notes, and snippets.

@samebchase
Created January 14, 2022 17:38
Show Gist options
  • Save samebchase/48107b480d771d42bb00771bb4520fdf to your computer and use it in GitHub Desktop.
Save samebchase/48107b480d771d42bb00771bb4520fdf to your computer and use it in GitHub Desktop.
test_json_values.new(j_field => ${:foo(1)}, k_val => Any)
{foo => 1}
test_json_values.new(j_field => Any, k_val => ${:foo(1)})
(Any)
Use of uninitialized value element of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in sub from-json at /Users/samuel/.rakubrew/versions/moar-2021.12/install/share/perl6/site/sources/EA6CA341123ECF37C6657DBCBE16F4B077343BB6 (JSON::Fast) line 722
test_json_values.new(j_field => Any, k_val => ${:foo(Any)})
(Any)
model test_json_values is table<test_json_values> is export {
has Json $.j_field is column;
has Json $.k_val is column;
}
sub fetch-nullable-json-values() is export {
for test_json_values.^all -> $val {
say $val;
say $val.j_field;
}
}
--
-- > select * from test_json_values;
-- j_field | k_val
-- -------------+----------------
-- {"foo" : 1} |
-- | {"foo" : 1}
-- | {"foo" : null}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment