MidgardQuerySelect

MidgardQuerySelect

Synopsis

                    MidgardQuerySelect;
struct              MidgardQuerySelectClass;
MidgardQuerySelect * midgard_query_select_new           (MidgardConnection *mgd,
                                                         MidgardQueryStorage *storage);
MidgardDBObject **  midgard_query_select_list_objects   (MidgardQuerySelect *self,
                                                         guint *n_objects);
void                midgard_query_select_toggle_read_only
                                                        (MidgardQuerySelect *self,
                                                         gboolean toggle);
void                midgard_query_select_include_deleted
                                                        (MidgardQuerySelect *self,
                                                         gboolean toggle);

Object Hierarchy

  GObject
   +----MidgardQueryExecutor
         +----MidgardQuerySelect

Implemented Interfaces

MidgardQuerySelect implements MidgardExecutable and MidgardValidable.

Properties

  "connection"               MidgardConnection*    : Write / Construct Only
  "storage"                  MidgardQueryStorage*  : Read / Write / Construct Only

Description

Details

MidgardQuerySelect

typedef struct _MidgardQuerySelect MidgardQuerySelect;


struct MidgardQuerySelectClass

struct MidgardQuerySelectClass {
	MidgardQueryExecutorClass parent;

	MidgardDBObject **(*list_objects)		(MidgardQuerySelect *self, guint *n_objects);
	void		(*toggle_read_only)		(MidgardQuerySelect *self, gboolean toggle);
	void		(*include_deleted)		(MidgardQuerySelect *self, gboolean toggle);
};


midgard_query_select_new ()

MidgardQuerySelect * midgard_query_select_new           (MidgardConnection *mgd,
                                                         MidgardQueryStorage *storage);

MidgardStorage storage represents storage which is queried during execution

By default, for performance reason, MidgardQuerySelect is instantiated in read only mode. See: midgard_query_select_toggle_read_only().

mgd :

MidgardConnection instance

storage :

MidgardStorage instance

Returns :

new MidgardQuerySelect instance or NULL on failure

Since 10.05


midgard_query_select_list_objects ()

MidgardDBObject **  midgard_query_select_list_objects   (MidgardQuerySelect *self,
                                                         guint *n_objects);

List all objects for which data has been returned during execution.

self :

MidgardQuerySelect instance

n_objects :

pointer to store number of returned objects

Returns :

newly allocated array of MidgardDBObject. [element-type MidgardDBObject][array length=n_objects][transfer full]

Since 10.05


midgard_query_select_toggle_read_only ()

void                midgard_query_select_toggle_read_only
                                                        (MidgardQuerySelect *self,
                                                         gboolean toggle);

This method switch MidgardQuerySelect to read only mode. It should be enabled when returned objects will be used only to read properties. It improves performance, but it's impossible to write returned object's properties.

By default, for performance reason, MidgardQuerySelect is instantiated in read only mode.

self :

MidgardQuerySelect instance

toggle :

enables or disables read only mode

Since 10.05


midgard_query_select_include_deleted ()

void                midgard_query_select_include_deleted
                                                        (MidgardQuerySelect *self,
                                                         gboolean toggle);

By default, MidgardQuerySelect ignores deleted objects. With this method, you can set deleted objects toggle, so such can be included in execute results. This method may be called as many times as needed, to include (TRUE) or exclude (FALSE) deleted objects.

This is valid only for those classes which has 'metadata' (of MidgardMetadata type) or 'deleted' property installed.

self :

MidgardQuerySelect instance

toggle :

toggle to include or exclude deleted objects

Since 10.05.1

Property Details

The "connection" property

  "connection"               MidgardConnection*    : Write / Construct Only

Pointer for a connection, MidgardQuerySelect has been initialized for


The "storage" property

  "storage"                  MidgardQueryStorage*  : Read / Write / Construct Only

Pointer for a connection, MidgardQuerySelect has been initialized for