PostgreSQL WASM

So, PostgreSQL has a WASM extension now. Can load it up, load a wasm file, and call function in that wasm file from SQL just like they were other SQL functions or python or whatever. ^.^

9 Likes

So you’re saying that I can use lumen to embed a BEAM in Postgres? :smiley:

6 Likes

I’ll have to take a closer look at lumen really cool

2 Likes

What would be some typical use case for this extension?

1 Like

The case I see is to replace some of the language bindings in the DB (like Ruby, Python, Node, etc.) with one extension and provide easier way to write extensions in external languages. It will for sure not replace pgSQL, but can reduce the need for PL/{Python,Tcl,Perl,Ruby,V8,etc.} or C functions.

5 Likes

It’s used for adding functions to SQL, it is not for ‘running’ SQL. Like if you want to speed up some generally costly check and python wouldn’t really help with it, then this could. That kind of stuff. :slight_smile:

Exactly this, it’s another “Language Support” other than the mostly built-in/included Python/TCL/Perl/C/Etc… All while sandboxed. Essentially the speed of C but the sandboxness of an interpreted language. I see it being popular on hosted PGSQL servers especially.

3 Likes