Last active
June 17, 2022 21:17
-
-
Save patrickbkr/1ac6df804259542fb7ea9ca390296730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Red; | |
model ModX is rw { | |
has UInt $.id is serial; | |
has DateTime $.dt is column{ :nullable }; | |
} | |
red-defaults('Pg', | |
host => Str, | |
dbname => "rcb_dev", | |
user => "patrickb" | |
); | |
#red-defaults "SQLite"; | |
#ModX.^create-table; | |
my ModX $x = ModX.^create: dt => DateTime.now; | |
$x.dt = Nil; | |
$x.^save; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Invocant of method 'utc' must be an object instance of type 'DateTime', | |
not a type object of type 'DateTime'. Did you forget a '.new'? | |
in method deflate at /home/patrickb/repos/RakudoCIBot/../Red/lib/Red/Driver/Pg.pm6 (Red::Driver::Pg) line 218 | |
in block at /home/patrickb/repos/RakudoCIBot/../Red/lib/Red/Driver.pm6 (Red::Driver) line 88 | |
in block at /home/patrickb/repos/RakudoCIBot/../Red/lib/Red/Driver.pm6 (Red::Driver) line 85 | |
in method prepare at /home/patrickb/repos/RakudoCIBot/../Red/lib/Red/Driver.pm6 (Red::Driver) line 82 | |
in method execute at /home/patrickb/repos/RakudoCIBot/../Red/lib/Red/Driver.pm6 (Red::Driver) line 116 | |
in method save at /home/patrickb/repos/Red/lib/MetamodelX/Red/Model.pm6 (MetamodelX::Red::Model) line 451 | |
in method save at /home/patrickb/repos/Red/lib/MetamodelX/Red/Model.pm6 (MetamodelX::Red::Model) line 469 | |
in block <unit> at foo.raku line 19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is what I get when using SQLite: | |
Use of uninitialized value of type DateTime in string context. | |
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. | |
in method deflate at /home/patrickb/repos/RakudoCIBot/../Red/lib/Red/Driver/CommonSQL.pm6 (Red::Driver::CommonSQL) line 884 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment