plX: The excellent transpiler for PostgreSQL

Write PostgreSQL functions in the language you already know. Ruby, PHP, JavaScript, TypeScript, Python, Go, COBOL, Oracle PL/SQL, or Transact-SQL, compiled to plpgsql at CREATE FUNCTION time.
plx is a PostgreSQL extension. When you run CREATE FUNCTION ... LANGUAGE plx*, plx transpiles the body to plpgsql and stores that plpgsql in pg_proc.prosrc. At run time the function is executed by PostgreSQL's own plpgsql interpreter. There is no separate language runtime loaded into the backend, the generated plpgsql is visible in the catalog, and every plpgsql construct is reachable from every dialect.
Dialects
The front end is dialect-pluggable, and the set is open-ended. The dialects available today:
- plxruby — a Ruby dialect
- plxphp — a PHP dialect
- plxjs — a JavaScript dialect
- plxts — a TypeScript dialect (plxjs plus type annotations)
- plxpython3 — a Python dialect
- plxgo — a Go dialect
- plxcobol — a COBOL dialect (ISO/IEC 1989:2023)
- plxplsql — an Oracle PL/SQL dialect
- plxtsql — a Transact-SQL (SQL Server) dialect
More info
- License: MIT to encourage contribution (AI Welcome)
- Documentation: https://commandprompt.github.io/plx/
- Code: https://github.com/commandprompt/plx