Capabilities specific to VillageSQL
Some of what VEF offers has nothing to compare against in the tables below, either because MySQL is built differently or because VillageSQL extension authors needed something PostgreSQL does not give its own extensions.- Keyring access —
vsql::preview::keyringlets an extension read secrets from the server’s keyring. - Extension-private file storage —
vsql::preview::storagegives an extension a managed place on disk. PostgreSQL extensions manage their own files, without a server-side API for it. - Alternative protocol handlers — #299 would let an extension serve clients over something other than the MySQL wire protocol.
How to read the tables
Every row that is not marked Available links the GitHub issue where that
work is tracked and discussed.
Anything marked Available through a preview capability needs
vsql_allow_preview_extensions = ON — see
Preview Capabilities.
C++ and Rust
You can write a VillageSQL extension in either C++ or Rust. VEF is the server-side capability and each SDK is a binding over it; the Rust bindings are newer, so a few capabilities are reachable from C++ only for now.Pluggable interfaces
These interfaces, rather than the hooks further down, are what the best-known PostgreSQL extensions are built on. They are also the part of the framework VEF covers most completely, so start here.on_init() and on_deinit() run inside the extension with no access to the
server, unlike _PG_init. They suit local setup such as choosing
CPU-specific function pointers. Setup that has to talk to the server belongs in
a capability’s populate step instead.
vsql::preview::sql_query has three limits that affect any extension built
around SPI. Statements take no bind parameters, so values have to be escaped by
hand (#627). An
extension gets a single session rather than concurrent ones
(#626). And it
cannot be called from inside a VDF
(#597).
Hook variables
A hook is a point where the server hands control to an extension mid-statement, letting it read or change what the server is about to do. PostgreSQL declares a fixed set of them as global function pointers; the tables below cover all of them, grouped by the stage of query processing each one fires in.Parsing and DDL
Planner
Executor
PostgreSQL extensions that need per-operator detail get it by wrapping
ExecutorRun_hook at the node level. In VEF that is separate work, tracked in
#340.
EXPLAIN
Authentication and security
PostgreSQL extensions use
ClientAuthentication_hook for two different jobs,
and VEF covers one of them. An extension can implement an authentication method
of its own through the vsql::preview::auth capability, which is what
vsql-oauth2 is built on. It cannot yet observe the result of authentication it
did not handle, which is how PostgreSQL’s auth_delay and failed-login trackers
work. That part is
#464.
PostgreSQL maps external identities to database accounts through
pg_ident.conf rather than a hook. The VEF equivalent is
#640.

