Medoo
Medoo copied to clipboard
Feature Request : Global filter for tenancy or saas cases etc.
I simply need to add where into all queries. Exceptionally insert queries doesn't have where but it contains the exactly same column(s) as row field(s). Actually i know i can do that with extending Medoo class but i guess if it's possible in main repo, better than that.
For example:
$db->addGlobalWhere('tenancy',["tenant_id"=>$tenant_id]);
$db->select("customers","*",["type"=>"sellers"]);
// It would be run like below
$db->select("customers","*",["type"=>"sellers","tenant_id"=>$tenant_id]);
// For disabling
$db->disableGlobalWhere('tenancy');
Thanks for all your efforts.
I don't think this is really needed for the database framework.
You can maintain the where alone (global / middleware) for the best flexibility.