From 896411099e43edb71c50120d5d8163f19a69455e Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 18 Jul 2024 20:34:24 +0200 Subject: [PATCH] Documented the use of delete_where (#630) Documented the use of delete_where, as shown in https://github.com/simonw/sqlite-utils/issues/159 --- docs/python-api.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/python-api.rst b/docs/python-api.rst index 4b446bb..af6cb52 100644 --- a/docs/python-api.rst +++ b/docs/python-api.rst @@ -890,7 +890,8 @@ You can delete all records in a table that match a specific WHERE statement usin >>> db = sqlite_utils.Database("dogs.db") >>> # Delete every dog with age less than 3 - >>> db["dogs"].delete_where("age < ?", [3]) + >>> with db.conn: + >>> db["dogs"].delete_where("age < ?", [3]) Calling ``table.delete_where()`` with no other arguments will delete every row in the table.