News for hackers. Stuff that matters.
Re:Soft Deletion Probably Isn't Worth It by eternityforest on Tuesday January 09, 2024 @10:22PM (#38935730)
Is there a database that does the WHERE deleted=null for you?

Like, some way to create a special column that makes it so every query to that table automatically has a certain filter unless you use some other keyword to override it?

Re:Soft Deletion Probably Isn't Worth It by rawgabbit on Tuesday January 09, 2024 @10:24PM (#38935747)
DBs with Materialized Views

Here is the syntax for Snowflake. CREATE MATERIALIZED VIEW mymv COMMENT='filtered view' AS SELECT * FROM mytable WHERE isdeleted=0;

Re:Soft Deletion Probably Isn't Worth It by setr on Wednesday January 10, 2024 @02:36PM (#38942177)
Why materialize? A normal view is sufficient
Re:Soft Deletion Probably Isn't Worth It by rawgabbit on Wednesday January 10, 2024 @02:51PM (#38942323)
It was to answer the OP question. Querying a materialized view is essentially the same as querying the original table. The MV allows for automated indexes etc.
Re:Soft Deletion Probably Isn't Worth It by setr on Thursday January 11, 2024 @03:54AM (#38949567)
I mean... a normal view hits all of the same properties, and is literally querying the original table. Materialization is an entirely orthogonal concern as far as I can think of.
Re:Soft Deletion Probably Isn't Worth It by culturedsystems on Wednesday January 10, 2024 @04:14PM (#38943255)
Temporal tables, aka system versioned tables, are something like this: https://mariadb.com/kb/en/system-versioned-tables/
Re:Soft Deletion Probably Isn't Worth It by loevborg on Wednesday January 10, 2024 @05:17PM (#38944162)
IS NULL!!!

not = NULL!!!

Re:Soft Deletion Probably Isn't Worth It by 6th on Wednesday January 10, 2024 @06:00PM (#38944735)
cover both bases due to this ambiguity =)

deleted IS NULL OR LOWER(deleted) = 'null'