a (SQL) Views Library

i'd like to create views (as the views in SQL) and store them in a view library (just like add-ons) but, in a Query All Records, i'd like to be able to specify a table OR a view or, in joins, specify a table OR a view.

The view building tool would be exactly the same as the one used in Query All Records function.

My use case is the following:
i have a table, say, product. Each of my products can have a localised label (en_EN, en_US, fr_FR, fr_CA, ...). This localised labels are stored in a "slave" table that has a reference to the product and another reference to the locales table (id, 'language code").


Wherever i need to retrieve my product label, actually i need to build a Query All Products reproducing all the needed joins.

Whereas, if i had a preconfigured view localised_products, where i can transmit the locale parameter (from a user setting for example), i'd be able to do a join directly on this view and it would retrieve all the fields from that view, properly localised.

I mentioned locales, but it could be versions (getting the active/last version), ...

8