Contextable<> (Class) reference

Any argument that is Contextable can be provided as a function, that will be called with a Context object, which proves access to all the methods available for the current table, assertion, or operation.

This is useful when you need to use context methods within an argument.

Example

When defining a table via the JS API, the query() method takes a Contextable<string> argument, and can be called in two ways:

publish("example_simple")
  .query("select 1 as test");

publish("example_context")
  .query(context => `select * from ${context.ref("example_simple")}`);

On this page