Stored Procs

Compositions can be instantly deployed as custom endpoints, turning proc into a fully extensible platform for custom backends, devops tools, scripts—anything you need.

Stored procs are managed through the proc package. Compositions are deployed to a new endpoint with proc.create. Once deployed, stored procs are callable through the lib namespace.

something went wrong :(
Deploying a composition that says hello
Setup
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
authorization=PROCAUTH
client.proc.create.call(name: "t0ac5581") do
  client.core.echo("hello")
end

client.lib.t0ac5581.call
client.proc.create.call(undefined, t0ac5581, () => {
  return client.core.echo.with("hello");
});

client.lib.t0ac5581.call();
curl "https://proc.run/proc/create?name=t0ac5581" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/vnd.proc+json" \
--header "accept: text/plain" \
--data '[["$$", "proc", ["{}", ["()", "core.echo", [">>", ["%%", "hello"]]]]]]'

curl "https://proc.run/lib/t0ac5581" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
 

hello

Requirements for Stored Proc Names

Proc names must be alphanumeric, with exceptions made for the following characters: .. Names are limited to a length of 64 characters, must start with a letter, and must end with a letter or number.


Stuck? Want to chat about an idea? Join the community on Discord.