summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/oursql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-24 22:50:58 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-24 22:50:58 +0000
commit770e1ddc1338f5b4ca603bd273b985955bd65126 (patch)
treef84cf04dc070382169ce98037d90fe3233a132d4 /lib/sqlalchemy/dialects/mysql/oursql.py
parentd3e49722d19068ccc6cdd577748b4b8df158db9c (diff)
downloadsqlalchemy-770e1ddc1338f5b4ca603bd273b985955bd65126.tar.gz
- Connection has execution_options(), generative method
which accepts keywords that affect how the statement is executed w.r.t. the DBAPI. Currently supports "stream_results", causes psycopg2 to use a server side cursor for that statement. Can also be set upon select() and text() constructs directly as well as ORM Query().
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/oursql.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/oursql.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/oursql.py b/lib/sqlalchemy/dialects/mysql/oursql.py
index 70bec53a3..dc1310db7 100644
--- a/lib/sqlalchemy/dialects/mysql/oursql.py
+++ b/lib/sqlalchemy/dialects/mysql/oursql.py
@@ -54,7 +54,7 @@ class MySQL_oursqlExecutionContext(MySQLExecutionContext):
@property
def plain_query(self):
- return self._connection.options.get('plain_query', False)
+ return self.execution_options.get('_oursql_plain_query', False)
class MySQL_oursql(MySQLDialect):
@@ -90,7 +90,7 @@ class MySQL_oursql(MySQLDialect):
connection.cursor().execute('BEGIN', plain_query=True)
def _xa_query(self, connection, query, xid):
- connection._with_options(plain_query=True).execute(query % connection.connection._escape_string(xid))
+ connection.execution_options(_oursql_plain_query=True).execute(query % connection.connection._escape_string(xid))
# Because mysql is bad, these methods have to be reimplemented to use _PlainQuery. Basically, some queries
# refuse to return any data if they're run through the parameterized query API, or refuse to be parameterized
@@ -115,12 +115,12 @@ class MySQL_oursql(MySQLDialect):
self._xa_query(connection, 'XA COMMIT "%s"', xid)
def has_table(self, connection, table_name, schema=None):
- return MySQLDialect.has_table(self, connection._with_options(plain_query=True), table_name, schema)
+ return MySQLDialect.has_table(self, connection.execution_options(_oursql_plain_query=True), table_name, schema)
def _show_create_table(self, connection, table, charset=None,
full_name=None):
return MySQLDialect._show_create_table(self,
- connection.contextual_connect(close_with_result=True)._with_options(plain_query=True),
+ connection.contextual_connect(close_with_result=True).execution_options(_oursql_plain_query=True),
table, charset, full_name)
def is_disconnect(self, e):