:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
"""Tables the gateway references in the PostHog Postgres database.
The gateway's role has SELECT only on a per-table allowlist in
posthog-cloud-infra (terraform, users.tf); a query outside it fails in
deployed environments only, since tests mock the database. Land the grant
in every environment before declaring a table here.
``tests/test_required_tables.py`` binds this set to the package's SQL.
"""
REQUIRED_TABLES: frozenset[str] = frozenset(
{
# Personal API key authentication
"posthog_personalapikey",
"posthog_user",
# OAuth access token authentication
"posthog_oauthaccesstoken",
# Project-scope check
"posthog_team",
"posthog_organization",
"posthog_organizationmembership",
"ee_accesscontrol",
"ee_role",
"ee_rolemembership",
}
)