Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HogQL Autocomplete #180

Open
12 of 27 tasks
Gilbert09 opened this issue Feb 14, 2024 · 0 comments
Open
12 of 27 tasks

HogQL Autocomplete #180

Gilbert09 opened this issue Feb 14, 2024 · 0 comments
Assignees

Comments

@Gilbert09
Copy link
Member

Gilbert09 commented Feb 14, 2024

HogQL Autocomplete TODOs

What's the goal of this?

To add autocomplete/intellisense support to writing HogQL queries in PostHog. Allowing users to be able to identify and select fields, properties, and general SQL keywords

Step 1: Make it work

  • Fields on tables
    • Lazy join fields
    • Recursive fields
    • Field traversers
  • Table aliases
  • Properties (StringJSONDatabaseField type)
    • Property types (string/int/etc)
  • Table names
  • Common table expressions
    • Returning a subset of fields from a table
    • Constant types (returning a "string" and not a db column)

Step 2: Make it good

  • Support ast.SelectUnionQuery
  • Support field aliases in where/order by/group by clauses
  • Join aliases and join constraints
  • Documentation for functions (requires type system update)
    • Parameter support
  • Suggest SQL keywords
  • Field hover support (hover over field names for extra info)
  • Support HogQL expressions, such as within trends
  • Awareness of Cohorts
    • Suggest cohort names
  • Autocomplete value suggestions, e.g. return Chrome/Safari/etc when comparing properties.$browser in a where clause
    • Also show these in the field "documentation" field
  • Automagically suggest wrapping values in a to<Type> function when there's a type mismatch in comparisons

Step 3: Make it complete

  • ???

Others

  • Report on performance
  • Insights on usage
@Gilbert09 Gilbert09 self-assigned this Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant