GdaRenderer

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

## Synopsis

                GdaRenderer;
    enum        GdaRendererOptions;
    gchar*      gda_renderer_render_as_sql      (GdaRenderer *iface,
                                                 GdaParameterList *context,
                                                 guint options,
                                                 GError **error);
    gchar*      gda_renderer_render_as_str      (GdaRenderer *iface,
                                                 GdaParameterList *context);
    gboolean    gda_renderer_is_valid           (GdaRenderer *iface,
                                                 GdaParameterList *context,
                                                 GError **error);

## Object Hierarchy

      GInterface
       +----GdaRenderer

## Prerequisites

GdaRenderer requires GObject.

## Known Implementations

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

## Description

## Details

### GdaRenderer

    typedef struct _GdaRenderer GdaRenderer;

### enum GdaRendererOptions

    typedef enum {
    	GDA_RENDERER_EXTRA_PRETTY_SQL       = 1 << 0,
    	GDA_RENDERER_EXTRA_VAL_ATTRS        = 1 << 1,
    	GDA_RENDERER_ERROR_IF_DEFAULT       = 1 << 2,
    	GDA_RENDERER_FIELDS_NO_TARGET_ALIAS = 1 << 3
    } GdaRendererOptions;

`GDA_RENDERER_EXTRA_PRETTY_SQL` | The rendered statement will output easy to read SQL
`GDA_RENDERER_EXTRA_VAL_ATTRS` | The rendered statement will include some extra text (not part of SQL) for parameters desecription
`GDA_RENDERER_ERROR_IF_DEFAULT` |
`GDA_RENDERER_FIELDS_NO_TARGET_ALIAS` |

### gda_renderer_render_as_sql ()

    gchar*      gda_renderer_render_as_sql      (GdaRenderer *iface,
                                                 GdaParameterList *context,
                                                 guint 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.

`iface` : | an object which implements the GdaRenderer interface
`context` : | rendering context
`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.

`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).

`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`