Deeply nested sub tables not displayed in table list in Database Updater

Something I’m quite new to and would like a little advice on when to use sub tables and multi relation tables for a common example lets look at Reddit or Facebook groups.

You have users > group / reddit > posts > comments

Which of these should be what the main thing that’s tripping me up is when we are querying the data or insert and update we can only directly access 1 level of nesting for example if users was a normal table and then the rest are multi relations or subtables in this example we can only select users or the group / reddit as a start point. So what if all I want to insert is just a comment etc or should the structure be more like:

users
group / reddit (with a relation to users)
posts (relation to users and group / reddit)
comments (multi-relation of posts to link the user)

Are we only allowed to query insert and update into 1 nesting level by design?

Maybe this will help:

Also yes you can have multiple nested queries:

And also nested updates:

Which can be accomplished even easier with the new Form Repeat component:

@George thanks for the links I had actually seen these but none show more than one table for example:


All that shows in a insert, update or query is:
Screenshot 2022-04-25 at 17.29.39
now even if a add groups in groups I can add posts but then posts doesn’t even show comments

So what im lost on is how would I just add a comment to a post without having to update the other tables etc. I’m thinking maybe im trying to use subtables too much here? maybe this is user error?

Why groups are connected to users and then have posts? What’s logical explanation behind it?

A group is created by a user and once the user is deleted the group should also be deleted etc.

Well obviously it’s up to you to design application and data logic how you want it but I would think about it twice: for instance you have a very popular group with many posts and many comments. Now when user will be delete all this will be deleted as well. Sounds kind’a odd.

The database view looks good with all nesting. You are probably in advanced view as all linking references are displayed as well.

In the database Updater you are updating one table per update level. So when you go the first level popup and add the subtable, you can open the sub table dialog by double clicking it and there in the nested dialog you can choose the next level and fields to be updated and so on.

This is a update action but I can’t find a way to get to comments even going through parent tables:

Ah good catch. Seems nested sub tables with more than one level aren’t displayed in the available tables list dropdown.

Will be fixed in the next update.

2 Likes

This has been fixed in Wappler 4.8.3

This topic was automatically closed after 2 days. New replies are no longer allowed.