midgard_query_builder functions can be used to manipulate the queries.
|
|
The opaque Midgard Query Builder type. Instances are used to track the state of a query builder. Definition at line 58 of file query_builder.h. |
|
|
The opaque Midgard Query Builder class. Definition at line 87 of file query_builder.h. |
|
||||||||||||||||||||
|
Adds a constraint to the given query builder. The constraint is expressed as a triple of a field name, a comparison operator, and a scalar comparison value. The field name referes to a property of the queried Midgard object class. The comparison operator is a string representation of the requested comparison. Available operators are =, <>, <, >, <=, >=, and LIKE. The given scalar value is copied and converted into the property type before comparison.
This method returns
Definition at line 383 of file query_builder.c. References MidgardQueryBuilder::error, MidgardSimpleConstraint::ext_type, MidgardQueryBuilder::ext_type, MidgardSimpleConstraint::initial_klass, MidgardQueryBuilder::mgd, MidgardSimpleConstraint::parent_type, MidgardQueryBuilder::parent_type, MidgardQueryBuilder::stack, MidgardQueryBuilder::type, MidgardSimpleConstraint::types, and MidgardQueryBuilder::types. Referenced by midgard_collector_new(), midgard_collector_set_key_property(), midgard_import_object(), midgard_object_find(), midgard_object_get_by_guid(), midgard_object_get_by_id(), midgard_object_list(), midgard_object_list_children(), midgard_object_new(), and midgard_object_set_parameter(). |
|
||||||||||||||||
|
Adds an ordering constraint to the query. An ordering constraint consists of a property name and a sort direction. The objects returned by this query will be sorted by the given property in the given direction (ascending or descending). Multiple ordering constraints are applied in the order they were added.
Definition at line 456 of file query_builder.c. References MidgardQueryOrder::ext_type, MidgardQueryBuilder::ext_type, MidgardQueryBuilder::mgd, MidgardQueryBuilder::orders, MidgardQueryOrder::parent_type, MidgardQueryBuilder::parent_type, and MidgardQueryBuilder::type. |
|
||||||||||||
|
Starts a constraint group of the given type. A conjunctive constraint group (type
Definition at line 427 of file query_builder.c. References MidgardQueryBuilder::stack. |
|
|
Returns the number of objects that this query would return when executed without limit or start offset settings.
Definition at line 598 of file query_builder.c. References MidgardQueryBuilder::mgd, MGD_ERR_OK, and MIDGARD_ERRNO_SET. |
|
|
Closes the most recently opened constraint group. The client should ensure proper nesting by closing all constraint groups before the containing query is executed.
Definition at line 444 of file query_builder.c. References MidgardQueryBuilder::stack. |
|
||||||||||||
|
Executes the built query. The matched recors are returned as full MgdObjects.
Definition at line 578 of file query_builder.c. References _MgdObject::data, MidgardQueryBuilder::mgd, MGD_ERR_OK, and MIDGARD_ERRNO_SET. Referenced by midgard_import_object(), midgard_object_get_by_guid(), midgard_object_get_by_id(), midgard_object_list(), midgard_object_list_children(), midgard_object_new(), and midgard_object_set_parameter(). |
|
|
Releases the given query builder and all associated resources.
Definition at line 357 of file query_builder.c. References MidgardQueryBuilder::orders, and MidgardQueryBuilder::stack. |
|
|
Executes the built query. The matched recors are returned as object's guid. Look at midgard_query_builder_execute which returns full objects.
Definition at line 616 of file query_builder.c. |
|
|
Returns MidgardQueryBuilder type. Registers the type as a fundamental GType unless already registered. Definition at line 968 of file query_builder.c. |
|
|
Returns type name of the type which is currently used by Query Builder. This function should be used on language binding level , when internal Query Builder's instance is already created and language binding object should be instanciated.
Definition at line 921 of file query_builder.c. References MidgardQueryBuilder::type. |
|
|
Include deleted objects.
Definition at line 928 of file query_builder.c. References MidgardQueryBuilder::include_deleted. Referenced by midgard_import_object(). |
|
||||||||||||||||||||
|
Joins type's properties' fields in query.
Definition at line 849 of file query_builder.c. References MidgardQueryBuilder::join, MidgardQueryBuilder::link, MidgardQueryBuilder::mgd, midgard_object_new(), MidgardQueryBuilder::tables, and MidgardQueryBuilder::type. Here is the call graph for this function: ![]() |
|
||||||||||||
|
||||||||||||
|
Sets internal lang used by Query Builder.
Definition at line 494 of file query_builder.c. References MidgardQueryBuilder::lang. |
|
||||||||||||
|
Sets the maximum number of objects to return when the query is executed. A query will by default return all matching objects, but the limit setting can be used to restrict the potentially large number of returned objects. The limit is applied only after the matching objects have been identified and sorted and after the optional start offset has been applied. Setting a limit on the number of returned objects is normally only reasonable when one or more ordering constraints and optionally an offset setting are applied to the query.
Definition at line 480 of file query_builder.c. References MidgardQueryBuilder::limit. |
|
||||||||||||
|
Sets the start offset of the objects to return when the query is executed. The start offset is applied after all the matching objects have been identified and sorted according to the given ordering constraints. The first Setting a start offset is normally only reasonable when one or more ordering constraints are applied to the query. A start offset is usually accompanied by a limit setting.
Definition at line 487 of file query_builder.c. References MidgardQueryBuilder::offset. |
|
|
Unset all languages used by given Query Builder instance.
Definition at line 500 of file query_builder.c. References MidgardQueryBuilder::unset_lang. |
1.4.6