Skip to content

Variables in Checks #505

@namolnad

Description

@namolnad

Hey @ankane, hope you've been well!

I've been adding a number of checks in our system lately, many of which are duplicated queries (warning systems for separate customers of ours), and it got me thinking about being able to use variables within checks. I wondered if it would be possible to add a jsonb column to the checks table, and allow users to create a new check referencing the same underlying query.

I figure it would be possible to go through the statement's variables and add fields for each of these in the outputted html when first creating a new check, and then store those as key-value pairs in the jsonb column for the check. Then here we could just inject those values before calling .bind. This would allow, e.g., reuse of a complex query that uses something like where companies.id = {company_id}, so that you could have separate checks for any company you're interested in being warned about separately.

I figured I'd surface the idea first to see what you thought before going too much further.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions