proc.exists
0.000005

Checks if a stored proc exists.

Arguments
namerequired
The name of the stored proc to check for existence.
Return Value
true if the proc exists, otherwise false.
something went wrong :(
Checking if a stored proc exists
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.proc.create.call(name: "h88c202d") {
  client.type.string.truncate(length: 5)
}

client.proc.exists.call(
  name: "h88c202d"
)
client.proc.create.call(undefined, h88c202d, () => {
  return client.type.string.truncate(undefined, {length: 5});
});

client.proc.exists.call(
  undefined, h88c202d
)
curl "https://proc.run/proc/create?name=h88c202d" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/vnd.proc+json" \
--header "accept: text/plain" \
--data '[["$$", "proc", ["{}", ["()", "type.string.truncate", ["$$", "length", ["%%", 5]]]]]]'

curl "https://proc.run/proc/exists?name=h88c202d" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
 

true


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