from Hacker News

Show HN: PLJS – JavaScript for Postgres

by jerrysievert on 6/25/25, 7:36 PM with 8 comments

PLJS is a new, modern JavaScript trusted language extension, bundling QuickJS, a small and fast JavaScript runtime with Postgres, providing fast type conversion between Postgres and JavaScript, fast execution, and a very light footprint.

Here are bencharks that show how it compares to PLV8: https://github.com/plv8/pljs/blob/main/docs/BENCHMARKS.md

This is the first step toward a truly light-weight, fast, and extensible JavaScript runtime embedded inside of Postgres. The initial roadmap has been published at https://github.com/plv8/pljs/blob/main/docs/ROADMAP.md

You can join the discussion by joining the PLV8 Discord: https://discord.gg/XYGSCfVNBC

You can find PLJS at https://github.com/plv8/pljs

  • by phartenfeller on 6/25/25, 9:02 PM

    Interesting. This is now the second DB next to Oracle[1] that can do JS (that I know of). pgSQL and PL/SQL of course still stay relevant but in the Oracle spehere the argument is that you can reuse existing code from NPM. Like this blog post [2] describes how to run an GraphQL endpoint from within the DB.

    [1] https://docs.oracle.com/en/database/oracle/oracle-database/2... [2] https://blogs.oracle.com/developers/post/creating-a-graphql-...

  • by mhio on 6/26/25, 2:32 AM

    What are the advantages to pljs over plv8? I thought the context creation would have been the big one, but it doesn't appear so in the current benchmarks.

    How did the project weigh the intermittent updates of bellard quickjs and the community fork quickjs-ng?

  • by timz on 6/25/25, 8:58 PM

    Amazing.. Would be nice to have something like that for Redis to replace Lua
  • by revskill on 6/26/25, 9:58 AM

    No npm support is a huge limitation.
  • by oulipo on 6/25/25, 9:17 PM

    What would be the typical use-case? Light data transformation?

    Is there a significant advantage over Rust-based embedded Postgres language like https://github.com/tcdi/plrust which is compiled and a bit more type-safe?