I know this has been touched on a couple times, but I have an itch for database schema support I'd like to scratch. The relevant ticket it #6148 [1]. I was thinking the Options class would grow a db_schema field, which would default to settings.DEFAULT_DATABASE_SCHEMA. Then everywhere that currently deals with db_table will also take db_schema into account, if specified.
My initial thought was that it'd be relatively easy to introduce a new Options property, db_quoted_name (or something), that would return an already-quoted "schema"."table" string, then use this in place of db_table pretty much everywhere. This will avoid having to muck with the join tuples and aliases in django.db.models.sql.query, since db_quoted_name will be canonical (db_table no longer will be). There will be certain places (index and sequence SQL generation come to mind) where the schema will need to be dealt with separately. Also, the table introspection code will need to return schema names as well as table names, if applicable. The ticket mentions app-level schema support, which would be nice, but I think can be punted until #3591 [2] lands. Then the app class could take a schema argument that would be propagated to the models when the app is loaded, for models that do not already define db_schema. Any thoughts or suggestions? [1] http://code.djangoproject.com/ticket/6148 [2] http://code.djangoproject.com/ticket/3591 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---