Extension to run command across multiple schemas

I have a hosted application with one database and where each company has their own schema.  Each schema has the same set of tables.

I would like to be able to add an extension to the sqlgenerator so for example  an alter table command turns into

set search_path company1_schema,public
alter table command
set search_path company2_schema,public
alter table command

etc …

I think that is not a problem but there are some shared public tables where I want the normal sqlgenertator code behavior and need to indicate to my sqlgenerator to just return what it was given.

Ideas?