dmagda / pg-compute-node

A client-side PostgreSQL extension that lets you execute JavaScript functions on the database directly from the application logic.
Apache License 2.0
24 stars 1 forks source link

Implement basic compute capabilities #1

Closed dmagda closed 10 months ago

dmagda commented 11 months ago

The fist version needs to support the following capabilities:

  1. Execute a Node.js function without parameters
  2. Execute a function with an arbitrary number of parameters.
  3. Create a Compute module allowing to configure setting such as a database schema name per Compute instance. There might be several compute instances used by the same app. Each instance suppose to work with its own schema.
  4. Create a metadata table that will store information about each created function and its hashcode. The metadata table exists in every schema that can be created for the Compute. The default schema name is pg_compute.
  5. Support several deployment modes:
    • AUTO: function is updated automatically only if the implementation has changed or the function doesn't exist;
    • MANUAL: function is never auto-deployed. It needs to be created manually but can be easily called by name using the compute. On the Node end, you just need to have functional interfaces (without the logic implementation) that can be called from the compute API.
  6. Support Promises and decide how to handle errors.
  7. Add testing suite using testcontainers and jest.
  8. Document public API and readme. Also add Apache 2.0 license headers.
  9. Publish a Node.js package with version 0.0.1 on npm. You can use the GitHub workflow for simplicity.

Create a few examples that introduce basic capabilities:

dmagda commented 10 months ago

Released the first version on npm: https://www.npmjs.com/package/pg-compute