SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Procedures: CLI `call` interface

Open gefjon opened this issue 1 month ago • 1 comments

Design and implement a way to call procedures and await their results from the SpacetimeDB CLI. Note that procedures live at a different HTTP route than reducers (/database/:name/procedure/:name vs /database/:name/call/:name), at least for now. As such, we'll have to decide between:

  • spacetime call does some extra work internally to determine whether it's calling a reducer or a procedure, but hides the difference from the user.
  • There's a separate subcommand, possibly spacetime procedure, which calls procedures. Attempting to spacetime call a procedure is an error.

gefjon avatar Oct 30 '25 13:10 gefjon

We like the former version, where the same call CLI command can do either. We intend to modify the /v1/database/:name/call/:func route to call either reducers or procedures, at which point this should require only very minimal modifications to the CLI.

gefjon avatar Nov 13 '25 18:11 gefjon

another proposal i thought of is adding the commands:

spacetime reducer db name spacetime procedure db name

Then the call is gone and its not ambigous (call would get marked deprecated and removed in 2.0 in that version) :)

Idk lemme know what you think :>

kistz avatar Nov 28 '25 23:11 kistz