Hi all,
I still have problems with the "default_schema" and the way it's
handled in the mssql backend.
The following little program fails. If I run it with a simple user
(let's name it "tester"), I end up with a table "tester.t1", while
the function drop() look for a table "dbo.t1".
I can't figure if the misbehaving part is the table creation which is
not explicit, the drop which is too explicit, or the
dialect.default_schema which doesn't return the correct value.
The program:
1 from sqlalchemy import *
2
3 import sys
4
5 engine = create_engine(sys.argv[1], echo=True)
6 meta = MetaData(engine)
7
8 t = Table('t1', meta, Column('id', Integer()))
9
10 t.create()
11 t.drop(checkfirst=True)
Here is the echoed logs :
2007-08-13 17:48:42,550 INFO sqlalchemy.engine.base.Engine.0x..b4
CREATE TABLE t1 (
id INTEGER
)
2007-08-13 17:48:42,550 INFO sqlalchemy.engine.base.Engine.0x..b4 None
2007-08-13 17:48:42,551 INFO sqlalchemy.engine.base.Engine.0x..b4 COMMIT
2007-08-13 17:48:42,566 INFO sqlalchemy.engine.base.Engine.0x..b4 SET nocount ON
2007-08-13 17:48:42,566 INFO sqlalchemy.engine.base.Engine.0x..b4 None
2007-08-13 17:48:42,567 INFO sqlalchemy.engine.base.Engine.0x..b4
SELECT [COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME],
[COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].[IS_NULLABLE],
[COLUMNS_1].[DATA_TYPE], [COLUMNS_1].[ORDINAL_POSITION],
[COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH],
[COLUMNS_1].[NUMERIC_PRECISION], [COLUMNS_1].[NUMERIC_SCALE],
[COLUMNS_1].[COLUMN_DEFAULT]
FROM [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1]
WHERE [COLUMNS_1].[TABLE_NAME] = ? AND [COLUMNS_1].[TABLE_SCHEMA] = ?
2007-08-13 17:48:42,567 INFO sqlalchemy.engine.base.Engine.0x..b4 ['t1', 'dbo']
c
Regards,
Christophe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---