From 705f308452b0741747c27ee4edcd75f2ec0e6ae8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 1 Jan 2006 21:08:22 +0000 Subject: rowid_column becomes more like the "order by column". 'default_ordering' flag sent to create_engine enables whether or not the rowid_column on a Table will be None or not. mappers/relations will by default use the rowid_column for ordering if its not None, else theres no default ordering. still should better define 'default_ordering'/'rowid_column' relationship since its a little kludgy. --- lib/sqlalchemy/engine.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/engine.py') diff --git a/lib/sqlalchemy/engine.py b/lib/sqlalchemy/engine.py index f3cc8efad..68cf08931 100644 --- a/lib/sqlalchemy/engine.py +++ b/lib/sqlalchemy/engine.py @@ -161,7 +161,7 @@ class SQLEngine(schema.SchemaEngine): SQLEngines are constructed via the create_engine() function inside this package. """ - def __init__(self, pool = None, echo = False, logger = None, **params): + def __init__(self, pool=None, echo=False, logger=None, default_ordering=False, **params): """constructs a new SQLEngine. SQLEngines should be constructed via the create_engine() function which will construct the appropriate subclass of SQLEngine.""" # get a handle on the connection pool via the connect arguments @@ -172,6 +172,7 @@ class SQLEngine(schema.SchemaEngine): self._pool = sqlalchemy.pool.manage(self.dbapi(), **params).get_pool(*cargs, **cparams) else: self._pool = pool + self.default_ordering=default_ordering self.echo = echo self.context = util.ThreadLocal(raiseerror=False) self.tables = {} @@ -258,7 +259,7 @@ class SQLEngine(schema.SchemaEngine): raise NotImplementedError() def rowid_column_name(self): - """returns the ROWID column name for this engine.""" + """returns the ROWID column name for this engine, or None if the engine cant/wont support OID/ROWID.""" return "oid" def supports_sane_rowcount(self): -- cgit v1.2.1