Yeah, you can use index on expression and views to ensure the expression matches, like
https://github.com/fsaintjacques/recordlite . The view + index approach decouples the convenience of having a column for a given expression and the need to materialise the column for performance.