cymple.builder.ReturnAvailable
- class cymple.builder.ReturnAvailable(query)
Bases:
QueryStartAvailable
,Unwind
,Return
,Limit
,Skip
,OrderBy
,Union
A class decorator declares a Return is available in the current query.
- __init__(query)
Initialize the query object.
Methods
__init__
(query)Initialize the query object.
call
()Concatenate the "CALL" clause.
create
()Concatenate the "CREATE" clause.
cypher
(cypher_query_str)Concatenate a cypher query string
get
()Get the final query string .
limit
(limitation)Concatenate a limit statement.
match
()Concatenate the "MATCH" clause.
Concatenate the "MATCH" clause.
merge
()Concatenate the "MERGE" clause.
order_by
(sorting_properties[, ascending])Concatenate an order by statement.
return_literal
(literal)Concatenate a literal RETURN statement.
return_mapping
(mappings)Concatenate a RETURN statement for multiple objects.
skip
(skip_count)Concatenate a skip statement.
union
()Combines the results of two or more queries.
Combines the results of two or more queries including duplicates.
unwind
(variables)Concatenate an UNWIND clause, keeping one or more variables given in 'variables' arg.
with_
(variables)Concatenate a WITH clause, keeping one or more variables given in 'variables' arg.
- call()
Concatenate the “CALL” clause.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- create()
Concatenate the “CREATE” clause.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- cypher(cypher_query_str)
Concatenate a cypher query string
- get()
Get the final query string .
- limit(limitation: int | str)
Concatenate a limit statement.
- Parameters:
limitation (Union[int, str]) – A non-negative integer or a string of cypher expression that evaluates to a non-negative integer (as long as it is not referring to any external variables)
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- match()
Concatenate the “MATCH” clause.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- match_optional()
Concatenate the “MATCH” clause.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- merge()
Concatenate the “MERGE” clause.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- order_by(sorting_properties: str | List[str], ascending: bool = True)
Concatenate an order by statement.
- Parameters:
sorting_properties (Union[str, List[str]]) – A string or a list of strings representing the properties based on which to sort.
ascending (bool) – Use ascending sorting (if false, uses descending)., defaults to True
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- return_literal(literal: str)
Concatenate a literal RETURN statement.
- Parameters:
literal (str) – A Cypher string describing the objects to be returned, referencing name/names which were defined earlier in the query
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- return_mapping(mappings: List[Mapping])
Concatenate a RETURN statement for multiple objects.
- Parameters:
mappings (List[Mapping]) – The mapping (or a list of mappings) of db property names to code names, to be returned
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- skip(skip_count: int | str)
Concatenate a skip statement.
- Parameters:
skip_count (Union[int, str]) – A non-negative integer or a string of cypher expression that evaluates to a non-negative integer (as long as it is not referring to any external variables)
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- union()
Combines the results of two or more queries. Duplicates are removed.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- union_all()
Combines the results of two or more queries including duplicates.
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- unwind(variables: str)
Concatenate an UNWIND clause, keeping one or more variables given in ‘variables’ arg.
- Parameters:
variables (str) – A string refering to previously obtained variables, comma seperated
- Returns:
A Query object with a query that contains the new clause.
- Return type:
- with_(variables: str)
Concatenate a WITH clause, keeping one or more variables given in ‘variables’ arg.
- Parameters:
variables (str) – A string refering to previously obtained variables, comma seperated
- Returns:
A Query object with a query that contains the new clause.
- Return type: