Hi,
Can anyone tell me what's I'm doing worng. The DB itself is fine I
access it via SA successfully from my web app (TG2). But, I need to
write a utility that uses it outside of the web app.
Here is my code:
>>> db = 'sqlite:///data/test.db'
>>> e = create_engine(db)
>>> m = MetaData(bind=e)
>>> m.reflect()
Here is what I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
schema.py", line 1702, in reflect
Table(name, self, **reflect_opts)
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
schema.py", line 113, in __call__
return type.__call__(self, name, metadata, *args, **kwargs)
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
schema.py", line 241, in __init__
_bind_or_error(metadata).reflecttable(self,
include_columns=include_columns)
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
engine/base.py", line 1265, in reflecttable
self.dialect.reflecttable(conn, table, include_columns)
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
databases/sqlite.py", line 493, in reflecttable
colargs.append(DefaultClause(sql.text(default)))
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
sql/expression.py", line 821, in text
return _TextClause(text, bind=bind, *args, **kwargs)
File "/home/nine/server/tg2env/SQLAlchemy-0.5.1-py2.5.egg/sqlalchemy/
sql/expression.py", line 2083, in __init__
self.text = self._bind_params_regex.sub(repl, text)
TypeError: expected string or buffer
Thanks, Carl
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---