WilliamRen / django-pyodbc

Automatically exported from code.google.com/p/django-pyodbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Are Sql Server schemas supported? #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a table, say: Myschema.Mytable

I have tried creating

class Mytable(models.model):
...
    class Meta:
        db_table = u'Mytable'
        db_tablespace = u'Myschema'

but I get database errors when I try to access.

Original issue reported on code.google.com by matt.j.s...@gmail.com on 16 Jan 2009 at 12:57

GoogleCodeExporter commented 8 years ago
No really, the 'tablespace'-related options and settings in Django are
Oracle-specific (they were added when its driver was merged in to Django trunk 
code,
see http://code.djangoproject.com/wiki/OracleBranch#Tablespaceoptions) so they 
won't
be of help to you.

Schemas aren't currently supported. 6148 
(http://code.djangoproject.com/ticket/6148)
seems to be the Django ticket that seems to be tracking this the addition of 
this
feature in a generic way.

Not closing this issue but setting its priority to low because we will need to 
wait
for the Django developers making a decision here.

Original comment by cra...@gmail.com on 18 Jan 2009 at 1:20

GoogleCodeExporter commented 8 years ago
You can use this to support db schema:
class Mytable(models.model):
...
    class Meta:
        db_table = u'Myschema].[Mytable'

also can use this with databases:
db_table = u'db].[schema].[table'

Original comment by vcc.ch...@gmail.com on 19 Jan 2009 at 9:31

GoogleCodeExporter commented 8 years ago
Adam V. from the django-mssql project here, with a note to this project's 
devs...

After doing some research, I think the Oracle "Tablespaces" features maps more 
closely to the SQL Server "filegroups" feature; both relate to how database 
objects 
get mapped to physical files.

While it would (probably) be possible to use tablespace support in Django to 
support 
SQL Server Schemas, I'm not sure that would be an appropriate mapping of 
features.

(This project is of course free to do whatever it wants! ;)

Original comment by fla...@gmail.com on 27 Jan 2009 at 6:05