> ## Documentation Index
> Fetch the complete documentation index at: https://villagesql.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Available Extensions

> Install and manage VillageSQL extensions.

VillageSQL ships with built-in extensions and supports official extensions built and maintained by the VillageSQL team. Install any of them with `INSTALL EXTENSION`.

## Built-in Extensions

<Warning>
  When building from source, only `vsql_complex` and `vsql_simple` are included. To get the full set of bundled extensions, use the [install script](/docs/mysql-8.4/stable/quickstart).
</Warning>

### vsql\_complex

**Status:** Built-in with VillageSQL
**Repository:** [villagesql-server/villagesql/examples/vsql-complex](https://github.com/villagesql/villagesql-server/tree/main/villagesql/examples/vsql-complex)

Complex number data type with full arithmetic support for electrical engineering, signal processing, and scientific computing.

**Features:**

* `COMPLEX` column type for storing complex numbers (a + bi)
* String literal format: `'(real,imaginary)'` (e.g., `'(3.0,4.0)'`)
* Arithmetic: add, subtract, multiply, divide
* Utilities: `complex_real()`, `complex_imag()`, `complex_abs()`, `complex_conjugate()`
* Binary storage: 16 bytes (2 doubles)

**Installation:**

```sql theme={null}
INSTALL EXTENSION vsql_complex;
```

**Example:**

```sql theme={null}
CREATE TABLE signals (
    id INT PRIMARY KEY,
    impedance COMPLEX,
    frequency_response COMPLEX
);

INSERT INTO signals VALUES
    (1, '(50.0,0.0)', '(0.95,0.31)');

SELECT
    complex_abs(impedance) as magnitude,
    complex_add(impedance, frequency_response) as total
FROM signals;
```

## Core Extensions

The following extensions are maintained in separate repositories and must be built and installed separately. Each provides its own installation instructions and documentation.

### vsql\_ai

**Repository:** [villagesql/vsql-ai](https://github.com/villagesql/vsql-ai)

AI-powered SQL functions. AI prompting and embedding functions for SQL queries. `ai_prompt()` supports Anthropic Claude, Google Gemini, OpenAI, and local Ollama; `ai_embedding()` supports Google Gemini, OpenAI, and local Ollama.

### vsql\_crypto

**Repository:** [villagesql/vsql-crypto](https://github.com/villagesql/vsql-crypto)

Cryptographic functions. Hashing (MD5, SHA-1, SHA-256, SHA-512, and more), HMAC, AES encryption, password hashing, and secure random data generation using OpenSSL.

### vsql\_cube

**Repository:** [villagesql/vsql-cube](https://github.com/villagesql/vsql-cube)

N-dimensional box and point type. Store and query geometric boxes and points across up to 100 dimensions, with constructor, accessor, predicate, distance, and geometry functions. Requires VillageSQL 0.0.4.

### vsql\_http

**Repository:** [villagesql/vsql-http](https://github.com/villagesql/vsql-http)

HTTP client functions. Make HTTP requests from SQL queries — GET, POST, PUT, DELETE, PATCH — with JSON responses, plus URL encoding and decoding.

### vsql\_network\_address

**Repository:** [villagesql/vsql-network-address](https://github.com/villagesql/vsql-network-address)

Network address types. IPv4, IPv6, and MAC address data types with validation, comparison, and network operations.

### vsql\_uuid

**Repository:** [villagesql/vsql-uuid](https://github.com/villagesql/vsql-uuid)

UUID data type and functions. Generate and work with UUIDs natively in SQL — v1, v3, v4, v5, v6, and v7 — with a native 16-byte UUID type, timestamp extraction, and comparison.

### vsql\_boolean

**Repository:** [villagesql/vsql-boolean](https://github.com/villagesql/vsql-boolean)

Real boolean type. A proper `STRICTBOOL` column type with standard truth values (`true`/`false`, `yes`/`no`, `on`/`off`, `1`/`0`), 1-byte storage, and correct dump/restore semantics. Includes the aggregates `boolean_sum()`, which returns the count of `TRUE` values in a group as an `INT`, and `boolean_avg()`, which returns the fraction of `TRUE` values (true count ÷ non-null count) as a `REAL`. Both ignore `NULL`s; `boolean_avg()` returns `NULL` for an empty group.

### vsql\_rest

**Repository:** [villagesql/vsql-rest](https://github.com/villagesql/vsql-rest)

REST API server. Expose database tables as live HTTP/HTTPS endpoints — no code required. Configure with `SET GLOBAL`, query tables using URL filters, and call stored functions via `/rpc/`. Preview capability: requires a server started with `--vsql_allow_preview_extensions=ON`.

### vsql\_trgm

**Repository:** [villagesql/vsql-trgm](https://github.com/villagesql/vsql-trgm)

Trigram-based text similarity search. Port of PostgreSQL's `pg_trgm`. Compute similarity scores between strings, find near-matches in a column, and measure word-level similarity — all from SQL. Requires VillageSQL 0.0.4.

### vsql\_fuzzystrmatch

**Repository:** [villagesql/vsql-fuzzystrmatch](https://github.com/villagesql/vsql-fuzzystrmatch)

Fuzzy string matching functions. Port of PostgreSQL's `fuzzystrmatch`. Soundex phonetic codes, Levenshtein edit distance (with configurable costs and early-exit threshold), Metaphone, and Double Metaphone — for name matching, spelling correction, and phonetic deduplication. Requires VillageSQL 0.0.4.

### vsql\_currency

**Repository:** [villagesql/vsql-currency](https://github.com/villagesql/vsql-currency)

ISO 4217 currency code type. A `currency` column type holding any of 164 currency codes in a single byte, with case-insensitive input, canonical uppercase output, alphabetical ordering, and index support. Rust port of `adjust/pg-currency`.

### vsql\_oauth2

**Repository:** [villagesql/vsql-oauth2](https://github.com/villagesql/vsql-oauth2)

OAuth2/OIDC JWT authentication. An account created with `IDENTIFIED WITH vsql_oauth2` authenticates by presenting a JWT instead of a password. The extension verifies the signature against a configured RS256/ES256 public key, checks `exp` — and `iss`/`aud` when configured — then maps a claim to a VillageSQL account. Preview capability: requires a server started with `--vsql_allow_preview_extensions=ON`.

### vsql\_stat\_ch

**Repository:** [villagesql/vsql-stat-ch](https://github.com/villagesql/vsql-stat-ch)

Per-statement telemetry to ClickHouse. Captures one event per finished statement and ships batches over ClickHouse's native protocol (port 9000) or HTTP (port 8123), switchable while the server is running. Preview capability: requires a server started with `--vsql_allow_preview_extensions=ON`.

### vsql\_mcp

**Repository:** [villagesql/vsql-mcp](https://github.com/villagesql/vsql-mcp)

Model Context Protocol server. Exposes the database as a tool surface for AI agents over MCP Streamable HTTP, served by a listener inside the server process. An agent can list schemas, describe tables, and run read-only queries; writes stay off until you enable them. Tool queries run through a dedicated database account, with an optional table allowlist, row caps, and per-call timeouts. Preview capability: requires a server started with `--vsql_allow_preview_extensions=ON`.

## Community Extensions

Community extensions are built by third parties using the VillageSQL Extension Framework (VEF). They are not maintained by the VillageSQL team.

### vsql\_statistics

**Repository:** [ronaldbradford/vsql-statistics](https://github.com/ronaldbradford/vsql-statistics)
**Maintainer:** [Ronald Bradford](https://github.com/ronaldbradford)

Statistical aggregate functions for data analysis. IQR, quartiles, median, and Tukey fence outlier detection. `STATS_IQR` returns them as fields of a JSON object (`$.q1`, `$.q3`, `$.median`, `$.lower_fence`, `$.upper_fence`); read them with `JSON_EXTRACT()`. Requires VillageSQL 0.0.4.

### prometheus\_exporter

**Repository:** [ProxySQL/vsql-prometheus-exporter](https://github.com/ProxySQL/vsql-prometheus-exporter)
**Maintainer:** [ProxySQL](https://github.com/ProxySQL)

Embedded Prometheus metrics exporter. Exposes MySQL server metrics at an HTTP `/metrics` endpoint in Prometheus exposition format — global status, global variables, InnoDB metrics, and replication status.

### vsql\_luhn

**Repository:** [intojhanurag/vsql-luhn](https://github.com/intojhanurag/vsql-luhn)
**Maintainer:** [intojhanurag](https://github.com/intojhanurag)

Luhn algorithm validator and check-digit generator. Validate credit card numbers, IMEI codes, Canadian SINs, and other industry identifiers with `luhn_valid()`, and generate correct check digits with `luhn_checkdigit()`.

### vsql\_nanoid

**Repository:** [intojhanurag/vsql-nanoid](https://github.com/intojhanurag/vsql-nanoid)
**Maintainer:** [intojhanurag](https://github.com/intojhanurag)

NanoID generator for short, URL-safe unique identifiers. `nanoid()` returns a 21-character ID; `nanoid_with(size[, alphabet])` customizes the length and character set. Uses a cryptographically secure random source.

### vsql\_slugify

**Repository:** [intojhanurag/vsql-slugify](https://github.com/intojhanurag/vsql-slugify)
**Maintainer:** [intojhanurag](https://github.com/intojhanurag)

Generates URL-safe slugs from arbitrary text — folding accents, lowercasing, collapsing non-alphanumerics into a single separator, and trimming leading/trailing separators.

### vsql\_pgjwt

**Repository:** [intojhanurag/vsql-pgjwt](https://github.com/intojhanurag/vsql-pgjwt)
**Maintainer:** [intojhanurag](https://github.com/intojhanurag)

Signs, verifies, and decodes JSON Web Tokens directly in SQL. Supports HMAC (HS256, HS384, HS512) and RSA (RS256) algorithms.

### vsql\_address\_standardizer

**Repository:** [jobala/vsql-address-standardizer](https://github.com/jobala/vsql-address-standardizer)
**Maintainer:** [Japheth Obala](https://github.com/jobala)

Parses freeform US postal addresses into their components — house number, street, suffix, city, state & zip. This extension was inspired by PostgreSQL's contrib [address\_standardizer](https://github.com/postgis/address_standardizer).
