Database structure LIST and nullable YES combined with direct database query

Options

Hi Guys,

I think i'm running into a small bug.

https://www.loom.com/share/81afc4273c4f4033a5136f2284d975a5

The issue is database tables with columns of the structure LIST with nullable set to YES. If you query records in that table with the direct database query and any record within the set has a NULL value in one of those structure LIST columns it throws a nasty error.

Answers

  • Bas van Ginkel
    Options

    To add some background (without distracting from the main issue).

    We're running a few direct database queries to speed up a synchronisation method we're running. We would like to have those fields set to nullable = YES since we want to use a direct database link in our endpoints as much as possible. Work agreement with our frontend team is that they only send us fields that have been updated.

    A field with list/nullable will render as NULL if the input is not set in a API endpoint. Otherwise it will render as []. If the frontend want me to clear said field it will send it as []. So if I can't set it to list/nullable then I can differentiate between the frontend wanting to clear the field of the frontend not having send the field.

  • Bas van Ginkel
    Options

    I think this issue became visible since adding a row through the XANO interface will populate that field with a NULL value.

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    Options

    Hey @Bas van Ginkel! I was able to reproduce the issue. I'll bring it up to the team and keep you posted. Thank you for flagging this! 🙏

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    edited November 2023
    Options

    Hey @Bas van Ginkel!

    Quick update on this: Our team is aware of the issue. Due to the complexity of implementing the fix, the rollout may take a little while. I'll make sure to keep you in the loop with any updates.