The SQL-based implementation of the AnalyticsStrategy. This will store analytics data in the SQL database used by your Vendure instance.

Note that for production workloads, the ClickHouse implementation is recommended.

Implements

Methods

  • Optionally allows the definition of database entities in the main server database.

    Returns (typeof AdvancedSearchAnalyticsEvent | typeof AdvancedSearchAnalyticsQuery)[]

  • Retrieves the chart data for the given input.

    Parameters

    • input: SearchAnalyticsChartInput

    Returns Promise<SearchAnalyticsChartData>

  • Retrieves the event data for the given input.

    Parameters

    • input: SearchAnalyticsEventInput

    Returns Promise<SearchAnalyticsEventData>

  • Retrieves the query data for the given input.

    Parameters

    • input: SearchAnalyticsQueryInput

    Returns Promise<SearchAnalyticsQueryData>

  • Parameters

    • injector: Injector

    Returns void | Promise<void>

    Defines setup logic to be run during application bootstrap. Receives the Injector as an argument, which allows application providers to be used as part of the setup. This hook will be called on both the main server and the worker processes.

    async init(injector: Injector) {
    const myService = injector.get(MyService);
    await myService.doSomething();
    }
  • Logs a search event: either a list view or a result click.

    Parameters

    Returns Promise<void>