]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: normalize SQL style in sqlite3 docs (#96403)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Mon, 29 Aug 2022 22:50:42 +0000 (00:50 +0200)
committerGitHub <noreply@github.com>
Mon, 29 Aug 2022 22:50:42 +0000 (00:50 +0200)
Doc/library/sqlite3.rst

index f6a86e69f1ef905972ccacdea46929e5d6e3d748..31a0e7f0b53e4f8aeb5c1e19bde048f055f636ad 100644 (file)
@@ -387,7 +387,7 @@ Module functions
       ...     print(f"Error message: {unraisable.err_msg}")
       >>> import sys
       >>> sys.unraisablehook = debug
-      >>> cur = con.execute("select 1")
+      >>> cur = con.execute("SELECT 1")
       ZeroDivisionError('division by zero') in callback evil_trace
       Error message: None
 
@@ -1219,7 +1219,7 @@ Cursor objects
              ("row2",),
          ]
          # cur is an sqlite3.Cursor object
-         cur.executemany("insert into data values(?)", rows)
+         cur.executemany("INSERT INTO data VALUES(?)", rows)
 
    .. method:: executescript(sql_script, /)
 
@@ -1237,11 +1237,11 @@ Cursor objects
 
          # cur is an sqlite3.Cursor object
          cur.executescript("""
-             begin;
-             create table person(firstname, lastname, age);
-             create table book(title, author, published);
-             create table publisher(name, address);
-             commit;
+             BEGIN;
+             CREATE TABLE person(firstname, lastname, age);
+             CREATE TABLE book(title, author, published);
+             CREATE TABLE publisher(name, address);
+             COMMIT;
          """)