Medoo icon indicating copy to clipboard operation
Medoo copied to clipboard

Feature Request : Global filter for tenancy or saas cases etc.

Open mehmetriza opened this issue 4 years ago • 1 comments

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.

mehmetriza avatar Jul 01 '21 07:07 mehmetriza

I don't think this is really needed for the database framework.

You can maintain the where alone (global / middleware) for the best flexibility.

catfan avatar Jul 04 '21 15:07 catfan