posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat(data-warehouse): integrate direct query tables with BI scene HogQL

Open andrewm4894 opened this issue 1 month ago â€ĸ 2 comments

Summary

  • Add --pg:source_uuid directive parsing to identify external Postgres sources
  • Register direct query tables in HogQL database for query resolution
  • Create PostgresTable instances with proper field type mappings from schema metadata
  • Execute queries against external Postgres via psycopg2
  • Frontend passes source UUID with --pg directive for direct query tables

Test plan

  • [ ] Create a direct query Postgres data source
  • [ ] Verify tables appear in BI scene list
  • [ ] Click a table and verify query executes against external Postgres
  • [ ] Verify field types are correctly mapped

🤖 Generated with Claude Code

andrewm4894 avatar Dec 10 '25 14:12 andrewm4894

Size Change: 0 B

Total Size: 3.66 MB

â„šī¸ View Unchanged
Filename Size
frontend/dist/toolbar.js 3.66 MB

compressed-size-action

github-actions[bot] avatar Dec 10 '25 14:12 github-actions[bot]

🔍 Migration Risk Analysis

We've analyzed your migrations for potential risks.

Summary: 1 Safe | 0 Needs Review | 0 Blocked

✅ Safe

Brief or no lock, backwards compatible

data_warehouse.0012_add_is_direct_query
  └─ #1 ✅ AddField
     Adding NOT NULL field with constant default (safe in PG11+)
     model: externaldatasource, field: is_direct_query

Last updated: 2025-12-10 14:40 UTC (2e5956b)

github-actions[bot] avatar Dec 10 '25 14:12 github-actions[bot]

â­ī¸ Skipped snapshot commit because branch advanced to `` while workflow was testing 2e5956b.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

posthog-bot avatar Dec 10 '25 14:12 posthog-bot