GdaRenderer

GdaRenderer — Interface to get representations of objects as SQL statements, XML nodes or human readable text

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── GdaRenderer

Prerequisites

GdaRenderer requires GObject.

Known Implementations

GdaRenderer is implemented by GdaDictField, GdaQuery, GdaQueryCondition, GdaQueryFieldAgg, GdaQueryFieldAll, GdaQueryFieldField, GdaQueryFieldFunc, GdaQueryFieldValue and GdaQueryTarget.

Description

Functions

gda_renderer_render_as_sql ()

gchar *
gda_renderer_render_as_sql (GdaRenderer *iface,
                            GdaParameterList *context,
                            GSList **out_params_used,
                            GdaRendererOptions options,
                            GError **error);

Build a SQL statement representing the object, in the specified context.

If context is NULL, then no error related to missing parameters (which should be in the context) is returned, and missing values are replaced by 'human readable' SQL.

If out_params_used is not NULL, then pointers to the GdaParameter objects used to actually render the SQL statement are appended to the list (in case a parameter object is used several times, it is only once listed in the resulting list).

Parameters

iface

an object which implements the GdaRenderer interface

 

context

a GdaParameterList containing values for iface 's parameters, or NULL

 

out_params_used

a place to append GdaParameter which have been used during the rendering process, or NULL

 

options

OR'ed flags from GdaRendererOptions to give some rendering options

 

error

location to store error, or NULL

 

Returns

the new SQL statement (new string), or NULL in case of error


gda_renderer_render_as_str ()

gchar *
gda_renderer_render_as_str (GdaRenderer *iface,
                            GdaParameterList *context);

Build a human readable string representing the object, in the specified context.

Parameters

iface

an object which implements the GdaRenderer interface

 

context

rendering context

 

Returns

the new string


gda_renderer_is_valid ()

gboolean
gda_renderer_is_valid (GdaRenderer *iface,
                       GdaParameterList *context,
                       GError **error);

Tells if iface has all the necessary information in context to be rendered into a valid statement (which can be executed).

Parameters

iface

an object which implements the GdaRenderer interface

 

context

rendering context

 

error

location to store error, or NULL

 

Returns

TRUE if iface can be rendered with context

Types and Values

GdaRenderer

typedef struct _GdaRenderer GdaRenderer;


enum GdaRendererOptions

Members

GDA_RENDERER_EXTRA_PRETTY_SQL

The rendered statement will output easy to read SQL

 

GDA_RENDERER_PARAMS_AS_DETAILED

   

GDA_RENDERER_ERROR_IF_DEFAULT

   

GDA_RENDERER_FIELDS_NO_TARGET_ALIAS

   

GDA_RENDERER_PARAMS_AS_COLON

parameters will be rendered using the :param_name notation (the parameter is "encoded" using gda_parameter_get_alphanum_name(), use gda_alphanum_to_text() to get the unencoded version

 

GDA_RENDERER_PARAMS_AS_DOLLAR

parameters will be rendered using the ?NNN notation where NNN is the prrameter index

 

GDA_RENDERER_PARAMS_AS_QMARK

parameters will be rendered using the ?NNN notation where NNN is the prrameter index