## GnomeDbRenderer

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

##

# Synopsis

    struct      GnomeDbRenderer;
    enum        GnomeDbRendererOptions;
    GType       gnome_db_renderer_get_type      (void);
    gchar*      gnome_db_renderer_render_as_sql (GnomeDbRenderer *iface,
                                                 GnomeDbDataSet *context,
                                                 guint options,
                                                 GError **error);
    gchar*      gnome_db_renderer_render_as_str (GnomeDbRenderer *iface,
                                                 GnomeDbDataSet *context);
    gboolean    gnome_db_renderer_is_valid      (GnomeDbRenderer *iface,
                                                 GnomeDbDataSet *context,
                                                 GError **error);

## Object Hierarchy

      GInterface
       +----GnomeDbRenderer

## Prerequisites

GnomeDbRenderer requires GObject.

## Known Implementations

GnomeDbRenderer is implemented by GnomeDbQuery, GnomeDbTableField, GnomeDbQfField, GnomeDbQfAll, GnomeDbQfValue, GnomeDbTarget, GnomeDbCondition, GnomeDbQfFunc and GnomeDbQfAgg.

## Description

## Details

### struct GnomeDbRenderer

    struct GnomeDbRenderer;

### enum GnomeDbRendererOptions

    typedef enum {
    	GNOME_DB_RENDERER_EXTRA_PRETTY_SQL   = 1 << 0,
    	GNOME_DB_RENDERER_EXTRA_VAL_ATTRS    = 1 << 1,
    	GNOME_DB_RENDERER_ERROR_IF_DEFAULT   = 1 << 2
    } GnomeDbRendererOptions;

`GNOME_DB_RENDERER_EXTRA_PRETTY_SQL` | The rendered statement will output easy to read SQL
`GNOME_DB_RENDERER_EXTRA_VAL_ATTRS` | The rendered statement will include some extra text (not part of SQL) for parameters desecription
`GNOME_DB_RENDERER_ERROR_IF_DEFAULT` |

### gnome_db_renderer_get_type ()

    GType       gnome_db_renderer_get_type      (void);

Returns : |

### gnome_db_renderer_render_as_sql ()

    gchar*      gnome_db_renderer_render_as_sql (GnomeDbRenderer *iface,
                                                 GnomeDbDataSet *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 GnomeDbRenderer interface
`context` : | rendering context
`options` : | OR'ed flags from GnomeDbRendererOptions 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

### gnome_db_renderer_render_as_str ()

    gchar*      gnome_db_renderer_render_as_str (GnomeDbRenderer *iface,
                                                 GnomeDbDataSet *context);

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

`iface` : | an object which implements the GnomeDbRenderer interface
`context` : | rendering context
Returns : | the new string

### gnome_db_renderer_is_valid ()

    gboolean    gnome_db_renderer_is_valid      (GnomeDbRenderer *iface,
                                                 GnomeDbDataSet *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 GnomeDbRenderer interface
`context` : | rendering context
`error` : | location to store error, or `NULL`
Returns : | TRUE if `iface` can be rendered with `context`