When we're deleting data, often instead of deleting a DB row we instead set a date_deleted column (for non-privacy-sensitive data) so that the data is accessible later for auditing if necessary.
How can we use Objection, Knex, or Postgres to pre-filter on this column always (if it exists) and otherwise return all rows? (We only ever want to look at these columns manually, not through code.)
Looks like postProcessResponse
will work fine in Knex - we just filter the returned rows checking for date_deleted. But this would of course be more efficient if we can find a way to always filter before the query fires, not after getting the results.