4 ms·
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 automaticall
by eternityforest 3y ago
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?
- culturedsystems 3y agoTemporal tables, aka system versioned tables, are something like this: https://mariadb.com/kb/en/system-versioned-tables/ https://mariadb.com/kb/en/system-versioned-tables/
- loevborg 3y agoIS NULL!!! not = NULL!!!
- 6th 3y agocover both bases due to this ambiguity =) deleted IS NULL OR LOWER(deleted) = 'null'
- rawgabbit 3y agoDBs with Materialized Views Here is the syntax for Snowflake. CREATE MATERIALIZED VIEW mymv COMMENT='filtered view' AS SELECT * FROM mytable WHERE isdeleted=0;
- setr 3y agoWhy materialize? A normal view is sufficient
- rawgabbit 3y agoIt 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.
- setr 3y agoI 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.