Skip to content

Can't delete object with array of sub objects #20

@starletsky

Description

@starletsky

Simple explanation

class Main: ... {
    var subObjects: [SubObject] = []
}

class SubObject: ... {
    var subSubObjects: [SubSubObject] = []
}

class SubSubObject: ... {
    ...
}

var obj = Main()
obj.subObjects = [SubObject(), SubObject(), SubObject(), SubObject(), SubObject()]

If i'll try to delete main object like this
try? await obj.delete(deleteSubObjects: true)

In function
func deleteFromDB<T: SundeedQLiter>(object: T, deleteSubObjects: Bool) async throws
at line 248 and 249 it will never goes further
because map.columns.values contains array of SundeedQLiter and not object of SundeedQLiter

And one more, i think it wont delete 3rd nested objects, because there are no recursive call to check values in sub objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions