Introduction to PLJS
PLJS is an innovative Javascript Language Extension designed specifically for modern PostgreSQL databases. It seeks to provide a lightweight, compact, and relatively fast solution for executing Javascript within PostgreSQL environments.
Technology Behind PLJS
PLJS utilizes the QuickJS engine for executing Javascript. QuickJS is known for its minimalistic approach while providing a reasonable balance of performance and size. The extension is compatible with PostgreSQL version 14 and above, ensuring that it works seamlessly with recent versions of the database system.
Current Development Stage
The PLJS project is currently nearing its initial release. It has been successfully compiled and is progressing towards achieving functional parity with PLV8, another Javascript extension for PostgreSQL. However, there are a few features still in development or missing:
- Support for Windows operating systems
- Set Returning Functions (SRF)
- Startup functions
Additionally, it has been noted that WebAssembly (WASM) support will probably never be integrated into PLJS.
Building PLJS
Building PLJS is intended to be straightforward. However, specific build instructions might not yet be available for all platforms. Below is an example outline for building on MacOS.
MacOS Building Instructions
Requirements
- XCode: Apple's integrated development environment for macOS.
- Git: Version control system to clone the PLJS source code.
Building Process
To build PLJS on MacOS, utilize the command line by executing the following:
$ make install
Frequently Asked Questions
Q: Is PLJS a replacement for PLV8?
A: Generally, PLJS is not designed to replace PLV8. Its purpose is to provide a compact, lightweight extension that is easy to build and maintain. Instead of using the V8 engine, it employs QuickJS, which offers a lighter build, albeit with a potential tradeoff in speed.
Q: How does PLJS's performance compare to PLV8?
A: The exact speed comparison is still under evaluation. There will likely be tradeoffs in performance, but these will be thoroughly documented before the official 1.0 release. The project welcomes contributions, especially cases where specific use-cases can be simplified into benchmarks for thorough testing.