Soft Deletes with single View? #2383
-
Definitely, this is a stupid question and I already know the answer, but PostGrest often suprises me with its clever decisions. I have a table "Products" in "private" schema, for which I open access by View in public schema with "CREATE VIEW AS SELECT * FROM private.products"; I want to make a soft deletion of object by adding "deleted_at" to table, and my View will be like "select * except rows with deleted_at". So my postgrest calls to Products will show me only not "soft-deleted" rows. But if I want to get access to all, even "soft-deleted" rows with Postgrest - there is no way to get it from existed view, true? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, since you won't have the deleted_at column to filter on.
Yeah. I guess if you want to save code maybe you could use a function instead and have a soft-deleted parameter with a default value. |
Beta Was this translation helpful? Give feedback.
Yes, since you won't have the deleted_at column to filter on.
Yeah. I guess if you want to save code maybe you could use a function instead and have a soft-deleted parameter with a default value.