FCO / Red

A WiP ORM for Raku
Artistic License 2.0
70 stars 27 forks source link

Error using Red. #558

Closed cbk closed 2 years ago

cbk commented 2 years ago

Recently I have been receiving an error on some of my programs which use Red as the DBI. I receive the same error when I try to run the example Red code from the documentation. I'm currently using Raku 2022.04 on a Fedora 36 system. Has there been some change which makes 2022.04 non-compatible?

The error I get is this.... On Red:api<2> references must declaire :model-name (or :model-type) and the references block must receive the model as reference

FCO commented 2 years ago

Hi @cbk ! Sorry about the delay.

That's odd, I don't think there is any conflict (the only Rakudo version that conflicts with Red I know of it 2022.06).

Were you using :api<2> before the error started?

Have you updated your Red version?

Witch example you've run from the documentation?

That error should only happen when one is setting a column as reference without passing the model (https://github.com/FCO/Red/blob/master/lib/Red/Traits.pm6#L97-L99)

has $.other-id is referencing{ Other.id }; # Old deprecated way

has $.other-id is referencing{ *.id, :model<Other> }; # New way on :api<2>

Please, verify if the code is using the old way.

Thanks, Fernando

cbk commented 2 years ago

Thank you! zef upgrade Red fixed the issue! (Guess I need to do that for all my installed Modules...) Things are working again.