[New-bugs-announce] [issue43454] [sqlite3] Add support for R*Tree callbacks
Erlend Egeberg Aasland
report at bugs.python.org
Tue Mar 9 16:54:25 EST 2021
New submission from Erlend Egeberg Aasland <erlend.aasland at innova.no>:
Ref. bpo-43440
Now that both Windows and macOS builds compile SQLite with R*Tree support, we should consider adding support for R*Tree callbacks.
SQLite has two API's:
- sqlite3_rtree_query_callback() for SQLite 3.8.5 and newer.
- sqlite3_rtree_geometry_callback() for SQLite pre 3.8.5.
I suggest using the new API only, because it is more flexible, and it is also the one recommended by SQLite.
See https://sqlite.org/rtree.html
Python API:
sqlite3.Connection.create_rtree_query_function()
Too long function name?
As for the callback spec, I'm not sure what's the most pythonic approach?
callback(coords, *params, **query_info):
coords # array of coordinates of node or entry to check
*params # parameters passed to the SQL function
**query_info # the rest of the relevant sqlite3_rtree_query_info members
return (visibility, score)
----------
components: Library (Lib)
messages: 388391
nosy: berker.peksag, erlendaasland
priority: normal
severity: normal
status: open
title: [sqlite3] Add support for R*Tree callbacks
type: enhancement
versions: Python 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43454>
_______________________________________
More information about the New-bugs-announce
mailing list