mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
Docs: normalize SQL style in sqlite3 docs (GH-96403)
(cherry picked from commit 6d403e264a
)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
882c7cf4c7
commit
4cfb6395e1
1 changed files with 7 additions and 7 deletions
|
@ -384,7 +384,7 @@ Module functions
|
||||||
... print(f"Error message: {unraisable.err_msg}")
|
... print(f"Error message: {unraisable.err_msg}")
|
||||||
>>> import sys
|
>>> import sys
|
||||||
>>> sys.unraisablehook = debug
|
>>> sys.unraisablehook = debug
|
||||||
>>> cur = con.execute("select 1")
|
>>> cur = con.execute("SELECT 1")
|
||||||
ZeroDivisionError('division by zero') in callback evil_trace
|
ZeroDivisionError('division by zero') in callback evil_trace
|
||||||
Error message: None
|
Error message: None
|
||||||
|
|
||||||
|
@ -1206,7 +1206,7 @@ Cursor objects
|
||||||
("row2",),
|
("row2",),
|
||||||
]
|
]
|
||||||
# cur is an sqlite3.Cursor object
|
# cur is an sqlite3.Cursor object
|
||||||
cur.executemany("insert into data values(?)", rows)
|
cur.executemany("INSERT INTO data VALUES(?)", rows)
|
||||||
|
|
||||||
.. method:: executescript(sql_script, /)
|
.. method:: executescript(sql_script, /)
|
||||||
|
|
||||||
|
@ -1224,11 +1224,11 @@ Cursor objects
|
||||||
|
|
||||||
# cur is an sqlite3.Cursor object
|
# cur is an sqlite3.Cursor object
|
||||||
cur.executescript("""
|
cur.executescript("""
|
||||||
begin;
|
BEGIN;
|
||||||
create table person(firstname, lastname, age);
|
CREATE TABLE person(firstname, lastname, age);
|
||||||
create table book(title, author, published);
|
CREATE TABLE book(title, author, published);
|
||||||
create table publisher(name, address);
|
CREATE TABLE publisher(name, address);
|
||||||
commit;
|
COMMIT;
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue