VillageSQL is a drop-in replacement for MySQL with extensions.
All examples in this guide work on VillageSQL. Install Now →
This guide uses a preview capability. Start the server with
--vsql_allow_preview_extensions=ON, or INSTALL EXTENSION is refused.vsql_rest extension serves those tables from inside the server process instead, so there is no second process and no new deployment.
The defaults are built for a developer machine, not for a network. Read “Before you expose the port” below before you open it to anything.
Turning it on
vsql_rest.schema_ttl seconds, 60 by default, so a table created afterwards answers table not found until that cache expires.
Reading
A table is a path, and the query string does the filtering. Each filter iscolumn=operator.value:
or=(...):
limit and offset:
eq, neq, lt, lte, gt, gte, like, cs_like, in and is. in takes a list, as in ?id=in.(1,3), and is takes null, as in ?price=is.null or ?price=is.not.null. A request with no limit returns at most vsql_rest.max_rows rows, which starts at 1000.
The allowlist
A table that is not onallowed_tables does not exist as far as the API is concerned:
Restricting methods per table
table_methods says which HTTP methods each table accepts, as table:METHOD,METHOD with a | between tables:
Watching it work
Five status counters report on the listener, including the port it actually bound:http_port reads 0 when nothing is listening, which is the quickest way to tell whether the listener started. Setting vsql_rest.port to 0 asks the operating system to choose a port, and this counter is where you read which one it chose.
Before you expose the port
The defaults leave the door open, and each one is reasonable alone.require_auth starts at OFF, so no request carries or needs a token. An empty allowed_tables publishes the whole schema. An empty table_methods allows every method, including DELETE, and a DELETE against a listener in that state succeeds:
ssl_cert and ssl_key. There is no bind-address setting, and the listener binds every interface from the moment it starts, so block the port at the firewall and let only a reverse proxy reach it.
Troubleshooting
See also
- Making HTTP Requests from SQL — the same server calling out instead of answering
- Enriching Rows with External API Data — joining a query to someone else’s API
- MySQL Security Hardening — what else to close before a port is reachable

