Skip to content

Commit

Permalink
added delete_records method
Browse files Browse the repository at this point in the history
  • Loading branch information
henryivesjones committed Oct 13, 2022
1 parent 26a5acf commit adaef22
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
requests
python-dateutil
build
twine
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "community-tulip-api"
version = "0.1.4"
version = "0.1.5"
authors = [
{ name="Henry Jones", email="[email protected]" },
]
Expand Down
13 changes: 13 additions & 0 deletions tulip_api/tulip_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ def delete_record(self, record_id: str):
self._construct_record_path(record_id), "DELETE"
)

def delete_records(self, allow_records_in_use=False):
"""
DELETE `/tables/{tableId}/records`
Deletes all records from a Tulip Table.
"""
# lowercase boolean because the api doesn't like capitalized booleans.
self.tulip_api.make_request_expect_nothing(
self._construct_records_path(),
"DELETE",
params={"allowRecordsInUse": "true" if allow_records_in_use else "false"},
)

def increment_record_column(self, record_id: str, column_id: str, value: int):
"""
PATCH `/tables/{tableId}/records/{recordId}/increment`
Expand Down

0 comments on commit adaef22

Please sign in to comment.