@grow-codes/better-stack-logs - v0.1.1
    Preparing search index...

    Class BetterStackQuery

    SQL query client for Better Stack Logs (ClickHouse HTTP interface with the connection's own Basic credentials). Implements LogQueryClient: search runs searchLogs on the configured sourceTable, tail polls search, listStreams returns the configured collection and listLabels is unsupported (Better Stack has no labels).

    Hierarchy (View Summary)

    Index
    • Runs SQL and returns the rows. Without a FORMAT clause, FORMAT JSONEachRow is appended; FORMAT JSON/JSONEachRow (also with output_format_json_array_of_rows) are parsed, other formats throw ValidationError (use queryRaw). A ClickHouse exception appended to a 200 response is raised as the mapped error.

      Parameters

      Returns Promise<QueryRow[]>

      const rows = await q.query(
      "SELECT count() AS c FROM remote(t1_app_logs) WHERE position(raw, {needle:String}) > 0",
      { needle: "checkout" },
      );
    • Runs SQL and returns the response text unchanged. params are bound server side ({name:Type} placeholders + param_<name> URL parameters).

      Parameters

      Returns Promise<string>