Runs a SurrealQL function, built-in or custom, and returns its result.
Method Syntax
client.call(fn_name, args, session, txn)Arguments
Argument | Description |
|---|---|
fn_name | The function name, for example fn::greetor time::now. |
args | The function arguments, each CBOR-encoded, as a List[List[UInt8]]. |
session | An optional session id. |
txn | An optional transaction id. |
Example usage
from surrealdb import CborCodec
from std.collections import List
var codec = CborCodec()
var args = List[List[UInt8]]()
args.append(codec.encode_text("Chiru"))
var resp = client.call("fn::greet", args)