diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2022-08-12 07:37:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 07:37:45 (GMT) |
commit | 75299dcab541e4e98603ebfb3f95eb9315c4ac52 (patch) | |
tree | 258b9717ef96c3463d8b26ff19bd5db878782d40 /Doc/includes | |
parent | bfaa071e1c84517ab8fdabc15bf934a67882c09f (diff) | |
download | cpython-75299dcab541e4e98603ebfb3f95eb9315c4ac52.zip cpython-75299dcab541e4e98603ebfb3f95eb9315c4ac52.tar.gz cpython-75299dcab541e4e98603ebfb3f95eb9315c4ac52.tar.bz2 |
[3.10] gh-95273: Improve sqlite3.complete_statement docs (GH-95840) (#95918)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit e6623e7083ce08a247e5df169bcc749f99327823)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Doc/includes')
-rw-r--r-- | Doc/includes/sqlite3/complete_statement.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/Doc/includes/sqlite3/complete_statement.py b/Doc/includes/sqlite3/complete_statement.py deleted file mode 100644 index cd38d73..0000000 --- a/Doc/includes/sqlite3/complete_statement.py +++ /dev/null @@ -1,30 +0,0 @@ -# A minimal SQLite shell for experiments - -import sqlite3 - -con = sqlite3.connect(":memory:") -con.isolation_level = None -cur = con.cursor() - -buffer = "" - -print("Enter your SQL commands to execute in sqlite3.") -print("Enter a blank line to exit.") - -while True: - line = input() - if line == "": - break - buffer += line - if sqlite3.complete_statement(buffer): - try: - buffer = buffer.strip() - cur.execute(buffer) - - if buffer.lstrip().upper().startswith("SELECT"): - print(cur.fetchall()) - except sqlite3.Error as e: - print("An error occurred:", e.args[0]) - buffer = "" - -con.close() |