vsql_http makes HTTP requests from inside a query. A trigger can call a
webhook, a SELECT can enrich rows from an API, and a scheduled event can push
a summary somewhere, with no application layer in between. It is built on
libcurl and returns every response as JSON.
Install
vsql_http.veb is already in the server’s lib/veb/ directory if you installed
VillageSQL with the install script, the Docker image, or a release tarball.
Install it into the server with one statement:
What it adds
Every request function returns one JSON object with four fields:status,
content_type, headers, and content.
Example
Fetch a URL and read two fields out of the response:On VillageSQL 0.0.6 and earlier the response carries the binary character set.
A JSON function or a
JSON column rejects it, so the example above without
its CONVERT fails there with
ERROR 3144 (22032): Cannot create a JSON value from a string with CHARACTER SET 'binary'. Inside JSON_OBJECT() or JSON_ARRAY() it is accepted but
base64-encoded instead. Keep the CONVERT(... USING utf8mb4) on those
versions; it is unnecessary on 0.0.7 and later, and harmless there.See also
- Making HTTP requests from MySQL — timeouts, error handling, and reading the response
- Sending webhooks from MySQL — firing a request from a trigger
- Enriching rows from a REST API — joining a query to an external service
- Install extensions — how
INSTALL EXTENSIONworks and where the server looks for a bundle - Available extensions — the full catalog
- villagesql/vsql-http — source, build instructions, and the known limitations

