Skip to content

Exporting filterClause and getFiltsValues #1049

@merijn

Description

@merijn

I'm writing quite a lot of raw SQL queries in between persistent queries in my code. It would be super convenient if I could parameterise these queries the same way as my persistent queries (i.e. using persistent's filters for my own queries). Currently this isn't really possible unless I essentially re-implement the existing persistent filter handling.

This seems kind of a waste since filterClause/getFiltsValues/filterClauseHelper in Database.Persist.Sql.Orphan.PersistQuery already have the necessary logic, it's just not exported. I would like to see this logic exported in some usable form from either Database.Persist.Sql (or, alternatively, Database.Persist.Sql.Internal to indicate that these are "you burn yourself, it's your own fault!).

I don't have particularly strong opinions on names and whether this gets exposed as two separate functions or as a single one like filterClauseHelper.

If there's no objections I can hack up a PR that implements this.

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