> ## 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.

# System Reference

> VillageSQL system views and variables for querying extension metadata and server state

Query extension metadata and server state using the standard SQL interfaces below.

***

## System Views

### INFORMATION\_SCHEMA.EXTENSIONS

Lists all currently installed VillageSQL extensions.

<Note>
  `INSTALL EXTENSION` and `UNINSTALL EXTENSION` are VillageSQL SQL extensions.
  They are not part of standard MySQL 8.4 syntax.
</Note>

**Known columns:**

| Column              | Type    | Description                              |
| ------------------- | ------- | ---------------------------------------- |
| `EXTENSION_NAME`    | varchar | Name of the installed extension          |
| `EXTENSION_VERSION` | varchar | Version string reported by the extension |

**Example:**

```sql theme={null}
-- Install an extension (VillageSQL-specific syntax)
INSTALL EXTENSION vsql_complex;

-- List all installed extensions
SELECT * FROM INFORMATION_SCHEMA.EXTENSIONS;

-- Check a specific extension's version
SELECT EXTENSION_VERSION
FROM INFORMATION_SCHEMA.EXTENSIONS
WHERE EXTENSION_NAME = 'vsql_complex';
```

**Illustrative output** (actual version strings depend on installed extensions):

```
+------------------+-------------------+
| EXTENSION_NAME   | EXTENSION_VERSION |
+------------------+-------------------+
| vsql_complex     | 0.0.1             |
| vsql_uuid        | 0.2.1             |
+------------------+-------------------+
```

`EXTENSION_NAME` values are lowercase, matching the name passed to `make_extension()`.

The view reflects the current installed state.

***

### INFORMATION\_SCHEMA.COLUMNS (Custom Types)

Columns using custom extension types are visible through the standard
`INFORMATION_SCHEMA.COLUMNS` view. Custom types appear as
`extension_name.type_name` in the `DATA_TYPE` and `COLUMN_TYPE` columns
(e.g., `vsql_complex.COMPLEX`).

**Example:**

```sql theme={null}
-- Find all columns using custom extension types
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE LIKE '%.%'
ORDER BY TABLE_SCHEMA, TABLE_NAME;

-- Find columns using a specific extension's types
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE LIKE 'vsql_complex.%';
```

**Sample Output:**

```
+--------------+------------+-------------+---------------------+
| TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | DATA_TYPE           |
+--------------+------------+-------------+---------------------+
| mydb         | signals    | impedance   | vsql_complex.COMPLEX|
| mydb         | signals    | frequency   | vsql_complex.COMPLEX|
+--------------+------------+-------------+---------------------+
```

***

## Common Queries

### Find Extension Dependencies

Find which columns use a specific extension's types before uninstalling:

```sql theme={null}
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE LIKE 'vsql_complex.%';
```

### List All Extensions and Their Custom Type Columns

```sql theme={null}
-- All installed extensions
SELECT EXTENSION_NAME, EXTENSION_VERSION
FROM INFORMATION_SCHEMA.EXTENSIONS
ORDER BY EXTENSION_NAME;

-- All columns using custom types across all extensions
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE LIKE '%.%'
ORDER BY DATA_TYPE, TABLE_SCHEMA, TABLE_NAME;
```

### Find Tables Using Extension Types

```sql theme={null}
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE LIKE 'vsql_complex.%'
ORDER BY TABLE_SCHEMA, TABLE_NAME;
```

***

## System Variables

### veb\_dir

Read-only at runtime. Path to the directory where the server looks for `.veb` extension bundle files. Set in `my.cnf` under `[mysqld]`; cannot be changed without a server restart.

```sql theme={null}
SHOW VARIABLES LIKE 'veb_dir';
```

**Scope:** Global, read-only at runtime. Configure in `my.cnf`:

```ini theme={null}
[mysqld]
veb_dir=/path/to/extensions/
```

Only a single directory is supported. See [Managing Extensions](/docs/mysql-8.4/0.0.3/managing) for placement and troubleshooting.

***

### villagesql\_server\_version

Read-only global variable. Returns the VillageSQL version string compiled
into the server binary. This is distinct from `villagesql_schema_version`,
which tracks the internal metadata catalog version.

```sql theme={null}
SELECT @@villagesql_server_version;
-- Example output: 0.0.3

-- Show all VillageSQL system variables at once
SHOW VARIABLES LIKE 'villagesql_%';
```

**Scope:** Global, read-only. Cannot be set at runtime.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Managing Extensions" icon="sliders" href="/docs/mysql-8.4/0.0.3/managing">
    Monitor and troubleshoot extensions
  </Card>

  <Card title="Install Extensions" icon="download" href="/docs/mysql-8.4/0.0.3/install">
    Add new extensions
  </Card>

  <Card title="Extension Architecture" icon="sitemap" href="/docs/mysql-8.4/0.0.3/architecture">
    Understand the internals
  </Card>

  <Card title="Available Extensions" icon="list" href="/docs/extensions">
    Browse extension catalog
  </Card>
</CardGroup>
