Python - delete all rows

Hi
Is there a way to truncate a table? To delete all rows without having to delete it row by row?
Thank you

You can use query API with DELETE from xxx

Hi Daniel, thank you for the tip

It works, records are deleted, but it gives error after deletion

Traceback (most recent call last):
File "index.py", line 105, in <module>
test1 = base.query("DELETE from Edgelist")
File "/usr/local/lib/python3.7/site-packages/seatable_api/main.py", line 795, in query
data = parse_response(response)
File "/usr/local/lib/python3.7/site-packages/seatable_api/main.py", line 31, in parse_response
raise ConnectionError(response.status_code, response.text)
ConnectionError: [Errno 502] <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.20.2</center>
</body>
</html> 

This is caused by timeout of Nginx. You can ignore the error.

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