A true cascade delete

Options

Hi - would love to see an option that intelligently cascade deletes. Perhaps in the datatable view section include an option to link this primary key to a foriegn key elsewhere; perhaps just more control over definitions.

Then, functions can remain the same as the logic will be respected on the table side-of-the-house.

Is this already a feature? Just thinking from a traditional SQL CASCASDE standpoint.

Thanks!

Tagged:

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    edited April 2023
    Options

    Right now the way to do this is with a custom function that performs your additional tasks. I often advise people toward production to wrap their C/U/D calls in custom functions for the purpose of audit logging and this kind of side-effect management.

    As a side note, I'm a little wary of CASCADE in SQL because while it manages the database domain it doesn't necessarily map to the business logic/needs. A custom function in Xano is parallel making a query with a trigger or stored procedure for managing downstream effects. More work to set up, but often higher control to make sure the business problem is getting solved.

    Also, love the topic! Connecting how no-code maps to ideas from more low-level systems is a mental model that lies behind a lot of what we work on in the hardest 5% of challenges blocking shipping in State Change Pro office hours.