proc.create0.000005
Creates a stored proc.
Arguments
namerequired
The name of the stored proc.procrequired
The composed proc to store.Return Value
true
if the proc was created, otherwise false
.something went wrong :(
Creating a stored proc
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: "z2112b73") {
client.type.string.truncate(length: 5)
}
client.proc.create.call(undefined, z2112b73, () => {
return client.type.string.truncate(undefined, {length: 5});
});
curl "https://proc.run/proc/create?name=z2112b73" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/vnd.proc+json" \
--header "accept: text/plain" \
--data '[["$$", "proc", ["{}", ["()", "type.string.truncate", ["$$", "length", ["%%", 5]]]]]]'
true
Stored procs are useful for sharing behavior across projects—learn how to use them.
Stuck? Want to chat about an idea? Join the community on Discord.