Skip to content

Commit 2278dc7

Browse files
miss-islingtonErlend Egeberg Aasland
and
Erlend Egeberg Aasland
authored
gh-95273: Condense sqlite3 executescript example (GH-95383) (#95419)
(cherry picked from commit e9c8de6) Co-authored-by: Erlend Egeberg Aasland <[email protected]>
1 parent f59a5c5 commit 2278dc7

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

Doc/includes/sqlite3/executescript.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

Doc/library/sqlite3.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,16 @@ Cursor Objects
813813

814814
*sql_script* must be a :class:`string <str>`.
815815

816-
Example:
816+
Example::
817817

818-
.. literalinclude:: ../includes/sqlite3/executescript.py
818+
# cur is an sqlite3.Cursor object
819+
cur.executescript("""
820+
begin;
821+
create table person(firstname, lastname, age);
822+
create table book(title, author, published);
823+
create table publisher(name, address);
824+
commit;
825+
""")
819826

820827

821828
.. method:: fetchone()

0 commit comments

Comments
 (0)