Home Applications iris-supabase-fdw

iris-supabase-fdw

Community Project
This project is maintained by its author and is not officially supported by InterSystems. For technical support, please contact the project developer.
0
0 reviews
0
Awards
2
Views
0
IPM installs
0
Add to bundle
Details
Releases (1)
Reviews
Issues
Query InterSystems IRIS tables from Supabase as if they were loc

What's new in this version

Initial Release

iris-supabase-fdw

中文版本

Query InterSystems IRIS tables from Supabase as if they were local Postgres tables.

┌─── Supabase (Postgres) ───┐         ┌─── InterSystems IRIS ───┐
│ wrappers → Wasm runtime    │  HTTP   │ iris-fdw-gateway         │
│   └─ iris_fdw.wasm (Rust)  ├────────►│   └─ Dynamic SQL ─► DB  │
└────────────────────────────┘  JSON   └─────────────────────────┘

Components

Component Language Description
iris-fdw-wasm/ Rust → WebAssembly FDW package, runs inside Supabase Wrappers
iris-fdw-gateway/ ObjectScript REST gateway that executes SQL on IRIS

Quick Start

1. Install the IRIS Gateway

On your IRIS instance:

zpm "install iris-fdw-gateway"

Or manually: import IrisFdw.Gateway.Handler.cls and set up the web application at /iris-fdw/v1.

Create a dedicated user:

Set user = ##class(Security.Users).Create("fdw_user", "%All", "your-password")

Grant table access:

GRANT SELECT, INSERT, UPDATE, DELETE ON Demo.Patient TO fdw_user;

2. Install the Wasm FDW on Supabase

-- Enable Wrappers
create extension if not exists wrappers with schema extensions;
create foreign data wrapper wasm_wrapper
  handler wasm_fdw_handler
  validator wasm_fdw_validator;

-- Create IRIS server create server iris_server foreign data wrapper wasm_wrapper options ( fdw_package_url 'https://github.com//iris-supabase-fdw/releases/download/v0.1.0/iris_fdw.wasm', fdw_package_name 'iris:iris-fdw', fdw_package_version '0.1.0', fdw_package_checksum '', api_url 'https://your-iris-host/iris-fdw/v1', username 'fdw_user', password_id '', debug 'true' );

-- Import IRIS schema as foreign tables create schema if not exists iris; import foreign schema "Demo" from server iris_server into iris;

3. Query IRIS from Supabase

-- Query IRIS tables
select id, name, city from iris.patient where city = 'Beijing';

-- Join IRIS tables with Postgres tables select p.name, l.status from iris.patient p join local.visits l on l.patient_id = p.id;

-- Insert into IRIS insert into iris.patient (name, city) values ('新患者', 'Shanghai');

-- Update IRIS update iris.patient set city = 'Guangzhou' where id = 1;

-- Delete from IRIS delete from iris.patient where id = 99;

Configuration Options

Server options (CREATE SERVER)

Option Required Default Description
fdw_package_url yes - URL to the .wasm file
fdw_package_name yes - Package identifier
fdw_package_version yes - Semantic version
fdw_package_checksum yes - SHA256 of .wasm
api_url yes - IRIS gateway base URL
username no _SYSTEM IRIS login username
password no SYS IRIS login password (plain)
password_id no - Supabase Vault secret ID (preferred)
batch_size no 100 Rows per batch in paged queries
debug no false Enable SQL debug logging

Table options (CREATE FOREIGN TABLE)

Option Required Description
object yes IRIS table name (e.g., Demo.Patient)

Supported Types

IRIS Postgres
INTEGER bigint
BIGINT bigint
DOUBLE double precision
VARCHAR(n) text
DATE date
TIMESTAMP timestamp
BOOLEAN boolean
NUMERIC double precision

Security

  • IRIS SQL executes with the authenticated user’s privileges
  • Password stored in Supabase Vault (not plaintext in SQL)
  • /query endpoint only allows SELECT
  • /exec endpoint only allows INSERT/UPDATE/DELETE
  • Read-only mode: Set ^FDW.Gateway("readOnly") = 1
  • Use HTTPS between Supabase and IRIS

Build from Source

Wasm FDW

cd iris-fdw-wasm
rustup target add wasm32-unknown-unknown
cargo install cargo-component --locked --version 0.13.2
cargo component build --release
# Output: target/wasm32-unknown-unknown/release/iris_fdw.wasm

IRIS Gateway

cd iris-fdw-gateway
# Import src/IrisFdw.Gateway.Handler.cls into IRIS
# Set up web application at /iris-fdw/v1

Limitations

  • NUMERIC values travel as 64-bit floats (Wasm FDW interface limitation)
  • Paging is stateless (offset-based); results may shift if data changes during multi-page scan
  • No TCP/SuperServer support (Wasm sandbox restriction)
  • IRIS Cloud SQL is not supported (no web application hosting)

License

MIT

Version
1.0.020 Nov, 2026
Category
Data Set
Works with
InterSystems IRIS
First published
20 Nov, 2026
Last edited
20 Nov, 2026