proc.exists0.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: "dde7cb5e") {
client.type.string.truncate(length: 5)
}
client.proc.exists.call(
name: "dde7cb5e"
)
client.proc.create.call(undefined, dde7cb5e, () => {
return client.type.string.truncate(undefined, {length: 5});
});
client.proc.exists.call(
undefined, dde7cb5e
)
curl "https://proc.run/proc/create?name=dde7cb5e" --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=dde7cb5e" --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.