Is there anyway to delete/destroy all

Is there anyway to delete/destroy all records from a specific table?
15 Replies
Prastoin
Prastoin2mo ago
Hey, what do you mean by table exactly pg ones ? a specific object or view ?
Pedro Magalhães
Pedro MagalhãesOP2mo ago
A object I need to recreate a custom object, orders.
Prastoin
Prastoin2mo ago
If it's a custom object you should be able to delete the whole object resulting in all records destruction If not you can use the batch delete and batch destroy
Pedro Magalhães
Pedro MagalhãesOP2mo ago
Yep! But If do so, I will lost the metadata for recreate it
Prastoin
Prastoin2mo ago
Indeed What do you mean by ordering exactly ? The positions ?
Pedro Magalhães
Pedro MagalhãesOP2mo ago
I mean, Orders... It's a custom object that holl all orders not "ordering"
Prastoin
Prastoin2mo ago
Haha ok
Pedro Magalhães
Pedro MagalhãesOP2mo ago
I just want to truncate the custom object. Thr batch delete/destroy seems the way to go.
Prastoin
Prastoin2mo ago
Exactly
Pedro Magalhães
Pedro MagalhãesOP2mo ago
Could u me point the doc?
Prastoin
Prastoin2mo ago
Do you want it to be done programmatically or would a one shot UI trick do the trick for you ?
Pedro Magalhães
Pedro MagalhãesOP2mo ago
Both works for me. Is it possible to do it from UI?
Prastoin
Prastoin2mo ago
I think so, unsure about how behaves the select all on top left and pagination About to give it a try locally Anyway, you should be able to find two mutations: - deleteManyOrders ( soft deletion ) - destroyManyOrders ( hard delete ) In your core API playground There's might be a programmatic max threshold on how many records can be passed might have to loop over pagination
Pedro Magalhães
Pedro MagalhãesOP2mo ago
OK dokey! taks! tks!
Prastoin
Prastoin2mo ago
Yw ! feel free to reach out

Did you find this page helpful?