Skip to content

Add some try-catch like mechanism for SQL queries #162

Open
@colmsnowplow

Description

@colmsnowplow

One of the challenges to writing a set of general SQL models is that some of the data we'd like to have models for isn't always present. So we're aiming for a structure that allows one to enable certain things as 'add-ons', if the data is there.

For example, let's say we'd like to have the IAB enrichment available, but that's not a standard feature for everyone. If you don't have it switched on, the table doesn't exist. So any SQL that tries to query the table will fail the job, and SQL doesn't support IF logic to the level that solves this problem.

It feels like we could do some really awesome things if we could write some logic along the lines of:

  • Try: SELECT * FROM some_table LIMIT 1
  • If success: Run x module of SQL queries
  • If {table doesn't exist failure}: Continue without attempting that module
  • Else: fail as usual

Not sure how achievable it is, or if there's a better solution to that problem. Probably a 'nice to have', but could be pretty cool/powerful!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions