holycorn
holycorn · Ruby foreign data wrapper provider
Overview
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
Usage
Sources:
holycorn is a foreign-data wrapper host built around the sandboxed mruby VM. It can read Redis through the bundled wrapper or execute a server-side Ruby producer supplied for a foreign table.
Core Workflow
The bundled Redis wrapper is selected with wrapper_class; its remaining table options are passed to the Ruby wrapper constructor.
For bulk definition, IMPORT FOREIGN SCHEMA invokes the wrapper’s import callback. The upstream Redis example requires the remote schema name holycorn_schema and recommends a prefix to avoid local name collisions.
Wrapper Contract
wrapper_classnames a Ruby object already compiled into the mruby runtime; the bundled class isHolycornRedis.wrapper_pathinstead points to a server-side Ruby file. Its object must accept.newwith one environment argument and exposeeachwith no arguments.- The producer returns row values in foreign-table column order. Ruby scalars map to PostgreSQL booleans, integers, floating-point values, text, or timestamps as documented upstream.
Limitations and Safety
The reviewed upstream requires PostgreSQL 9.4+ and documents reads only: SELECT works, but INSERT is not supported. A custom wrapper_path is code and file access on the database server, so only trusted administrators should control it. This is an old, narrow FDW implementation; validate its type conversions and Redis failure behavior on the exact PostgreSQL build before adoption.