Parameters
Bind parameters pass application data into an FQL program without generating source code. FQL reads each value through its @name.
Pass parameters to a run
Provide a plain JavaScript object as params:
Use the same params option with plan.run(). Use plan.createSession({ params }) when a reusable session should capture one parameter set.
The JavaScript API does not currently define engine-wide persistent parameters. Bind values for each plan run or session.
Inspect declared parameters
After compilation, plan.params lists the parameter names referenced by the program:
The array is read-only. Missing required parameters fail when a session is created or executed.
Value conversion
Parameters, JavaScript function arguments, and JavaScript function results use the same input conversion rules:
| JavaScript value | Ferret value |
|---|---|
undefined or null |
none |
boolean |
Boolean |
string |
String |
finite number |
Number |
Array |
Array |
| plain object | Object |
Uint8Array |
Binary |
Nested arrays and objects are converted recursively. Object keys remain strings.
For example:
Unsupported values
Conversion fails explicitly for values that do not have a stable Ferret representation, including:
NaN,Infinity, and-Infinity- cyclic arrays or objects
- class instances
Date,Map,Set, and other non-plain objects- functions used as parameter values
- symbols and big integers
Convert these values into supported primitives, arrays, plain objects, or Uint8Array before passing them to Ferret.
Returned values
Ferret results are JSON-decoded. none becomes null; booleans, strings, numbers, arrays, and objects retain their corresponding shapes. Binary results are serialized as base64 strings rather than returned as Uint8Array.