PostHog · Schema

HogQLMetadata

A/B TestingAnalyticsFeature FlagsOpen SourceProduct AnalyticsSession Recording

Properties

Name Type Description
connectionId string Optional direct external data source id for running against a specific source
debug boolean Enable more verbose output, usually run from the /debug page
filters object Extra filters applied to query via {filters}
globals object Extra globals for the query
kind string
language object Language to validate
modifiers object Modifiers used when performing the query
query string Query to validate
response object
sourceQuery object Query within which "expr" and "template" are validated. Defaults to "select * from events"
tags object
variables object Variables to be subsituted into the query
version number version of the node, used for schema migrations
View JSON Schema on GitHub

JSON Schema

posthog-hogqlmetadata-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/HogQLMetadata",
  "title": "HogQLMetadata",
  "additionalProperties": false,
  "properties": {
    "connectionId": {
      "default": null,
      "description": "Optional direct external data source id for running against a specific source",
      "title": "Connectionid",
      "type": "string",
      "nullable": true
    },
    "debug": {
      "default": null,
      "description": "Enable more verbose output, usually run from the /debug page",
      "title": "Debug",
      "type": "boolean",
      "nullable": true
    },
    "filters": {
      "default": null,
      "description": "Extra filters applied to query via {filters}",
      "allOf": [
        {
          "$ref": "#/components/schemas/HogQLFilters"
        }
      ],
      "nullable": true
    },
    "globals": {
      "default": null,
      "description": "Extra globals for the query",
      "title": "Globals",
      "additionalProperties": true,
      "type": "object",
      "nullable": true
    },
    "kind": {
      "default": "HogQLMetadata",
      "title": "Kind",
      "type": "string",
      "enum": [
        "HogQLMetadata"
      ]
    },
    "language": {
      "description": "Language to validate",
      "allOf": [
        {
          "$ref": "#/components/schemas/HogLanguage"
        }
      ]
    },
    "modifiers": {
      "default": null,
      "description": "Modifiers used when performing the query",
      "allOf": [
        {
          "$ref": "#/components/schemas/HogQLQueryModifiers"
        }
      ],
      "nullable": true
    },
    "query": {
      "description": "Query to validate",
      "title": "Query",
      "type": "string"
    },
    "response": {
      "default": null,
      "allOf": [
        {
          "$ref": "#/components/schemas/HogQLMetadataResponse"
        }
      ],
      "nullable": true
    },
    "sourceQuery": {
      "default": null,
      "description": "Query within which \"expr\" and \"template\" are validated. Defaults to \"select * from events\"",
      "title": "Sourcequery",
      "anyOf": [
        {
          "$ref": "#/components/schemas/EventsNode"
        },
        {
          "$ref": "#/components/schemas/ActionsNode"
        },
        {
          "$ref": "#/components/schemas/PersonsNode"
        },
        {
          "$ref": "#/components/schemas/EventsQuery"
        },
        {
          "$ref": "#/components/schemas/SessionsQuery"
        },
        {
          "$ref": "#/components/schemas/ActorsQuery"
        },
        {
          "$ref": "#/components/schemas/GroupsQuery"
        },
        {
          "$ref": "#/components/schemas/InsightActorsQuery"
        },
        {
          "$ref": "#/components/schemas/InsightActorsQueryOptions"
        },
        {
          "$ref": "#/components/schemas/SessionsTimelineQuery"
        },
        {
          "$ref": "#/components/schemas/HogQuery"
        },
        {
          "$ref": "#/components/schemas/HogQLQuery"
        },
        {
          "$ref": "#/components/schemas/HogQLMetadata"
        },
        {
          "$ref": "#/components/schemas/HogQLAutocomplete"
        },
        {
          "$ref": "#/components/schemas/RevenueAnalyticsGrossRevenueQuery"
        },
        {
          "$ref": "#/components/schemas/RevenueAnalyticsMetricsQuery"
        },
        {
          "$ref": "#/components/schemas/RevenueAnalyticsMRRQuery"
        },
        {
          "$ref": "#/components/schemas/RevenueAnalyticsOverviewQuery"
        },
        {
          "$ref": "#/components/schemas/RevenueAnalyticsTopCustomersQuery"
        },
        {
          "$ref": "#/components/schemas/MarketingAnalyticsTableQuery"
        },
        {
          "$ref": "#/components/schemas/MarketingAnalyticsAggregatedQuery"
        },
        {
          "$ref": "#/components/schemas/NonIntegratedConversionsTableQuery"
        },
        {
          "$ref": "#/components/schemas/WebOverviewQuery"
        },
        {
          "$ref": "#/components/schemas/WebStatsTableQuery"
        },
        {
          "$ref": "#/components/schemas/WebExternalClicksTableQuery"
        },
        {
          "$ref": "#/components/schemas/WebGoalsQuery"
        },
        {
          "$ref": "#/components/schemas/WebVitalsQuery"
        },
        {
          "$ref": "#/components/schemas/WebVitalsPathBreakdownQuery"
        },
        {
          "$ref": "#/components/schemas/WebPageURLSearchQuery"
        },
        {
          "$ref": "#/components/schemas/WebTrendsQuery"
        },
        {
          "$ref": "#/components/schemas/WebAnalyticsExternalSummaryQuery"
        },
        {
          "$ref": "#/components/schemas/WebNotableChangesQuery"
        },
        {
          "$ref": "#/components/schemas/SessionAttributionExplorerQuery"
        },
        {
          "$ref": "#/components/schemas/RevenueExampleEventsQuery"
        },
        {
          "$ref": "#/components/schemas/RevenueExampleDataWarehouseTablesQuery"
        },
        {
          "$ref": "#/components/schemas/ErrorTrackingQuery"
        },
        {
          "$ref": "#/components/schemas/ErrorTrackingSimilarIssuesQuery"
        },
        {
          "$ref": "#/components/schemas/ErrorTrackingBreakdownsQuery"
        },
        {
          "$ref": "#/components/schemas/ErrorTrackingIssueCorrelationQuery"
        },
        {
          "$ref": "#/components/schemas/LogsQuery"
        },
        {
          "$ref": "#/components/schemas/LogAttributesQuery"
        },
        {
          "$ref": "#/components/schemas/LogValuesQuery"
        },
        {
          "$ref": "#/components/schemas/TraceSpansQuery"
        },
        {
          "$ref": "#/components/schemas/ExperimentFunnelsQuery"
        },
        {
          "$ref": "#/components/schemas/ExperimentTrendsQuery"
        },
        {
          "$ref": "#/components/schemas/CalendarHeatmapQuery"
        },
        {
          "$ref": "#/components/schemas/RecordingsQuery"
        },
        {
          "$ref": "#/components/schemas/TracesQuery"
        },
        {
          "$ref": "#/components/schemas/TraceQuery"
        },
        {
          "$ref": "#/components/schemas/TraceNeighborsQuery"
        },
        {
          "$ref": "#/components/schemas/VectorSearchQuery"
        },
        {
          "$ref": "#/components/schemas/UsageMetricsQuery"
        },
        {
          "$ref": "#/components/schemas/EndpointsUsageOverviewQuery"
        },
        {
          "$ref": "#/components/schemas/EndpointsUsageTableQuery"
        },
        {
          "$ref": "#/components/schemas/EndpointsUsageTrendsQuery"
        }
      ],
      "nullable": true
    },
    "tags": {
      "default": null,
      "allOf": [
        {
          "$ref": "#/components/schemas/QueryLogTags"
        }
      ],
      "nullable": true
    },
    "variables": {
      "default": null,
      "description": "Variables to be subsituted into the query",
      "title": "Variables",
      "additionalProperties": {
        "$ref": "#/components/schemas/HogQLVariable"
      },
      "type": "object",
      "nullable": true
    },
    "version": {
      "default": null,
      "description": "version of the node, used for schema migrations",
      "title": "Version",
      "type": "number",
      "nullable": true
    }
  },
  "required": [
    "language",
    "query"
  ],
  "type": "object"
}