Skip to main content
Install VillageSQL extensions to add custom types, functions, and capabilities to your database.
Custom indexes and aggregate functions for extensions are coming in a future release.

Command Syntax

INSTALL EXTENSION 'extension_name';
Extensions are distributed as .veb (VillageSQL Extension Bundle) files containing compiled libraries and metadata.

Extension Naming Conventions

VillageSQL uses different naming conventions in different contexts:
  • SQL commands: Use underscores: INSTALL EXTENSION 'vsql_complex'
  • Repository names: Use hyphens: github.com/villagesql/vsql-complex
  • File names: Use underscores: vsql_complex.veb
  • manifest.json: Use underscores to match SQL: "name": "vsql_complex"
Example:
# Download from GitHub repo (hyphens in URL)
git clone https://github.com/villagesql/vsql-complex

# But .veb file uses underscores
ls vsql_complex.veb

# Install with underscores
INSTALL EXTENSION 'vsql_complex';

Prerequisites

  • Running VillageSQL Server instance
  • Administrative access (root or equivalent)
  • Extension .veb file in vef_dir (check with SHOW VARIABLES LIKE 'vef_dir';)

Installing Built-in Extensions

Built-in extensions included with VillageSQL are already in the vef_dir. Simply enable them:
-- Connect to VillageSQL
mysql -u root -p

-- Install the extension
INSTALL EXTENSION 'vsql_complex';

Verify Installation

-- List installed extensions
SELECT * FROM INFORMATION_SCHEMA.EXTENSIONS;
Output:
+------------------+-------------------+
| EXTENSION_NAME   | EXTENSION_VERSION |
+------------------+-------------------+
| vsql_complex     | 1.0.0             |
+------------------+-------------------+

Test Functionality

-- Test extension functions
CREATE TABLE test (id INT, value COMPLEX);
INSERT INTO test VALUES (1, COMPLEX(3.0, 4.0));
SELECT complex_abs(value) FROM test;  -- Returns 5.0

DROP TABLE test;

Installing External Extensions

For extensions downloaded or built separately:

1. Find VEF Directory

SHOW VARIABLES LIKE 'vef_dir';
Common locations:
  • Linux: /usr/local/mysql/lib/veb/
  • macOS: /usr/local/mysql/lib/veb/

2. Copy Extension File

# Copy .veb file to vef_dir
sudo cp my-extension.veb /path/to/vef_dir/

# Verify file exists
ls -l /path/to/vef_dir/*.veb

3. Install Extension

INSTALL EXTENSION 'my_extension';

4. Verify Installation

SELECT * FROM INFORMATION_SCHEMA.EXTENSIONS WHERE EXTENSION_NAME = 'my_extension';

Troubleshooting

IssueSolution
Extension not foundVerify .veb file is in vef_dir with correct name
Permission deniedCheck file permissions: chmod 644 extension.veb
For more troubleshooting, see Managing Extensions.

Next Steps