From 1b43274d122f7d00bf203b7820bcb18c9c173d07 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 25 Sep 2012 19:57:50 -0400 Subject: [PATCH] Show how to close a connection --- Doc/library/sqlite3.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 978b7603ee5e..1ff75f05f14f 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -42,8 +42,9 @@ and call its :meth:`~Cursor.execute` method to perform SQL commands:: # Save (commit) the changes conn.commit() - # We can also close the cursor if we are done with it - c.close() + # We can also close the connection if we are done with it. + # Just be sure any changes have been committed or they will be lost. + conn.close() The data you've saved is persistent and is available in subsequent sessions:: -- 2.47.3