Variable | join_condition |
Undocumented |
Class | _repr_base |
Undocumented |
Class | _repr_params |
Provide a string view of bound parameters. |
Class | _repr_row |
Provide a string view of a row. |
Class | ClauseAdapter |
Clones and modifies clauses based on column correspondence. |
Class | ColumnAdapter |
Extends ClauseAdapter with extra utility functions. |
Function | _make_slice |
Compute LIMIT/OFFSET in terms of slice start/end |
Function | _offset_or_limit_clause |
Convert the given value to an "offset or limit" clause. |
Function | _offset_or_limit_clause_asint_if_possible |
Return the offset or limit clause as a simple integer if possible, else return the clause. |
Function | _quote_ddl_expr |
Undocumented |
Function | adapt_criterion_to_null |
given criterion containing bind params, convert selected elements to IS NULL. |
Function | bind_values |
Return an ordered list of "bound" values in the given clause. |
Function | clause_is_present |
Given a target clause and a second to search within, return True if the target is plainly present in the search without any subqueries or aliases involved. |
Function | criterion_as_pairs |
traverse an expression and locate binary criterion pairs. |
Function | expand_column_list_from_order_by |
No summary |
Function | extract_first_column_annotation |
Undocumented |
Function | find_join_source |
No summary |
Function | find_left_clause_that_matches_given |
Given a list of FROM clauses and a selectable, return the indexes from the list of clauses which is derived from the selectable. |
Function | find_left_clause_to_join_from |
Given a list of FROM clauses, a selectable, and optional ON clause, return a list of integer indexes from the clauses list indicating the clauses that can be joined from. |
Function | find_tables |
locate Table objects within the given expression. |
Function | reduce_columns |
given a list of columns, return a 'reduced' set based on natural equivalents. |
Function | selectables_overlap |
Return True if left/right have some overlapping selectable |
Function | splice_joins |
Undocumented |
Function | surface_selectables |
Undocumented |
Function | surface_selectables_only |
Undocumented |
Function | tables_from_leftmost |
Undocumented |
Function | unwrap_label_reference |
Undocumented |
Function | unwrap_order_by |
Break up an 'order by' expression into individual column-expressions, without DESC/ASC/NULLS FIRST/NULLS LAST |
Function | visit_binary_product |
Produce a traversal of the given expression, delivering column comparisons to the given function. |
Convert the given value to an "offset or limit" clause.
This handles incoming integers and converts to an expression; if an expression is already given, it is passed through.
Return an ordered list of "bound" values in the given clause.
E.g.:
>>> expr = and_( ... table.c.foo==5, table.c.foo==7 ... ) >>> bind_values(expr) [5, 7]
Given a target clause and a second to search within, return True if the target is plainly present in the search without any subqueries or aliases involved.
Basically descends through Joins.
Given a list of FROM clauses and a selectable, return the first index and element from the list of clauses which can be joined against the selectable. returns None, None if no match is found.
e.g.:
clause1 = table1.join(table2) clause2 = table4.join(table5) join_to = table2.join(table3) find_join_source([clause1, clause2], join_to) == clause1
Given a list of FROM clauses, a selectable, and optional ON clause, return a list of integer indexes from the clauses list indicating the clauses that can be joined from.
The presence of an "onclause" indicates that at least one clause can definitely be joined from; if the list of clauses is of length one and the onclause is given, returns that index. If the list of clauses is more than length one, and the onclause is given, attempts to locate which clauses contain the same columns.
given a list of columns, return a 'reduced' set based on natural equivalents.
the set is reduced to the smallest list of columns which have no natural equivalent present in the list. A "natural equivalent" means that two columns will ultimately represent the same value because they are related by a foreign key.
*clauses is an optional list of join clauses which will be traversed to further identify columns that are "equivalent".
**kw may specify 'ignore_nonexistent_tables' to ignore foreign keys whose tables are not yet configured, or columns that aren't yet present.
This function is primarily used to determine the most minimal "primary key" from a selectable, by reducing the set of primary key columns present in the selectable to just those that are not repeated.
Produce a traversal of the given expression, delivering column comparisons to the given function.
The function is of the form:
def my_fn(binary, left, right)
For each binary expression located which has a comparison operator, the product of "left" and "right" will be delivered to that function, in terms of that binary.
Hence an expression like:
and_( (a + b) == q + func.sum(e + f), j == r )
would have the traversal:
a <eq> q a <eq> e a <eq> f b <eq> q b <eq> e b <eq> f j <eq> r
That is, every combination of "left" and "right" that doesn't further contain a binary comparison is passed as pairs.