/* rygel-media-export-sql-factory.c generated by valac 0.25.1.16-16e7a, the Vala compiler
 * generated from rygel-media-export-sql-factory.vala, do not modify */

/*
 * Copyright (C) 2010,2011 Jens Georg <mail@jensge.org>.
 *
 * Author: Jens Georg <mail@jensge.org>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define RYGEL_MEDIA_EXPORT_TYPE_DETAIL_COLUMN (rygel_media_export_detail_column_get_type ())

#define RYGEL_MEDIA_EXPORT_TYPE_SQL_STRING (rygel_media_export_sql_string_get_type ())

#define RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY (rygel_media_export_sql_factory_get_type ())
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY, RygelMediaExportSQLFactory))
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY, RygelMediaExportSQLFactoryClass))
#define RYGEL_MEDIA_EXPORT_IS_SQL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY))
#define RYGEL_MEDIA_EXPORT_IS_SQL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY))
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY, RygelMediaExportSQLFactoryClass))

typedef struct _RygelMediaExportSQLFactory RygelMediaExportSQLFactory;
typedef struct _RygelMediaExportSQLFactoryClass RygelMediaExportSQLFactoryClass;
typedef struct _RygelMediaExportSQLFactoryPrivate RygelMediaExportSQLFactoryPrivate;

typedef enum  {
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CREATOR,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITRATE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TIMESTAMP,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_OBJECT_UPDATE_ID,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DELETED_CHILD_COUNT,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CONTAINER_UPDATE_ID,
	RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_REFERENCE_ID
} RygelMediaExportDetailColumn;

typedef enum  {
	RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA,
	RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT,
	RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR,
	RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN,
	RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT,
	RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS,
	RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS,
	RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA,
	RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE,
	RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE,
	RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON,
	RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON,
	RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA,
	RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE,
	RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS,
	RYGEL_MEDIA_EXPORT_SQL_STRING_RESET_TOKEN,
	RYGEL_MEDIA_EXPORT_SQL_STRING_MAX_UPDATE_ID,
	RYGEL_MEDIA_EXPORT_SQL_STRING_MAKE_GUARDED,
	RYGEL_MEDIA_EXPORT_SQL_STRING_IS_GUARDED,
	RYGEL_MEDIA_EXPORT_SQL_STRING_UPDATE_GUARDED_OBJECT,
	RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_REFERENCE
} RygelMediaExportSQLString;

struct _RygelMediaExportSQLFactory {
	GObject parent_instance;
	RygelMediaExportSQLFactoryPrivate * priv;
};

struct _RygelMediaExportSQLFactoryClass {
	GObjectClass parent_class;
};


static gpointer rygel_media_export_sql_factory_parent_class = NULL;

GType rygel_media_export_detail_column_get_type (void) G_GNUC_CONST;
GType rygel_media_export_sql_string_get_type (void) G_GNUC_CONST;
GType rygel_media_export_sql_factory_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_MEDIA_EXPORT_SQL_FACTORY_DUMMY_PROPERTY
};
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING "INSERT OR REPLACE INTO meta_data " "(size, mime_type, width, height, class, " "author, album, date, bitrate, " "sample_freq, bits_per_sample, channels, " "track, color_depth, duration, object_fk, " "dlna_profile, genre, disc, creator) VALUES " "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_INSERT_OBJECT_STRING "INSERT OR REPLACE INTO Object " "(upnp_id, title, type_fk, parent, timestamp, uri, " "object_update_id, deleted_child_count, container_update_id, " "is_guarded, reference_id) VALUES " "(?,?,?,?,?,?,?,?,?,?,?)"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_UPDATE_GUARDED_OBJECT_STRING "UPDATE Object SET " "type_fk = ?, " "parent = ?, " "timestamp = ?, " "uri = ?, " "object_update_id = ?, " "deleted_child_count = ?, " "container_update_id = ? " "where upnp_id = ?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_BY_ID_STRING "DELETE FROM Object WHERE upnp_id IN " "(SELECT descendant FROM closure WHERE ancestor = ?)"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "o.type_fk, o.title, m.size, m.mime_type, m.width, " "m.height, m.class, m.creator, m.author, m.album, m.date, m.bitrate, " "m.sample_freq, m.bits_per_sample, m.channels, m.track, " "m.color_depth, m.duration, o.upnp_id, o.parent, o.timestamp, " "o.uri, m.dlna_profile, m.genre, m.disc, o.object_update_id, " "o.deleted_child_count, o.container_update_id, o.reference_id "
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_WITH_PATH "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "JOIN Closure c ON (o.upnp_id = c.ancestor) " "LEFT OUTER JOIN meta_data m ON (o.upnp_id = m.object_fk) " "WHERE c.descendant = ? ORDER BY c.depth DESC"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILDREN_STRING "SELECT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "JOIN Closure c ON (o.upnp_id = c.descendant) " "LEFT OUTER JOIN meta_data m " "ON c.descendant = m.object_fk " "WHERE c.ancestor = ? AND c.depth = 1 %s" "LIMIT ?,?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING_WITH_ANCESTOR "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " "LEFT OUTER JOIN meta_data m " "ON o.upnp_id = m.object_fk %s %s " "LIMIT ?,?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "LEFT OUTER JOIN meta_data m " "ON o.upnp_id = m.object_fk %s %s " "LIMIT ?,?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING_WITH_ANCESTOR "SELECT COUNT(o.type_fk) FROM Object o " "JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " "LEFT OUTER JOIN meta_data m " "ON o.upnp_id = m.object_fk %s"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING "SELECT COUNT(1) FROM meta_data m %s"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CHILDREN_COUNT_STRING "SELECT COUNT(upnp_id) FROM Object WHERE Object.parent = ?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_OBJECT_EXISTS_STRING "SELECT COUNT(1), timestamp, m.size FROM Object " "JOIN meta_data m ON m.object_fk = upnp_id " "WHERE Object.uri = ?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILD_ID_STRING "SELECT upnp_id FROM OBJECT WHERE parent = ?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_META_DATA_COLUMN_STRING "SELECT DISTINCT %s AS _column %s FROM meta_data AS m " "WHERE _column IS NOT NULL %s %s" "LIMIT ?,?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_VERSION "16"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING "CREATE TABLE meta_data (size INTEGER NOT NULL, " "mime_type TEXT NOT NULL, " "dlna_profile TEXT, " "duration INTEGER, " "width INTEGER, " "height INTEGER, " "class TEXT NOT NULL, " "creator TEXT, " "author TEXT, " "album TEXT, " "genre TEXT, " "date TEXT, " "bitrate INTEGER, " "sample_freq INTEGER, " "bits_per_sample INTEGER, " "channels INTEGER, " "track INTEGER, " "disc INTEGER, " "color_depth INTEGER, " "object_fk TEXT UNIQUE CONSTRAINT " "object_fk_id REFERENCES Object(upnp_id) " "ON DELETE CASCADE);"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_STRING "CREATE TABLE schema_info (version TEXT NOT NULL, " "reset_token TEXT); " RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING "CREATE TABLE object (parent TEXT CONSTRAINT parent_fk_id " "REFERENCES Object(upnp_id), " "upnp_id TEXT PRIMARY KEY, " "type_fk INTEGER, " "title TEXT NOT NULL, " "timestamp INTEGER NOT NULL, " "uri TEXT, " "object_update_id INTEGER, " "deleted_child_count INTEGER, " "container_update_id INTEGER, " "is_guarded INTEGER, " "reference_id TEXT DEFAULT NULL);" "INSERT INTO schema_info (version) VALUES ('" RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_VERSION "'); "
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE "CREATE TABLE closure (ancestor TEXT, descendant TEXT, depth INTEGER)"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TRIGGER_STRING "CREATE TRIGGER trgr_update_closure " "AFTER INSERT ON Object " "FOR EACH ROW BEGIN " "SELECT RAISE(IGNORE) WHERE (SELECT COUNT(*) FROM Closure " "WHERE ancestor = NEW.upnp_id " "AND descendant = NEW.upnp_id " "AND depth = 0) != 0;" "INSERT INTO Closure (ancestor, descendant, depth) " "VALUES (NEW.upnp_id, NEW.upnp_id, 0); " "INSERT INTO Closure (ancestor, descendant, depth) " "SELECT ancestor, NEW.upnp_id, depth + 1 FROM Closure " "WHERE descendant = NEW.parent;" "END;" "CREATE TRIGGER trgr_delete_closure " "AFTER DELETE ON Object " "FOR EACH ROW BEGIN " "DELETE FROM Closure WHERE descendant = OLD.upnp_id;" "END;"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_TRIGGER_STRING "CREATE TRIGGER trgr_delete_metadata " "BEFORE DELETE ON Object " "FOR EACH ROW BEGIN " "DELETE FROM meta_data WHERE meta_data.object_fk = OLD.upnp_id; " "END;"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_REFERENCE_TRIGGER_STRING "CREATE TRIGGER trgr_delete_references " "BEFORE DELETE ON Object " "FOR EACH ROW BEGIN " "DELETE FROM Object WHERE OLD.upnp_id = Object.reference_id; " "END;"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_INDICES_STRING "CREATE INDEX IF NOT EXISTS idx_parent on Object(parent);" "CREATE INDEX IF NOT EXISTS idx_object_upnp_id on Object(upnp_id);" "CREATE INDEX IF NOT EXISTS idx_meta_data_fk on meta_data(object_fk);" "CREATE INDEX IF NOT EXISTS idx_closure on Closure(descendant,depth);" "CREATE INDEX IF NOT EXISTS idx_closure_descendant on Closure(descendan" \
"t);" "CREATE INDEX IF NOT EXISTS idx_closure_ancestor on Closure(ancestor);" "CREATE INDEX IF NOT EXISTS idx_uri on Object(uri);" "CREATE INDEX IF NOT EXISTS idx_meta_data_date on meta_data(date);" "CREATE INDEX IF NOT EXISTS idx_meta_data_genre on meta_data(genre);" "CREATE INDEX IF NOT EXISTS idx_meta_data_album on meta_data(album);" "CREATE INDEX IF NOT EXISTS idx_meta_data_artist_album on " "meta_data(author, album);"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_EXISTS_CACHE_STRING "SELECT m.size, o.timestamp, o.uri FROM Object o " "JOIN meta_data m ON o.upnp_id = m.object_fk"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING "SELECT class, count(1) FROM meta_data GROUP BY class"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_RESET_TOKEN_STRING "SELECT reset_token FROM schema_info"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_MAX_UPDATE_ID_STRING "SELECT MAX(MAX(object_update_id), MAX(container_update_id)) FROM Objec" \
"t"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_MAKE_GUARDED_STRING "UPDATE Object SET is_guarded = ? WHERE Object.upnp_id = ?"
#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_IS_GUARDED_STRING "SELECT is_guarded FROM Object WHERE Object.upnp_id = ?"
const gchar* rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory* self, RygelMediaExportSQLString query);
RygelMediaExportSQLFactory* rygel_media_export_sql_factory_new (void);
RygelMediaExportSQLFactory* rygel_media_export_sql_factory_construct (GType object_type);


GType rygel_media_export_detail_column_get_type (void) {
	static volatile gsize rygel_media_export_detail_column_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_detail_column_type_id__volatile)) {
		static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE", "type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE", "title"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE", "size"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE", "mime-type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH", "width"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT", "height"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS", "class"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CREATOR, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CREATOR", "creator"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR", "author"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM", "album"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE", "date"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITRATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITRATE", "bitrate"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ", "sample-freq"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE", "bits-per-sample"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS", "channels"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK", "track"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH", "color-depth"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION", "duration"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID", "id"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT", "parent"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TIMESTAMP, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TIMESTAMP", "timestamp"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI", "uri"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE", "dlna-profile"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE", "genre"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC", "disc"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_OBJECT_UPDATE_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_OBJECT_UPDATE_ID", "object-update-id"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DELETED_CHILD_COUNT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DELETED_CHILD_COUNT", "deleted-child-count"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CONTAINER_UPDATE_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CONTAINER_UPDATE_ID", "container-update-id"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_REFERENCE_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_REFERENCE_ID", "reference-id"}, {0, NULL, NULL}};
		GType rygel_media_export_detail_column_type_id;
		rygel_media_export_detail_column_type_id = g_enum_register_static ("RygelMediaExportDetailColumn", values);
		g_once_init_leave (&rygel_media_export_detail_column_type_id__volatile, rygel_media_export_detail_column_type_id);
	}
	return rygel_media_export_detail_column_type_id__volatile;
}


GType rygel_media_export_sql_string_get_type (void) {
	static volatile gsize rygel_media_export_sql_string_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_sql_string_type_id__volatile)) {
		static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA", "save-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT, "RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT", "insert"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE, "RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE", "delete"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT", "get-object"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN", "get-children"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER", "get-objects-by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR", "get-objects-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER", "get-object-count-by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR", "get-object-count-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN", "get-meta-data-column"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT", "child-count"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS", "exists"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS", "child-ids"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA", "table-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE", "table-closure"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE", "trigger-closure"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON", "trigger-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON", "index-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA", "schema"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE", "exists-cache"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS, "RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS", "statistics"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_RESET_TOKEN, "RYGEL_MEDIA_EXPORT_SQL_STRING_RESET_TOKEN", "reset-token"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_MAX_UPDATE_ID, "RYGEL_MEDIA_EXPORT_SQL_STRING_MAX_UPDATE_ID", "max-update-id"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_MAKE_GUARDED, "RYGEL_MEDIA_EXPORT_SQL_STRING_MAKE_GUARDED", "make-guarded"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_IS_GUARDED, "RYGEL_MEDIA_EXPORT_SQL_STRING_IS_GUARDED", "is-guarded"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_UPDATE_GUARDED_OBJECT, "RYGEL_MEDIA_EXPORT_SQL_STRING_UPDATE_GUARDED_OBJECT", "update-guarded-object"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_REFERENCE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_REFERENCE", "trigger-reference"}, {0, NULL, NULL}};
		GType rygel_media_export_sql_string_type_id;
		rygel_media_export_sql_string_type_id = g_enum_register_static ("RygelMediaExportSQLString", values);
		g_once_init_leave (&rygel_media_export_sql_string_type_id__volatile, rygel_media_export_sql_string_type_id);
	}
	return rygel_media_export_sql_string_type_id__volatile;
}


const gchar* rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory* self, RygelMediaExportSQLString query) {
	const gchar* result = NULL;
	RygelMediaExportSQLString _tmp0_ = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = query;
	switch (_tmp0_) {
		case RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_INSERT_OBJECT_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_BY_ID_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_WITH_PATH;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILDREN_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING_WITH_ANCESTOR;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING_WITH_ANCESTOR;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_META_DATA_COLUMN_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CHILDREN_COUNT_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_OBJECT_EXISTS_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILD_ID_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_TRIGGER_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TRIGGER_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_INDICES_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_EXISTS_CACHE_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_RESET_TOKEN:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_RESET_TOKEN_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_MAX_UPDATE_ID:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_MAX_UPDATE_ID_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_MAKE_GUARDED:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_MAKE_GUARDED_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_IS_GUARDED:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_IS_GUARDED_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_UPDATE_GUARDED_OBJECT:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_UPDATE_GUARDED_OBJECT_STRING;
			return result;
		}
		case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_REFERENCE:
		{
			result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_REFERENCE_TRIGGER_STRING;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


RygelMediaExportSQLFactory* rygel_media_export_sql_factory_construct (GType object_type) {
	RygelMediaExportSQLFactory * self = NULL;
	self = (RygelMediaExportSQLFactory*) g_object_new (object_type, NULL);
	return self;
}


RygelMediaExportSQLFactory* rygel_media_export_sql_factory_new (void) {
	return rygel_media_export_sql_factory_construct (RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY);
}


static void rygel_media_export_sql_factory_class_init (RygelMediaExportSQLFactoryClass * klass) {
	rygel_media_export_sql_factory_parent_class = g_type_class_peek_parent (klass);
}


static void rygel_media_export_sql_factory_instance_init (RygelMediaExportSQLFactory * self) {
}


GType rygel_media_export_sql_factory_get_type (void) {
	static volatile gsize rygel_media_export_sql_factory_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_sql_factory_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelMediaExportSQLFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_media_export_sql_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelMediaExportSQLFactory), 0, (GInstanceInitFunc) rygel_media_export_sql_factory_instance_init, NULL };
		GType rygel_media_export_sql_factory_type_id;
		rygel_media_export_sql_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelMediaExportSQLFactory", &g_define_type_info, 0);
		g_once_init_leave (&rygel_media_export_sql_factory_type_id__volatile, rygel_media_export_sql_factory_type_id);
	}
	return rygel_media_export_sql_factory_type_id__volatile;
}



