-
pg-compute-node
A client-side PostgreSQL extension that lets you execute JavaScript functions on the database directly from the application logic.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Thank you for feedback. Sharing a bit more details to make things clearer.
Upon a function invocation, PgCompute does the following:
1. Constructs a function signature (name + arguments) and checks if the function was invoked before. (there is a deploymentTable object that tracks functions that were already sent and executed on the database: https://github.com/dmagda/pg-compute-node/blob/main/compute/...)
2. If the function already exists on the database and its implementation is NOT changed, then PgCompute just sends the function signature to the database for the execution using the `select + schema + "." + funcName + "(" + argsStr + ") statement`.
3. If the function has never been executed or its implementation is changed, then the function is first deployed/created on the database end and then executed. JS allows you to capture the function body as text and send it over whenever you like. PgCompute uses the `create or replace function " + this.#schema + "." + funcName + "()...` statemet to deploy the function.
The transitively invoked functions should work if you execute functionA first via PgCompute and then execute functionB that calls functionA. But I still need to check this.
As for the scope of supported JS APIs, presently the functions have to use the APIs that are allowed/supported by plv8.
Related posts
-
NodeJS Security Best Practices
-
Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
-
Recovering XAMPP developer looking to make a Node CRUD app. What Node database tools are easy to learn?
-
What is the consensus about using ORM in node js applications?
-
Kysely — A type-safe SQL query builder for typescript