it likely an old bug in 0.5 can you try 0.6.7 ? unknown types should be
ignored during reflection.
On May 4, 2011, at 3:04 PM, Thang Nguyen wrote:
> Hi,
>
> I am running into an error with sqlalchemy when using XML datatype in
> MSSQL (existing table). My test_table just has two columns: id, test.
> The test column is xml datatype. Is XML datatype supported? Or is
> it something I did not do correctly?
> Thanks for your help in advance.
> TPN
>
>
> Here is the statement that generates the error:
> =================================
>
> t_test_table = Table('test_table', metadata, autoload=True, autoload_with=eng)
>
> Here is the error:
> ============
>
> File "./ePackages/sqlalchemy/databases/mssql.py", line 1240, in reflecttable
> if issubclass(coltype, sqltypes.Numeric):
> TypeError: issubclass() arg 1 must be a class
>
> The version of sqlalchemy:
> ===================
>>>> import sqlalchemy
>>>> print sqlalchemy.__version__
> 0.5.5
>
> Here is the script (test_xml.py):
> ======================
>
> import ePackages
> import pyodbc
> import sqlalchemy
> from sqlalchemy import *
>
> session = None
> metadata = MetaData()
>
> def pycon():
> return
> pyodbc.connect("DRIVER={FreeTDS};SERVER=myserver;DATABASE=MYDATABASE;PORT=1435;UID=MYUSER;PWD=MYPASS")
>
> def init_model(eng):
> global session, metadata
>
> metadata.bind = eng
> t_test_table = Table('test_table', metadata, autoload=True,
> autoload_with=eng)
> sm = sqlalchemy.orm.sessionmaker(autoflush=False,
> autocommit=False, bind=eng)
> session = sqlalchemy.orm.scoped_session(sm)
>
> print "testpoint 1"
> engine = create_engine('mssql://', creator=pycon, echo=True)
> print "testpoint 2"
> init_model(engine)
> print "testpoint 3"
>
> --
> 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.
>
--
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.