diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-09-22 04:15:46 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-09-22 04:15:46 +0000 |
commit | fb74b7a8bc524496d7de0923df843a093a235c6f (patch) | |
tree | 946f926906f93bad7ce6158bad0f12f0c448e962 /lib/sqlalchemy/engine.py | |
parent | cc39e49c408db7bb6f6310f3a9eb1885edc798be (diff) | |
download | sqlalchemy-fb74b7a8bc524496d7de0923df843a093a235c6f.tar.gz |
Diffstat (limited to 'lib/sqlalchemy/engine.py')
-rw-r--r-- | lib/sqlalchemy/engine.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine.py b/lib/sqlalchemy/engine.py index d177168c2..9b55b5ab0 100644 --- a/lib/sqlalchemy/engine.py +++ b/lib/sqlalchemy/engine.py @@ -24,6 +24,14 @@ import sqlalchemy.util as util import sqlalchemy.sql as sql import StringIO +class TypeDescriptor(object): + def get_col_spec(self): + raise NotImplementedError() + def convert_bind_param(self, value): + raise NotImplementedError() + def convert_result_value(self, value): + raise NotImplementedError() + class SchemaIterator(schema.SchemaVisitor): """a visitor that can gather text into a buffer and execute the contents of the buffer.""" @@ -58,6 +66,9 @@ class SQLEngine(schema.SchemaEngine): self.tables = {} self.notes = {} + def type_descriptor(self, type): + raise NotImplementedError() + def schemagenerator(self, proxy, **params): raise NotImplementedError() @@ -174,6 +185,7 @@ class SQLEngine(schema.SchemaEngine): c = connection.cursor() self.pre_exec(connection, c, statement, parameters, echo = echo, **kwargs) + # TODO: affix TypeDescriptors ehre to pre-process bind params if isinstance(parameters, list): c.executemany(statement, parameters) else: @@ -186,12 +198,14 @@ class SQLEngine(schema.SchemaEngine): class ResultProxy: - def __init__(self, cursor, echo = False): + def __init__(self, cursor, echo = False, engine = None): self.cursor = cursor self.echo = echo + self.engine = engine metadata = cursor.description self.props = {} i = 0 + # TODO: affix TypeDescriptors here to post-process results if metadata is not None: for item in metadata: self.props[item[0]] = i |