Skip to main content

Built-in Extensions

When building from source, only vsql_complex and vsql_simple are included. Other extensions are maintained in separate repositories (linked below).

vsql_complex

Status: Built-in with VillageSQL Repository: villagesql-server/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:
INSTALL EXTENSION vsql_complex;
Example Usage:
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;
Learn More: vsql_complex Deep Dive

External Extensions

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

Installing Built-in Extensions

Built-in extensions are ready to install:
INSTALL EXTENSION extension_name;
For source builds: Only vsql_complex and vsql_simple are included by default. To use external extensions, build them from their GitHub repositories (links above) and copy the .veb files to your VEF directory (see Installing External Extensions). See Installing Extensions for detailed instructions.

Creating Your Own Extension

Build custom extensions using the VillageSQL extension template:

vsql_extension_template

Fork this template to start building your own VillageSQL extension
Get started: Creating Extensions Guide

Next Steps