cymple.builder.DeleteAvailable

class cymple.builder.DeleteAvailable(query)

Bases: Return, CaseWhen, Union

A class decorator declares a Delete is available in the current query.

__init__(query)

Initialize the query object.

Methods

__init__(query)

Initialize the query object.

case_when(filters, on_true, on_false, ref_name)

Concatenate a CASE WHEN clause to the query, created from a list of given property filters.

cypher(cypher_query_str)

Concatenate a cypher query string

get()

Get the final query string .

return_literal(literal)

Concatenate a literal RETURN statement.

return_mapping(mappings)

Concatenate a RETURN statement for multiple objects.

union()

Combines the results of two or more queries.

union_all()

Combines the results of two or more queries including duplicates.

case_when(filters: dict, on_true: str, on_false: str, ref_name: str, comparison_operator: str = '=', boolean_operator: str = 'AND', **kwargs)

Concatenate a CASE WHEN clause to the query, created from a list of given property filters.

Parameters:
  • filters (dict) – A dict representing the set of properties to be filtered

  • on_true (str) – The query to run when the predicate is true

  • on_false (str) – The query to run when the predicate is false

  • ref_name (str) – The name which is used to refer to the newly filtered object

  • comparison_operator (str) – A string operator, according to which the comparison between property values is done, e.g. for “=”, we get: property.name = property.value, defaults to “=”

  • boolean_operator (str) – The boolean operator to apply between predicates, defaults to “AND”

  • **kwargs

    kwargs

:type **kwargs

Returns:

A Query object with a query that contains the new clause.

Return type:

CaseWhenAvailable

cypher(cypher_query_str)

Concatenate a cypher query string

get()

Get the final query string .

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:

ReturnAvailable

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:

ReturnAvailable

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:

UnionAvailable

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:

UnionAvailable