Skip to content
GuideMarch 5, 20266 min read

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.

H

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 10
  • SELECT properties.$current_url, count() FROM events WHERE event = '$pageview' GROUP BY 1 ORDER BY 2 DESC
  • SELECT person_id, count() FROM events WHERE timestamp > now() - INTERVAL 1 DAY GROUP BY 1 ORDER BY 2 DESC LIMIT 20
  • Results 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

  • Keep queries short — If you need a complex query, write it on desktop and save it as a view. Then access the view from mobile.
  • Use LIMIT — Always add a LIMIT clause. Loading 10,000 rows on mobile is slow and pointless.
  • Save frequently used queries — Tap "Save as View" to bookmark queries you run often.
  • Use the date picker — Instead of typing 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.