Earlier quoted context omitted.
> Say for instance we have one query that finds eligible bachelors near me and another that finds newly eligible bachelors. We need two queries but they both rely on the same underlying domain concept of "eligible bachelors". [...] It's hard to do that in sql in a maintainable way. Seems a textbook case of using a view for sharing query logic. > If I decide to change a datetime field called time to split it into a da…
>Seems a textbook case of using a view for sharing query logic. Views are just terrible outside of data analyst style work. Unmaintainable, restricted to SQL structures, require absurd hacks or custom dlls, not properly source controlled, difficult to perform performance analysis on, hard to update. You can't combine views easily, you can't cache results, you don't get static type checking.
Views are not "unmaintainable".
> restricted to SQL structures,
I'm not sure how that's a problem, since SQL is a fully-general data language.
> require absurd hacks or custom dlls,
Views require neither hacks nor "custom DLLs" in any RDBMS I am aware of. Can you provide a concrete example?
> not properly source controlled,
There's no reason DB schemas (including, but not limited to, view definitions) can't be source controlled.
> You can't combine views easily
Yes you can, whether by "combine" you mean as joined source relations, or as criteria that need to be combined to slice and dice the same source data. That's, like, playing right to the strength of SQL and RDBMS systems.
> you can't cache results,
Well, not generally incrementally or in something like a recently-used cache; a number of RDBMS's do support materialized views, though.