SundeedQLite icon indicating copy to clipboard operation
SundeedQLite copied to clipboard

Can't delete object with array of sub objects

Open starletsky opened this issue 1 year ago • 0 comments

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.

starletsky avatar Jul 25 '24 16:07 starletsky