Skip to main content
Install VillageSQL extensions to add custom types, functions, and capabilities to your database.

Command Syntax

When VERSION is supplied, the server opens {name}-{version}.veb, compares the version against the manifest, and aborts if they differ:
Omit the clause to install {name}.veb, or — if only versioned VEBs are present — the unique {name}-{version}.veb. See Selecting a Version.
Extensions are distributed as .veb (VillageSQL Extension Bundle) files containing compiled libraries and metadata.

Selecting a Version

VEB files in veb_dir may be named either {name}.veb (unversioned) or {name}-{version}.veb (versioned). To install a specific versioned VEB, add a VERSION clause:
With VERSION, the server opens vsql_uuid-0.2.0.veb and verifies that the version in its manifest.json matches 0.2.0. Without VERSION, the server resolves the file as follows:
  • If {name}.veb exists, install it; the version is read from its manifest.json.
  • Otherwise, if exactly one {name}-{version}.veb exists, install it; the version in the filename is verified against its manifest.json.
  • Otherwise, the install fails and you must specify a version.
If multiple versioned VEBs are present and no unversioned VEB exists, INSTALL EXTENSION fails with Multiple versions of extension '<name>' found in '<dir>'; specify a version with INSTALL EXTENSION <name> VERSION 'x.y.z'. Re-run with an explicit VERSION clause.

Extension Naming Conventions

VillageSQL uses different naming conventions in different contexts:
  • SQL commands: Use underscores: INSTALL EXTENSION vsql_uuid
  • Repository names: Use hyphens: github.com/villagesql/vsql-uuid
  • File names: Use underscores: vsql_uuid.veb
  • manifest.json: Use underscores to match SQL: "name": "vsql_uuid"
Example:

Required Privilege

INSTALL EXTENSION, UNINSTALL EXTENSION, and ALTER EXTENSION are guarded by the EXTENSION_ADMIN dynamic privilege. These statements load native extension code into the running server, so they require an administrative privilege and are not available to unprivileged accounts. EXTENSION_ADMIN is a dynamic privilege granted at the global scope (ON *.*):
SUPER is accepted as a fallback for backward compatibility, so an account that already holds SUPER can run these statements without a separate grant. A data directory created by --initialize or --initialize-insecure grants EXTENSION_ADMIN to root@localhost directly, so a new server needs no manual grant. When an existing data directory is upgraded in place, every user account holding SUPER is granted EXTENSION_ADMIN — but only if no account holds it already, so a server upgraded once is not backfilled again on later upgrades. The reserved mysql.* system accounts are excluded. An account with neither privilege is rejected before any extension work begins:
Revoke the privilege the same way:
A revoke takes effect immediately, not on the next connection. The server checks EXTENSION_ADMIN/SUPER against the account’s current grants on every extension DDL statement, so an existing session does not keep the privilege after a revoke — its very next statement fails with the same ERROR 1227 (42000) shown above.

Prerequisites

  • Running VillageSQL Server instance
  • Administrative access (root or equivalent)

Installing Built-in Extensions

Built-in extensions included with VillageSQL are already in the veb_dir. Simply enable them:

Verify Installation

Output:

Test Functionality

Installing External Extensions

For extensions downloaded or built separately:
Your server must have veb_dir configured before you can install external extensions. See Configuring veb_dir.

1. Copy the .veb File

Find your server’s extension directory, then copy the .veb file into it:

2. Install Extension

To pin the expected version — useful in CI or scripted rollouts — include the VERSION clause:
If the manifest reports a different version, the install fails and nothing is registered:
This is the fallback-file path (no {name}-{version}.veb exists) — a different code path from the Version mismatch in '<file>' error shown earlier, which fires when the versioned file itself exists.

3. Verify Installation

Troubleshooting

For more troubleshooting, see Managing Extensions.

Next Steps

Managing Extensions

Monitor and troubleshoot installed extensions

Available Extensions

Browse extensions you can install

Create Extensions

Build your own extensions