Skip to main content
  • Creates a state table in a materialized view allowing a materialized view to maintain state between refreshes. The state table must be a materialized view member. The state table can be part of a feedback loop including input_table_name. To facilitate such feedback loops the create_state_table can be called before the input_table_name is created but must be created after init_table_name is created. During the initial call to create the state table init_table_name is copied to table_name, setting the initial state output of the table. On refresh the create_state_table runs before the endpoint that creates the input_table_name and copies the input_table_name to table_name, setting the state to the version of the input_table from the last refresh. A materialized view is not complete (ready to refresh and query) until both the root table of the view is created and all the input tables to the state tables have been created.

    Parameters

    • table_name: string

      Name of the table to be created.

    • input_table_name: string

      Name of the input table to be copied to the output table on refresh.

    • init_table_name: string

      Name of the initialization table to be copied to the output table during materialized view creation.

    • Optionaloptions: Record<string, string>

      Optional parameters.

    • Optionalcallback: GPUdbCallback

      Optional callback function

    Returns Promise<CreateStateTableResponse>

    Promise<Types.CreateStateTableResponse> - Promise resolving to the response

  • Creates a state table in a materialized view allowing a materialized view to maintain state between refreshes. The state table must be a materialized view member. The state table can be part of a feedback loop including input_table_name. To facilitate such feedback loops the create_state_table can be called before the input_table_name is created but must be created after init_table_name is created. During the initial call to create the state table init_table_name is copied to table_name, setting the initial state output of the table. On refresh the create_state_table runs before the endpoint that creates the input_table_name and copies the input_table_name to table_name, setting the state to the version of the input_table from the last refresh. A materialized view is not complete (ready to refresh and query) until both the root table of the view is created and all the input tables to the state tables have been created.

    Parameters

    Returns Promise<CreateStateTableResponse>

    Promise<Types.CreateStateTableResponse> - Promise resolving to the response