GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Enhancement request: Add "entrypoint" as an option to `sqlite3.load_extension()` · Issue #103015 · python/cpython Closed Closed Copy link Labels DescriptionEnhancement Request:The current version of Currently in cpython/Modules/_sqlite/connection.c Line 1624 in f2e5a6e
PitchWe add a new second optional import sqlite3 db = sqlite3.connect(":memory:") db.enable_load_extension(True) # Currently, only a single path argument is supported on load_extension() db.load_extension("./lines0") # In this proposal, an optional 2nd entrypoint parameter would be added db.load_extension("./lines0", "sqlite3_lines_no_read_init") db.enable_load_extension(False) I've been building several SQLite extensions, some of which use different entrypoints to enable/disable security sensitive features. For example, in Many of these extensions are also distributed as Python packages, so any extra customizable APIs for loading SQLite extensions is greatly appreciated! WorkaroundThere technically is a workaround for this: A user can use the db = sqlite3.connect(":memory:") db.enable_load_extension(True) db.execute("select load_extension(?, ?)", ["path/to/extension", "entrypoint"]) However, doing so will circumvent the There's also some limitations to the pure SQL
Also in general, it's recommended to avould the SQL load_extension() function altogether:
It's also just a little awkward, having to "eject" to SQL to do something that the Python API could readily support. Linked PRsActivity
MetadataMetadataAssigneesLabelsProjects
MilestoneRelationshipsDevelopmentIssue actions | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |