I recently forked alembic, and have been making a lot of changes to implement multi-schema support. One thing I've noticed is the variable 'tname' tends to be used frequently to refer to what sqlalchemy considers Table.fullname (schema.tablename if schema is present, else tablename). tname implies (to me, at least) table.name, which has no schema. Currently, we have the variable tname frequently referring to the table's fullname, yet being passed into functions which will break if they receive a fullname (backticks around a dotted tablename, ie
schema.table, rather than
It might be a good idea to start distinguishing the two, perhaps via a tfullname vs tname naming scheme based on which format you're referring to, that way when you see a random reference to a tablename in a file, you'll know whether or not it needs special handling to coerce to something usable.
Also, given that so many functions takes a 'schema' parameter, it might be a good idea to take special care when using 'from sqlalchemy import schema', as that then requires aliasing of the schema kwarg in places, which makes things inconsistent. Again, a minor issue, but my fork is now generating migration files where some commands have a "schema" kwarg, and some have "schema_". Given the destination endpoint for all the commands is in the impl file, and those are all set up to accept the 'schema' kwarg, it would be nice to be able to pass it through without concerning oneself with aliasing it partway through the process.