sqlalchemy :: engine :: default :: DefaultExecutionContext :: Class DefaultExecutionContext
[hide private]
[frames] | no frames]

Class DefaultExecutionContext


Instance Methods [hide private]
 
engine(self)
 
postfetch_cols(self)
 
prefetch_cols(self)
 
returning_cols(self)
 
no_parameters(self)
 
should_autocommit(self)
 
_execute_scalar(self, stmt, type_)
Execute a string statement on the current cursor, returning a scalar result.
 
should_autocommit_text(self, statement)
Parse the given textual statement and return True if it refers to a "committable" statement
 
create_cursor(self)
Return a new cursor generated from this ExecutionContext's connection.
 
pre_exec(self)
Called before an execution of a compiled statement.
 
post_exec(self)
Called after the execution of a compiled statement.
 
get_result_processor(self, type_, colname, coltype)
Return a 'result processor' for a given type as present in cursor.description.
 
get_lastrowid(self)
return self.cursor.lastrowid, or equivalent, after an INSERT.
 
handle_dbapi_exception(self, e)
Receive a DBAPI exception which occurred upon execute, result fetch, etc.
 
get_result_proxy(self)
 
supports_sane_rowcount(self)
 
supports_sane_multi_rowcount(self)
 
_setup_crud_result_proxy(self)
 
_setup_ins_pk_from_lastrowid(self)
 
_setup_ins_pk_from_empty(self)
 
_setup_ins_pk_from_implicit_returning(self, row)
 
lastrow_has_defaults(self)
Return True if the last INSERT or UPDATE row contained inlined or database-side defaults.
 
set_input_sizes(self, translate=None, exclude_types=None)
Given a cursor and ClauseParameters, call the appropriate style of ``setinputsizes()`` on the cursor, using DB-API types from the bind parameter's ``TypeEngine`` objects.
 
_exec_default(self, default, type_)
 
get_insert_default(self, column)
 
get_update_default(self, column)
 
_process_executemany_defaults(self)
 
_process_executesingle_defaults(self)

Inherited from interfaces.ExecutionContext: get_rowcount, result

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_init_ddl(cls, dialect, connection, dbapi_connection, compiled_ddl)
Initialize execution context for a DDLElement construct.
 
_init_compiled(cls, dialect, connection, dbapi_connection, compiled, parameters)
Initialize execution context for a Compiled construct.
 
_init_statement(cls, dialect, connection, dbapi_connection, statement, parameters)
Initialize execution context for a string SQL statement.
 
_init_default(cls, dialect, connection, dbapi_connection)
Initialize execution context for a ColumnDefault construct.
Class Variables [hide private]
  isinsert = False
  isupdate = False
  isdelete = False
  is_crud = False
  is_text = False
  isddl = False
  executemany = False
  compiled = None
hash(x)
  statement = None
hash(x)
  result_column_struct = None
hash(x)
  _is_implicit_returning = False
  _is_explicit_returning = False
  _translate_colname = None
hash(x)

Inherited from interfaces.ExecutionContext: exception, is_disconnect

Properties [hide private]
  connection
  rowcount

Inherited from object: __class__

Method Details [hide private]

engine(self)

 
Decorators:
  • @util.memoized_property

postfetch_cols(self)

 
Decorators:
  • @util.memoized_property

prefetch_cols(self)

 
Decorators:
  • @util.memoized_property

returning_cols(self)

 
Decorators:
  • @util.memoized_property

no_parameters(self)

 
Decorators:
  • @util.memoized_property

should_autocommit(self)

 
Decorators:
  • @util.memoized_property

_execute_scalar(self, stmt, type_)

 

Execute a string statement on the current cursor, returning a scalar result.

Used to fire off sequences, default phrases, and "select lastrowid" types of statements individually or in the context of a parent INSERT or UPDATE statement.

should_autocommit_text(self, statement)

 

Parse the given textual statement and return True if it refers to a "committable" statement

Overrides: interfaces.ExecutionContext.should_autocommit_text
(inherited documentation)

create_cursor(self)

 

Return a new cursor generated from this ExecutionContext's connection.

Some dialects may wish to change the behavior of connection.cursor(), such as postgresql which may return a PG "server side" cursor.

Overrides: interfaces.ExecutionContext.create_cursor
(inherited documentation)

pre_exec(self)

 

Called before an execution of a compiled statement.

If a compiled statement was passed to this ExecutionContext, the `statement` and `parameters` datamembers must be initialized after this statement is complete.

Overrides: interfaces.ExecutionContext.pre_exec
(inherited documentation)

post_exec(self)

 

Called after the execution of a compiled statement.

If a compiled statement was passed to this ExecutionContext, the `last_insert_ids`, `last_inserted_params`, etc. datamembers should be available after this method completes.

Overrides: interfaces.ExecutionContext.post_exec
(inherited documentation)

get_result_processor(self, type_, colname, coltype)

 

Return a 'result processor' for a given type as present in cursor.description.

This has a default implementation that dialects can override for context-sensitive result type handling.

get_lastrowid(self)

 

return self.cursor.lastrowid, or equivalent, after an INSERT.

This may involve calling special cursor functions, issuing a new SELECT on the cursor (or a new one), or returning a stored value that was calculated within post_exec().

This function will only be called for dialects which support "implicit" primary key generation, keep preexecute_autoincrement_sequences set to False, and when no explicit id value was bound to the statement.

The function is called once, directly after post_exec() and before the transaction is committed or ResultProxy is generated. If the post_exec() method assigns a value to `self._lastrowid`, the value is used in place of calling get_lastrowid().

Note that this method is *not* equivalent to the ``lastrowid`` method on ``ResultProxy``, which is a direct proxy to the DBAPI ``lastrowid`` accessor in all cases.

handle_dbapi_exception(self, e)

 

Receive a DBAPI exception which occurred upon execute, result fetch, etc.

Overrides: interfaces.ExecutionContext.handle_dbapi_exception
(inherited documentation)

lastrow_has_defaults(self)

 

Return True if the last INSERT or UPDATE row contained inlined or database-side defaults.

Overrides: interfaces.ExecutionContext.lastrow_has_defaults
(inherited documentation)

set_input_sizes(self, translate=None, exclude_types=None)

 

Given a cursor and ClauseParameters, call the appropriate style of ``setinputsizes()`` on the cursor, using DB-API types from the bind parameter's ``TypeEngine`` objects.

This method only called by those dialects which require it, currently cx_oracle.


Property Details [hide private]

connection

Get Method:
unreachable.connection(self)

rowcount

Get Method:
unreachable.rowcount(self)