spinedb_api.db_mapping_query_mixin
Module Contents
Classes
Provides the |
- class spinedb_api.db_mapping_query_mixin.DatabaseMappingQueryMixin(*args, **kwargs)[source]
Provides the
query()
method for performing customSELECT
queries.- property superclass_subclass_sq[source]
A subquery of the form:
SELECT * FROM superclass_subclass
- Returns:
- property entity_class_dimension_sq[source]
A subquery of the form:
SELECT * FROM entity_class_dimension
- Returns:
- property wide_entity_class_sq[source]
A subquery of the form:
SELECT ec.*, count(ecd.dimension_id) AS dimension_count group_concat(ecd.dimension_id) AS dimension_id_list FROM entity_class AS ec entity_class_dimension AS ecd WHERE ec.id == ecd.entity_class_id
- Returns:
- property wide_entity_sq[source]
A subquery of the form:
SELECT e.*, count(ee.element_id) AS element_count group_concat(ee.element_id) AS element_id_list FROM entity AS e entity_element AS ee WHERE e.id == ee.entity_id
- Returns:
- property scenario_alternative_sq[source]
A subquery of the form:
SELECT * FROM scenario_alternative
- Returns:
- property entity_alternative_sq[source]
A subquery of the form:
SELECT * FROM entity_alternative
- Returns:
- property parameter_value_list_sq[source]
A subquery of the form:
SELECT * FROM parameter_value_list
- Returns:
- property parameter_definition_sq[source]
A subquery of the form:
SELECT * FROM parameter_definition
- Returns:
- property parameter_value_metadata_sq[source]
A subquery of the form:
SELECT * FROM parameter_value_metadata
- Returns:
- override_entity_class_sq_maker(method)[source]
Overrides the function that creates the
entity_class_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns entity class subquery as anAlias
object
- override_entity_sq_maker(method)[source]
Overrides the function that creates the
entity_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns entity subquery as anAlias
object
- override_entity_element_sq_maker(method)[source]
Overrides the function that creates the
entity_element_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns entity_element subquery as anAlias
object
- override_parameter_definition_sq_maker(method)[source]
Overrides the function that creates the
parameter_definition_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns parameter definition subquery as anAlias
object
- override_parameter_value_sq_maker(method)[source]
Overrides the function that creates the
parameter_value_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns parameter value subquery as anAlias
object
- override_alternative_sq_maker(method)[source]
Overrides the function that creates the
alternative_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns alternative subquery as anAlias
object
- override_scenario_sq_maker(method)[source]
Overrides the function that creates the
scenario_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns scenario subquery as anAlias
object
- override_scenario_alternative_sq_maker(method)[source]
Overrides the function that creates the
scenario_alternative_sq
property.- Parameters:
method (Callable) – a function that accepts a
DatabaseMapping
as its argument and returns scenario alternative subquery as anAlias
object
- restore_entity_class_sq_maker()[source]
Restores the original function that creates the
entity_class_sq
property.
- restore_entity_sq_maker()[source]
Restores the original function that creates the
entity_sq
property.
- restore_entity_element_sq_maker()[source]
Restores the original function that creates the
entity_element_sq
property.
- restore_parameter_definition_sq_maker()[source]
Restores the original function that creates the
parameter_definition_sq
property.
- restore_parameter_value_sq_maker()[source]
Restores the original function that creates the
parameter_value_sq
property.
- restore_alternative_sq_maker()[source]
Restores the original function that creates the
alternative_sq
property.