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.
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/filterClauseHelperinDatabase.Persist.Sql.Orphan.PersistQueryalready have the necessary logic, it's just not exported. I would like to see this logic exported in some usable form from eitherDatabase.Persist.Sql(or, alternatively,Database.Persist.Sql.Internalto 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.