diff options
| author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2022-08-31 05:54:54 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-31 05:54:54 (GMT) |
| commit | f7e7bf161aaec5a5cffdcec7c97e1f09e445421b (patch) | |
| tree | e9d339cca5899de4dd2fed407baad75af2631d96 /Doc/includes/sqlite3/load_extension.py | |
| parent | 8ba22b90cafdf83d26318905a021311c6932d2c0 (diff) | |
| download | cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.zip cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.gz cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.bz2 | |
gh-96414: Inline code examples in sqlite3 docs (#96442)
Diffstat (limited to 'Doc/includes/sqlite3/load_extension.py')
| -rw-r--r-- | Doc/includes/sqlite3/load_extension.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/Doc/includes/sqlite3/load_extension.py b/Doc/includes/sqlite3/load_extension.py deleted file mode 100644 index 624cfe2..0000000 --- a/Doc/includes/sqlite3/load_extension.py +++ /dev/null @@ -1,28 +0,0 @@ -import sqlite3 - -con = sqlite3.connect(":memory:") - -# enable extension loading -con.enable_load_extension(True) - -# Load the fulltext search extension -con.execute("select load_extension('./fts3.so')") - -# alternatively you can load the extension using an API call: -# con.load_extension("./fts3.so") - -# disable extension loading again -con.enable_load_extension(False) - -# example from SQLite wiki -con.execute("create virtual table recipe using fts3(name, ingredients)") -con.executescript(""" - insert into recipe (name, ingredients) values ('broccoli stew', 'broccoli peppers cheese tomatoes'); - insert into recipe (name, ingredients) values ('pumpkin stew', 'pumpkin onions garlic celery'); - insert into recipe (name, ingredients) values ('broccoli pie', 'broccoli cheese onions flour'); - insert into recipe (name, ingredients) values ('pumpkin pie', 'pumpkin sugar flour butter'); - """) -for row in con.execute("select rowid, name, ingredients from recipe where name match 'pie'"): - print(row) - -con.close() |
