Running HogQL Queries on Your iPhone: A Practical Guide
SQL on a phone sounds painful. We made it work. Here's how to use HogPocket's HogQL console to run queries, explore results, and save views — all from your iPhone.
HogPocket Team
SQL on a phone? Really?
We get it. Writing SQL on a 6-inch screen sounds like a terrible idea. But we spent weeks getting the mobile HogQL experience right, and the result is surprisingly productive.
The key insight: most mobile HogQL queries aren't 50-line JOINs. They're quick lookups — "how many signups today?", "what's the top event this week?", "show me users who hit this error." Short queries, immediate answers.
Getting started
Open HogPocket, tap the HogQL tab, and you'll see the query editor. A few things that make it work on mobile:
Syntax highlighting
The editor highlights HogQL keywords, strings, and numbers so you can parse your query at a glance. No more getting lost in a wall of monospace text.
Quick snippets
Tap the snippets button to insert common query patterns:
SELECT event, count() FROM events GROUP BY event ORDER BY count() DESC LIMIT 10SELECT properties.$current_url, count() FROM events WHERE event = '$pageview' GROUP BY 1 ORDER BY 2 DESCSELECT person_id, count() FROM events WHERE timestamp > now() - INTERVAL 1 DAY GROUP BY 1 ORDER BY 2 DESC LIMIT 20Results table
Results render in a scrollable table with sticky headers. Swipe horizontally to see more columns. Tap a row to copy its values.
Tips for mobile HogQL
WHERE timestamp > now() - INTERVAL 7 DAY, use the date filter above the editor.Example workflows
Morning metrics check
SELECT
countIf(event = '$pageview') as pageviews,
countIf(event = 'sign_up') as signups,
countIf(event = 'purchase') as purchases
FROM events
WHERE timestamp > today()
Debugging a specific user
SELECT event, timestamp, properties.$current_url
FROM events
WHERE person_id = 'user_abc123'
AND timestamp > now() - INTERVAL 1 HOUR
ORDER BY timestamp DESC
LIMIT 50
Quick funnel check
SELECT
countIf(event = 'page_view') as step1,
countIf(event = 'sign_up') as step2,
countIf(event = 'activate') as step3
FROM events
WHERE timestamp > now() - INTERVAL 7 DAY
HogQL on mobile isn't about replacing your desktop workflow. It's about having a quick escape hatch when you need an answer and your laptop isn't nearby.