inspectomop.results.Results

class inspectomop.results.Results(cursor_result)

A cursor-like object with methods such as fetchone, fetchmany etc. that can be used to retrieve rows of results from query execution.

A subclass of sqlalchemy.engine.CursorResult that adds additional methods for retrieving query results as Pandas DataFrames.

__init__(cursor_result)

Methods

__init__(cursor_result)

all()

Return all rows in a sequence.

as_pandas()

Return all rows from a results object as a pandas DataFrame

as_pandas_chunks(chunksize)

Yields a pandas DataFrame with n_rows = chunksize

close()

Close this _engine.CursorResult.

columns(*col_expressions)

Establish the columns that should be returned in each row.

fetchall()

A synonym for the _engine.Result.all() method.

fetchmany([size])

Fetch many rows.

fetchone()

Fetch one row.

first()

Fetch the first row or None if no row is present.

freeze()

Return a callable object that will produce copies of this _engine.Result when invoked.

keys()

Return an iterable view which yields the string keys that would be represented by each _engine.Row.

last_inserted_params()

Return the collection of inserted parameters from this execution.

last_updated_params()

Return the collection of updated parameters from this execution.

lastrow_has_defaults()

Return lastrow_has_defaults() from the underlying ExecutionContext.

mappings()

Apply a mappings filter to returned rows, returning an instance of _engine.MappingResult.

memoized_instancemethod(fn)

Decorate a method memoize its return value.

merge(*others)

Merge this _engine.Result with other compatible result objects.

one()

Return exactly one row or raise an exception.

one_or_non()

one_or_none()

Return at most one result or raise an exception.

partitions([size])

Iterate through sub-lists of rows of the size given.

postfetch_cols()

Return postfetch_cols() from the underlying ExecutionContext.

prefetch_cols()

Return prefetch_cols() from the underlying ExecutionContext.

scalar()

Fetch the first column of the first row, and close the result set.

scalar_one()

Return exactly one scalar result or raise an exception.

scalar_one_or_none()

Return exactly one scalar result or None.

scalars()

Return a _engine.ScalarResult filtering object which will return single elements rather than _row.Row objects.

splice_horizontally(other)

Return a new CursorResult that "horizontally splices" together the rows of this CursorResult with that of another CursorResult.

splice_vertically(other)

Return a new CursorResult that "vertically splices", i.e. "extends", the rows of this CursorResult with that of another CursorResult.

supports_sane_multi_rowcount()

Return supports_sane_multi_rowcount from the dialect.

supports_sane_rowcount()

Return supports_sane_rowcount from the dialect.

tuples()

Apply a "typed tuple" typing filter to returned rows.

unique([strategy])

Apply unique filtering to the objects returned by this _engine.Result.

yield_per(num)

Configure the row-fetching strategy to fetch num rows at a time.

Attributes

context

dialect

cursor

cursor_strategy

connection

closed

inserted_primary_key

Return the primary key for the row just inserted.

inserted_primary_key_rows

Return the value of _engine.CursorResult.inserted_primary_key as a row contained within a list; some dialects may support a multiple row form as well.

is_insert

True if this _engine.CursorResult is the result of a executing an expression language compiled _expression.insert() construct.

lastrowid

Return the 'lastrowid' accessor on the DBAPI cursor.

returned_defaults

Return the values of default columns that were fetched using the ValuesBase.return_defaults() feature.

returned_defaults_rows

Return a list of rows each containing the values of default columns that were fetched using the ValuesBase.return_defaults() feature.

returns_rows

True if this _engine.CursorResult returns zero or more rows.

rowcount

Return the 'rowcount' for this result.

t

Apply a "typed tuple" typing filter to returned rows.