/* database.c generated by valac 0.56.19, the Vala compiler
 * generated from database.vala, do not modify */

#include "libdino.h"
#include "qlite.h"
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>

#define DINO_DATABASE_VERSION 29
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _qlite_table_unref0(var) ((var == NULL) ? NULL : (var = (qlite_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))
#define _qlite_row_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_unref (var), NULL)))
#define _qlite_row_iterator_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_iterator_unref (var), NULL)))
#define _qlite_row_option_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_option_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _qlite_column_unref0(var) ((var == NULL) ? NULL : (var = (qlite_column_unref (var), NULL)))

struct _DinoDatabasePrivate {
	DinoDatabaseAccountTable* _account;
	DinoDatabaseJidTable* _jid;
	DinoDatabaseEntityTable* _entity;
	DinoDatabaseContentItemTable* _content_item;
	DinoDatabaseMessageTable* _message;
	DinoDatabaseBodyMeta* _body_meta;
	DinoDatabaseReplyTable* _reply;
	DinoDatabaseMessageCorrectionTable* _message_correction;
	DinoDatabaseRealJidTable* _real_jid;
	DinoDatabaseOccupantIdTable* _occupantid;
	DinoDatabaseFileTransferTable* _file_transfer;
	DinoDatabaseFileHashesTable* _file_hashes;
	DinoDatabaseFileThumbnailsTable* _file_thumbnails;
	DinoDatabaseSourcesTable* _sfs_sources;
	DinoDatabaseCallTable* _call;
	DinoDatabaseCallCounterpartTable* _call_counterpart;
	DinoDatabaseConversationTable* _conversation;
	DinoDatabaseAvatarTable* _avatar;
	DinoDatabaseEntityIdentityTable* _entity_identity;
	DinoDatabaseEntityFeatureTable* _entity_feature;
	DinoDatabaseRosterTable* _roster;
	DinoDatabaseMamCatchupTable* _mam_catchup;
	DinoDatabaseReactionTable* _reaction;
	DinoDatabaseSettingsTable* _settings;
	DinoDatabaseAccountSettingsTable* _account_settings;
	DinoDatabaseConversationSettingsTable* _conversation_settings;
};

static gint DinoDatabase_private_offset;
static gpointer dino_database_parent_class = NULL;
static gpointer dino_database_account_table_parent_class = NULL;
static gpointer dino_database_jid_table_parent_class = NULL;
static gpointer dino_database_entity_table_parent_class = NULL;
static gpointer dino_database_content_item_table_parent_class = NULL;
static gpointer dino_database_message_table_parent_class = NULL;
static gpointer dino_database_body_meta_parent_class = NULL;
static gpointer dino_database_message_correction_table_parent_class = NULL;
static gpointer dino_database_reply_table_parent_class = NULL;
static gpointer dino_database_real_jid_table_parent_class = NULL;
static gpointer dino_database_occupant_id_table_parent_class = NULL;
static gpointer dino_database_undecrypted_table_parent_class = NULL;
static gpointer dino_database_file_transfer_table_parent_class = NULL;
static gpointer dino_database_file_hashes_table_parent_class = NULL;
static gpointer dino_database_file_thumbnails_table_parent_class = NULL;
static gpointer dino_database_sources_table_parent_class = NULL;
static gpointer dino_database_call_table_parent_class = NULL;
static gpointer dino_database_call_counterpart_table_parent_class = NULL;
static gpointer dino_database_conversation_table_parent_class = NULL;
static gpointer dino_database_avatar_table_parent_class = NULL;
static gpointer dino_database_entity_identity_table_parent_class = NULL;
static gpointer dino_database_entity_feature_table_parent_class = NULL;
static gpointer dino_database_roster_table_parent_class = NULL;
static gpointer dino_database_mam_catchup_table_parent_class = NULL;
static gpointer dino_database_reaction_table_parent_class = NULL;
static gpointer dino_database_settings_table_parent_class = NULL;
static gpointer dino_database_account_settings_table_parent_class = NULL;
static gpointer dino_database_conversation_settings_table_parent_class = NULL;

static guint _xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                              gpointer self);
static gboolean _xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                                    gconstpointer b,
                                                    gpointer self);
VALA_EXTERN DinoDatabaseAccountTable* dino_database_account_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseAccountTable* dino_database_account_table_construct (GType object_type,
                                                                 DinoDatabase* db);
static void dino_database_set_account (DinoDatabase* self,
                                DinoDatabaseAccountTable* value);
VALA_EXTERN DinoDatabaseJidTable* dino_database_jid_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseJidTable* dino_database_jid_table_construct (GType object_type,
                                                         DinoDatabase* db);
static void dino_database_set_jid (DinoDatabase* self,
                            DinoDatabaseJidTable* value);
VALA_EXTERN DinoDatabaseEntityTable* dino_database_entity_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseEntityTable* dino_database_entity_table_construct (GType object_type,
                                                               DinoDatabase* db);
static void dino_database_set_entity (DinoDatabase* self,
                               DinoDatabaseEntityTable* value);
VALA_EXTERN DinoDatabaseContentItemTable* dino_database_content_item_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseContentItemTable* dino_database_content_item_table_construct (GType object_type,
                                                                          DinoDatabase* db);
static void dino_database_set_content_item (DinoDatabase* self,
                                     DinoDatabaseContentItemTable* value);
VALA_EXTERN DinoDatabaseMessageTable* dino_database_message_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseMessageTable* dino_database_message_table_construct (GType object_type,
                                                                 DinoDatabase* db);
static void dino_database_set_message (DinoDatabase* self,
                                DinoDatabaseMessageTable* value);
VALA_EXTERN DinoDatabaseBodyMeta* dino_database_body_meta_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseBodyMeta* dino_database_body_meta_construct (GType object_type,
                                                         DinoDatabase* db);
static void dino_database_set_body_meta (DinoDatabase* self,
                                  DinoDatabaseBodyMeta* value);
VALA_EXTERN DinoDatabaseMessageCorrectionTable* dino_database_message_correction_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseMessageCorrectionTable* dino_database_message_correction_table_construct (GType object_type,
                                                                                      DinoDatabase* db);
static void dino_database_set_message_correction (DinoDatabase* self,
                                           DinoDatabaseMessageCorrectionTable* value);
VALA_EXTERN DinoDatabaseReplyTable* dino_database_reply_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseReplyTable* dino_database_reply_table_construct (GType object_type,
                                                             DinoDatabase* db);
static void dino_database_set_reply (DinoDatabase* self,
                              DinoDatabaseReplyTable* value);
VALA_EXTERN DinoDatabaseOccupantIdTable* dino_database_occupant_id_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseOccupantIdTable* dino_database_occupant_id_table_construct (GType object_type,
                                                                        DinoDatabase* db);
static void dino_database_set_occupantid (DinoDatabase* self,
                                   DinoDatabaseOccupantIdTable* value);
VALA_EXTERN DinoDatabaseRealJidTable* dino_database_real_jid_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseRealJidTable* dino_database_real_jid_table_construct (GType object_type,
                                                                  DinoDatabase* db);
static void dino_database_set_real_jid (DinoDatabase* self,
                                 DinoDatabaseRealJidTable* value);
VALA_EXTERN DinoDatabaseFileTransferTable* dino_database_file_transfer_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseFileTransferTable* dino_database_file_transfer_table_construct (GType object_type,
                                                                            DinoDatabase* db);
static void dino_database_set_file_transfer (DinoDatabase* self,
                                      DinoDatabaseFileTransferTable* value);
VALA_EXTERN DinoDatabaseFileHashesTable* dino_database_file_hashes_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseFileHashesTable* dino_database_file_hashes_table_construct (GType object_type,
                                                                        DinoDatabase* db);
static void dino_database_set_file_hashes (DinoDatabase* self,
                                    DinoDatabaseFileHashesTable* value);
VALA_EXTERN DinoDatabaseFileThumbnailsTable* dino_database_file_thumbnails_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseFileThumbnailsTable* dino_database_file_thumbnails_table_construct (GType object_type,
                                                                                DinoDatabase* db);
static void dino_database_set_file_thumbnails (DinoDatabase* self,
                                        DinoDatabaseFileThumbnailsTable* value);
VALA_EXTERN DinoDatabaseSourcesTable* dino_database_sources_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseSourcesTable* dino_database_sources_table_construct (GType object_type,
                                                                 DinoDatabase* db);
static void dino_database_set_sfs_sources (DinoDatabase* self,
                                    DinoDatabaseSourcesTable* value);
VALA_EXTERN DinoDatabaseCallTable* dino_database_call_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseCallTable* dino_database_call_table_construct (GType object_type,
                                                           DinoDatabase* db);
static void dino_database_set_call (DinoDatabase* self,
                             DinoDatabaseCallTable* value);
VALA_EXTERN DinoDatabaseCallCounterpartTable* dino_database_call_counterpart_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseCallCounterpartTable* dino_database_call_counterpart_table_construct (GType object_type,
                                                                                  DinoDatabase* db);
static void dino_database_set_call_counterpart (DinoDatabase* self,
                                         DinoDatabaseCallCounterpartTable* value);
VALA_EXTERN DinoDatabaseConversationTable* dino_database_conversation_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseConversationTable* dino_database_conversation_table_construct (GType object_type,
                                                                           DinoDatabase* db);
static void dino_database_set_conversation (DinoDatabase* self,
                                     DinoDatabaseConversationTable* value);
VALA_EXTERN DinoDatabaseAvatarTable* dino_database_avatar_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseAvatarTable* dino_database_avatar_table_construct (GType object_type,
                                                               DinoDatabase* db);
static void dino_database_set_avatar (DinoDatabase* self,
                               DinoDatabaseAvatarTable* value);
VALA_EXTERN DinoDatabaseEntityIdentityTable* dino_database_entity_identity_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseEntityIdentityTable* dino_database_entity_identity_table_construct (GType object_type,
                                                                                DinoDatabase* db);
static void dino_database_set_entity_identity (DinoDatabase* self,
                                        DinoDatabaseEntityIdentityTable* value);
VALA_EXTERN DinoDatabaseEntityFeatureTable* dino_database_entity_feature_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseEntityFeatureTable* dino_database_entity_feature_table_construct (GType object_type,
                                                                              DinoDatabase* db);
static void dino_database_set_entity_feature (DinoDatabase* self,
                                       DinoDatabaseEntityFeatureTable* value);
VALA_EXTERN DinoDatabaseRosterTable* dino_database_roster_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseRosterTable* dino_database_roster_table_construct (GType object_type,
                                                               DinoDatabase* db);
static void dino_database_set_roster (DinoDatabase* self,
                               DinoDatabaseRosterTable* value);
VALA_EXTERN DinoDatabaseMamCatchupTable* dino_database_mam_catchup_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseMamCatchupTable* dino_database_mam_catchup_table_construct (GType object_type,
                                                                        DinoDatabase* db);
static void dino_database_set_mam_catchup (DinoDatabase* self,
                                    DinoDatabaseMamCatchupTable* value);
VALA_EXTERN DinoDatabaseReactionTable* dino_database_reaction_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseReactionTable* dino_database_reaction_table_construct (GType object_type,
                                                                   DinoDatabase* db);
static void dino_database_set_reaction (DinoDatabase* self,
                                 DinoDatabaseReactionTable* value);
VALA_EXTERN DinoDatabaseSettingsTable* dino_database_settings_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseSettingsTable* dino_database_settings_table_construct (GType object_type,
                                                                   DinoDatabase* db);
static void dino_database_set_settings (DinoDatabase* self,
                                 DinoDatabaseSettingsTable* value);
VALA_EXTERN DinoDatabaseAccountSettingsTable* dino_database_account_settings_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseAccountSettingsTable* dino_database_account_settings_table_construct (GType object_type,
                                                                                  DinoDatabase* db);
static void dino_database_set_account_settings (DinoDatabase* self,
                                         DinoDatabaseAccountSettingsTable* value);
VALA_EXTERN DinoDatabaseConversationSettingsTable* dino_database_conversation_settings_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseConversationSettingsTable* dino_database_conversation_settings_table_construct (GType object_type,
                                                                                            DinoDatabase* db);
static void dino_database_set_conversation_settings (DinoDatabase* self,
                                              DinoDatabaseConversationSettingsTable* value);
static void dino_database_real_migrate (QliteDatabase* base,
                                 glong oldVersion);
static gboolean _dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                                 gconstpointer b,
                                                                 gpointer self);
static gint dino_database_add_jid (DinoDatabase* self,
                            XmppJid* jid_obj);
static void dino_database_account_table_finalize (QliteTable * obj);
static GType dino_database_account_table_get_type_once (void);
static void dino_database_jid_table_finalize (QliteTable * obj);
static GType dino_database_jid_table_get_type_once (void);
static void dino_database_entity_table_finalize (QliteTable * obj);
static GType dino_database_entity_table_get_type_once (void);
static void dino_database_content_item_table_finalize (QliteTable * obj);
static GType dino_database_content_item_table_get_type_once (void);
static void dino_database_message_table_finalize (QliteTable * obj);
static GType dino_database_message_table_get_type_once (void);
static void dino_database_body_meta_finalize (QliteTable * obj);
static GType dino_database_body_meta_get_type_once (void);
static void dino_database_message_correction_table_finalize (QliteTable * obj);
static GType dino_database_message_correction_table_get_type_once (void);
static void dino_database_reply_table_finalize (QliteTable * obj);
static GType dino_database_reply_table_get_type_once (void);
static void dino_database_real_jid_table_finalize (QliteTable * obj);
static GType dino_database_real_jid_table_get_type_once (void);
static void dino_database_occupant_id_table_finalize (QliteTable * obj);
static GType dino_database_occupant_id_table_get_type_once (void);
VALA_EXTERN DinoDatabaseUndecryptedTable* dino_database_undecrypted_table_new (DinoDatabase* db);
VALA_EXTERN DinoDatabaseUndecryptedTable* dino_database_undecrypted_table_construct (GType object_type,
                                                                         DinoDatabase* db);
static void dino_database_undecrypted_table_finalize (QliteTable * obj);
static GType dino_database_undecrypted_table_get_type_once (void);
static void dino_database_file_transfer_table_finalize (QliteTable * obj);
static GType dino_database_file_transfer_table_get_type_once (void);
static void dino_database_file_hashes_table_finalize (QliteTable * obj);
static GType dino_database_file_hashes_table_get_type_once (void);
static void dino_database_file_thumbnails_table_finalize (QliteTable * obj);
static GType dino_database_file_thumbnails_table_get_type_once (void);
static void dino_database_sources_table_finalize (QliteTable * obj);
static GType dino_database_sources_table_get_type_once (void);
static void dino_database_call_table_finalize (QliteTable * obj);
static GType dino_database_call_table_get_type_once (void);
static void dino_database_call_counterpart_table_finalize (QliteTable * obj);
static GType dino_database_call_counterpart_table_get_type_once (void);
static void dino_database_conversation_table_finalize (QliteTable * obj);
static GType dino_database_conversation_table_get_type_once (void);
static void dino_database_avatar_table_finalize (QliteTable * obj);
static GType dino_database_avatar_table_get_type_once (void);
static void dino_database_entity_identity_table_finalize (QliteTable * obj);
static GType dino_database_entity_identity_table_get_type_once (void);
static void dino_database_entity_feature_table_finalize (QliteTable * obj);
static GType dino_database_entity_feature_table_get_type_once (void);
static void dino_database_roster_table_finalize (QliteTable * obj);
static GType dino_database_roster_table_get_type_once (void);
static void dino_database_mam_catchup_table_finalize (QliteTable * obj);
static GType dino_database_mam_catchup_table_get_type_once (void);
static void dino_database_reaction_table_finalize (QliteTable * obj);
static GType dino_database_reaction_table_get_type_once (void);
static void dino_database_settings_table_finalize (QliteTable * obj);
static GType dino_database_settings_table_get_type_once (void);
static void dino_database_account_settings_table_finalize (QliteTable * obj);
static GType dino_database_account_settings_table_get_type_once (void);
static void dino_database_conversation_settings_table_finalize (QliteTable * obj);
static GType dino_database_conversation_settings_table_get_type_once (void);
static void dino_database_finalize (QliteDatabase * obj);
static GType dino_database_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_database_get_instance_private (DinoDatabase* self)
{
	return G_STRUCT_MEMBER_P (self, DinoDatabase_private_offset);
}

static guint
_xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                        gpointer self)
{
	guint result;
	result = xmpp_jid_hash_func ((XmppJid*) v);
	return result;
}

static gboolean
_xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                           gconstpointer b,
                                           gpointer self)
{
	gboolean result;
	result = xmpp_jid_equals_func ((XmppJid*) a, (XmppJid*) b);
	return result;
}

static gpointer
_qlite_table_ref0 (gpointer self)
{
	return self ? qlite_table_ref (self) : NULL;
}

DinoDatabase*
dino_database_construct (GType object_type,
                         const gchar* fileName)
{
	DinoDatabase* self = NULL;
	DinoDatabaseAccountTable* _tmp0_;
	DinoDatabaseAccountTable* _tmp1_;
	DinoDatabaseJidTable* _tmp2_;
	DinoDatabaseJidTable* _tmp3_;
	DinoDatabaseEntityTable* _tmp4_;
	DinoDatabaseEntityTable* _tmp5_;
	DinoDatabaseContentItemTable* _tmp6_;
	DinoDatabaseContentItemTable* _tmp7_;
	DinoDatabaseMessageTable* _tmp8_;
	DinoDatabaseMessageTable* _tmp9_;
	DinoDatabaseBodyMeta* _tmp10_;
	DinoDatabaseBodyMeta* _tmp11_;
	DinoDatabaseMessageCorrectionTable* _tmp12_;
	DinoDatabaseMessageCorrectionTable* _tmp13_;
	DinoDatabaseReplyTable* _tmp14_;
	DinoDatabaseReplyTable* _tmp15_;
	DinoDatabaseOccupantIdTable* _tmp16_;
	DinoDatabaseOccupantIdTable* _tmp17_;
	DinoDatabaseRealJidTable* _tmp18_;
	DinoDatabaseRealJidTable* _tmp19_;
	DinoDatabaseFileTransferTable* _tmp20_;
	DinoDatabaseFileTransferTable* _tmp21_;
	DinoDatabaseFileHashesTable* _tmp22_;
	DinoDatabaseFileHashesTable* _tmp23_;
	DinoDatabaseFileThumbnailsTable* _tmp24_;
	DinoDatabaseFileThumbnailsTable* _tmp25_;
	DinoDatabaseSourcesTable* _tmp26_;
	DinoDatabaseSourcesTable* _tmp27_;
	DinoDatabaseCallTable* _tmp28_;
	DinoDatabaseCallTable* _tmp29_;
	DinoDatabaseCallCounterpartTable* _tmp30_;
	DinoDatabaseCallCounterpartTable* _tmp31_;
	DinoDatabaseConversationTable* _tmp32_;
	DinoDatabaseConversationTable* _tmp33_;
	DinoDatabaseAvatarTable* _tmp34_;
	DinoDatabaseAvatarTable* _tmp35_;
	DinoDatabaseEntityIdentityTable* _tmp36_;
	DinoDatabaseEntityIdentityTable* _tmp37_;
	DinoDatabaseEntityFeatureTable* _tmp38_;
	DinoDatabaseEntityFeatureTable* _tmp39_;
	DinoDatabaseRosterTable* _tmp40_;
	DinoDatabaseRosterTable* _tmp41_;
	DinoDatabaseMamCatchupTable* _tmp42_;
	DinoDatabaseMamCatchupTable* _tmp43_;
	DinoDatabaseReactionTable* _tmp44_;
	DinoDatabaseReactionTable* _tmp45_;
	DinoDatabaseSettingsTable* _tmp46_;
	DinoDatabaseSettingsTable* _tmp47_;
	DinoDatabaseAccountSettingsTable* _tmp48_;
	DinoDatabaseAccountSettingsTable* _tmp49_;
	DinoDatabaseConversationSettingsTable* _tmp50_;
	DinoDatabaseConversationSettingsTable* _tmp51_;
	DinoDatabaseAccountTable* _tmp52_;
	QliteTable* _tmp53_;
	DinoDatabaseJidTable* _tmp54_;
	QliteTable* _tmp55_;
	DinoDatabaseEntityTable* _tmp56_;
	QliteTable* _tmp57_;
	DinoDatabaseContentItemTable* _tmp58_;
	QliteTable* _tmp59_;
	DinoDatabaseMessageTable* _tmp60_;
	QliteTable* _tmp61_;
	DinoDatabaseBodyMeta* _tmp62_;
	QliteTable* _tmp63_;
	DinoDatabaseMessageCorrectionTable* _tmp64_;
	QliteTable* _tmp65_;
	DinoDatabaseReplyTable* _tmp66_;
	QliteTable* _tmp67_;
	DinoDatabaseRealJidTable* _tmp68_;
	QliteTable* _tmp69_;
	DinoDatabaseOccupantIdTable* _tmp70_;
	QliteTable* _tmp71_;
	DinoDatabaseFileTransferTable* _tmp72_;
	QliteTable* _tmp73_;
	DinoDatabaseFileHashesTable* _tmp74_;
	QliteTable* _tmp75_;
	DinoDatabaseFileThumbnailsTable* _tmp76_;
	QliteTable* _tmp77_;
	DinoDatabaseSourcesTable* _tmp78_;
	QliteTable* _tmp79_;
	DinoDatabaseCallTable* _tmp80_;
	QliteTable* _tmp81_;
	DinoDatabaseCallCounterpartTable* _tmp82_;
	QliteTable* _tmp83_;
	DinoDatabaseConversationTable* _tmp84_;
	QliteTable* _tmp85_;
	DinoDatabaseAvatarTable* _tmp86_;
	QliteTable* _tmp87_;
	DinoDatabaseEntityIdentityTable* _tmp88_;
	QliteTable* _tmp89_;
	DinoDatabaseEntityFeatureTable* _tmp90_;
	QliteTable* _tmp91_;
	DinoDatabaseRosterTable* _tmp92_;
	QliteTable* _tmp93_;
	DinoDatabaseMamCatchupTable* _tmp94_;
	QliteTable* _tmp95_;
	DinoDatabaseReactionTable* _tmp96_;
	QliteTable* _tmp97_;
	DinoDatabaseSettingsTable* _tmp98_;
	QliteTable* _tmp99_;
	DinoDatabaseAccountSettingsTable* _tmp100_;
	QliteTable* _tmp101_;
	DinoDatabaseConversationSettingsTable* _tmp102_;
	QliteTable* _tmp103_;
	QliteTable** _tmp104_;
	QliteTable** _tmp105_;
	gint _tmp105__length1;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (fileName != NULL, NULL);
	self = (DinoDatabase*) qlite_database_construct (object_type, fileName, (glong) DINO_DATABASE_VERSION);
	_tmp0_ = dino_database_account_table_new (self);
	_tmp1_ = _tmp0_;
	dino_database_set_account (self, _tmp1_);
	_qlite_table_unref0 (_tmp1_);
	_tmp2_ = dino_database_jid_table_new (self);
	_tmp3_ = _tmp2_;
	dino_database_set_jid (self, _tmp3_);
	_qlite_table_unref0 (_tmp3_);
	_tmp4_ = dino_database_entity_table_new (self);
	_tmp5_ = _tmp4_;
	dino_database_set_entity (self, _tmp5_);
	_qlite_table_unref0 (_tmp5_);
	_tmp6_ = dino_database_content_item_table_new (self);
	_tmp7_ = _tmp6_;
	dino_database_set_content_item (self, _tmp7_);
	_qlite_table_unref0 (_tmp7_);
	_tmp8_ = dino_database_message_table_new (self);
	_tmp9_ = _tmp8_;
	dino_database_set_message (self, _tmp9_);
	_qlite_table_unref0 (_tmp9_);
	_tmp10_ = dino_database_body_meta_new (self);
	_tmp11_ = _tmp10_;
	dino_database_set_body_meta (self, _tmp11_);
	_qlite_table_unref0 (_tmp11_);
	_tmp12_ = dino_database_message_correction_table_new (self);
	_tmp13_ = _tmp12_;
	dino_database_set_message_correction (self, _tmp13_);
	_qlite_table_unref0 (_tmp13_);
	_tmp14_ = dino_database_reply_table_new (self);
	_tmp15_ = _tmp14_;
	dino_database_set_reply (self, _tmp15_);
	_qlite_table_unref0 (_tmp15_);
	_tmp16_ = dino_database_occupant_id_table_new (self);
	_tmp17_ = _tmp16_;
	dino_database_set_occupantid (self, _tmp17_);
	_qlite_table_unref0 (_tmp17_);
	_tmp18_ = dino_database_real_jid_table_new (self);
	_tmp19_ = _tmp18_;
	dino_database_set_real_jid (self, _tmp19_);
	_qlite_table_unref0 (_tmp19_);
	_tmp20_ = dino_database_file_transfer_table_new (self);
	_tmp21_ = _tmp20_;
	dino_database_set_file_transfer (self, _tmp21_);
	_qlite_table_unref0 (_tmp21_);
	_tmp22_ = dino_database_file_hashes_table_new (self);
	_tmp23_ = _tmp22_;
	dino_database_set_file_hashes (self, _tmp23_);
	_qlite_table_unref0 (_tmp23_);
	_tmp24_ = dino_database_file_thumbnails_table_new (self);
	_tmp25_ = _tmp24_;
	dino_database_set_file_thumbnails (self, _tmp25_);
	_qlite_table_unref0 (_tmp25_);
	_tmp26_ = dino_database_sources_table_new (self);
	_tmp27_ = _tmp26_;
	dino_database_set_sfs_sources (self, _tmp27_);
	_qlite_table_unref0 (_tmp27_);
	_tmp28_ = dino_database_call_table_new (self);
	_tmp29_ = _tmp28_;
	dino_database_set_call (self, _tmp29_);
	_qlite_table_unref0 (_tmp29_);
	_tmp30_ = dino_database_call_counterpart_table_new (self);
	_tmp31_ = _tmp30_;
	dino_database_set_call_counterpart (self, _tmp31_);
	_qlite_table_unref0 (_tmp31_);
	_tmp32_ = dino_database_conversation_table_new (self);
	_tmp33_ = _tmp32_;
	dino_database_set_conversation (self, _tmp33_);
	_qlite_table_unref0 (_tmp33_);
	_tmp34_ = dino_database_avatar_table_new (self);
	_tmp35_ = _tmp34_;
	dino_database_set_avatar (self, _tmp35_);
	_qlite_table_unref0 (_tmp35_);
	_tmp36_ = dino_database_entity_identity_table_new (self);
	_tmp37_ = _tmp36_;
	dino_database_set_entity_identity (self, _tmp37_);
	_qlite_table_unref0 (_tmp37_);
	_tmp38_ = dino_database_entity_feature_table_new (self);
	_tmp39_ = _tmp38_;
	dino_database_set_entity_feature (self, _tmp39_);
	_qlite_table_unref0 (_tmp39_);
	_tmp40_ = dino_database_roster_table_new (self);
	_tmp41_ = _tmp40_;
	dino_database_set_roster (self, _tmp41_);
	_qlite_table_unref0 (_tmp41_);
	_tmp42_ = dino_database_mam_catchup_table_new (self);
	_tmp43_ = _tmp42_;
	dino_database_set_mam_catchup (self, _tmp43_);
	_qlite_table_unref0 (_tmp43_);
	_tmp44_ = dino_database_reaction_table_new (self);
	_tmp45_ = _tmp44_;
	dino_database_set_reaction (self, _tmp45_);
	_qlite_table_unref0 (_tmp45_);
	_tmp46_ = dino_database_settings_table_new (self);
	_tmp47_ = _tmp46_;
	dino_database_set_settings (self, _tmp47_);
	_qlite_table_unref0 (_tmp47_);
	_tmp48_ = dino_database_account_settings_table_new (self);
	_tmp49_ = _tmp48_;
	dino_database_set_account_settings (self, _tmp49_);
	_qlite_table_unref0 (_tmp49_);
	_tmp50_ = dino_database_conversation_settings_table_new (self);
	_tmp51_ = _tmp50_;
	dino_database_set_conversation_settings (self, _tmp51_);
	_qlite_table_unref0 (_tmp51_);
	_tmp52_ = self->priv->_account;
	_tmp53_ = _qlite_table_ref0 ((QliteTable*) _tmp52_);
	_tmp54_ = self->priv->_jid;
	_tmp55_ = _qlite_table_ref0 ((QliteTable*) _tmp54_);
	_tmp56_ = self->priv->_entity;
	_tmp57_ = _qlite_table_ref0 ((QliteTable*) _tmp56_);
	_tmp58_ = self->priv->_content_item;
	_tmp59_ = _qlite_table_ref0 ((QliteTable*) _tmp58_);
	_tmp60_ = self->priv->_message;
	_tmp61_ = _qlite_table_ref0 ((QliteTable*) _tmp60_);
	_tmp62_ = self->priv->_body_meta;
	_tmp63_ = _qlite_table_ref0 ((QliteTable*) _tmp62_);
	_tmp64_ = self->priv->_message_correction;
	_tmp65_ = _qlite_table_ref0 ((QliteTable*) _tmp64_);
	_tmp66_ = self->priv->_reply;
	_tmp67_ = _qlite_table_ref0 ((QliteTable*) _tmp66_);
	_tmp68_ = self->priv->_real_jid;
	_tmp69_ = _qlite_table_ref0 ((QliteTable*) _tmp68_);
	_tmp70_ = self->priv->_occupantid;
	_tmp71_ = _qlite_table_ref0 ((QliteTable*) _tmp70_);
	_tmp72_ = self->priv->_file_transfer;
	_tmp73_ = _qlite_table_ref0 ((QliteTable*) _tmp72_);
	_tmp74_ = self->priv->_file_hashes;
	_tmp75_ = _qlite_table_ref0 ((QliteTable*) _tmp74_);
	_tmp76_ = self->priv->_file_thumbnails;
	_tmp77_ = _qlite_table_ref0 ((QliteTable*) _tmp76_);
	_tmp78_ = self->priv->_sfs_sources;
	_tmp79_ = _qlite_table_ref0 ((QliteTable*) _tmp78_);
	_tmp80_ = self->priv->_call;
	_tmp81_ = _qlite_table_ref0 ((QliteTable*) _tmp80_);
	_tmp82_ = self->priv->_call_counterpart;
	_tmp83_ = _qlite_table_ref0 ((QliteTable*) _tmp82_);
	_tmp84_ = self->priv->_conversation;
	_tmp85_ = _qlite_table_ref0 ((QliteTable*) _tmp84_);
	_tmp86_ = self->priv->_avatar;
	_tmp87_ = _qlite_table_ref0 ((QliteTable*) _tmp86_);
	_tmp88_ = self->priv->_entity_identity;
	_tmp89_ = _qlite_table_ref0 ((QliteTable*) _tmp88_);
	_tmp90_ = self->priv->_entity_feature;
	_tmp91_ = _qlite_table_ref0 ((QliteTable*) _tmp90_);
	_tmp92_ = self->priv->_roster;
	_tmp93_ = _qlite_table_ref0 ((QliteTable*) _tmp92_);
	_tmp94_ = self->priv->_mam_catchup;
	_tmp95_ = _qlite_table_ref0 ((QliteTable*) _tmp94_);
	_tmp96_ = self->priv->_reaction;
	_tmp97_ = _qlite_table_ref0 ((QliteTable*) _tmp96_);
	_tmp98_ = self->priv->_settings;
	_tmp99_ = _qlite_table_ref0 ((QliteTable*) _tmp98_);
	_tmp100_ = self->priv->_account_settings;
	_tmp101_ = _qlite_table_ref0 ((QliteTable*) _tmp100_);
	_tmp102_ = self->priv->_conversation_settings;
	_tmp103_ = _qlite_table_ref0 ((QliteTable*) _tmp102_);
	_tmp104_ = g_new0 (QliteTable*, 26 + 1);
	_tmp104_[0] = _tmp53_;
	_tmp104_[1] = _tmp55_;
	_tmp104_[2] = _tmp57_;
	_tmp104_[3] = _tmp59_;
	_tmp104_[4] = _tmp61_;
	_tmp104_[5] = _tmp63_;
	_tmp104_[6] = _tmp65_;
	_tmp104_[7] = _tmp67_;
	_tmp104_[8] = _tmp69_;
	_tmp104_[9] = _tmp71_;
	_tmp104_[10] = _tmp73_;
	_tmp104_[11] = _tmp75_;
	_tmp104_[12] = _tmp77_;
	_tmp104_[13] = _tmp79_;
	_tmp104_[14] = _tmp81_;
	_tmp104_[15] = _tmp83_;
	_tmp104_[16] = _tmp85_;
	_tmp104_[17] = _tmp87_;
	_tmp104_[18] = _tmp89_;
	_tmp104_[19] = _tmp91_;
	_tmp104_[20] = _tmp93_;
	_tmp104_[21] = _tmp95_;
	_tmp104_[22] = _tmp97_;
	_tmp104_[23] = _tmp99_;
	_tmp104_[24] = _tmp101_;
	_tmp104_[25] = _tmp103_;
	_tmp105_ = _tmp104_;
	_tmp105__length1 = 26;
	qlite_database_init ((QliteDatabase*) self, _tmp105_, (gint) 26);
	_tmp105_ = (_vala_array_free (_tmp105_, _tmp105__length1, (GDestroyNotify) qlite_table_unref), NULL);
	{
		qlite_database_exec ((QliteDatabase*) self, "PRAGMA journal_mode = WAL", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		qlite_database_exec ((QliteDatabase*) self, "PRAGMA synchronous = NORMAL", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		qlite_database_exec ((QliteDatabase*) self, "PRAGMA secure_delete = ON", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp106_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp106_ = e->message;
		g_error ("database.vala:503: Failed to set database properties: %s", _tmp106_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	return self;
}

DinoDatabase*
dino_database_new (const gchar* fileName)
{
	return dino_database_construct (DINO_TYPE_DATABASE, fileName);
}

static void
dino_database_real_migrate (QliteDatabase* base,
                            glong oldVersion)
{
	DinoDatabase * self;
	GError* _inner_error0_ = NULL;
	self = (DinoDatabase*) base;
	if (oldVersion < ((glong) 7)) {
		DinoDatabaseMessageTable* _tmp0_;
		_tmp0_ = self->priv->_message;
		qlite_table_fts_rebuild ((QliteTable*) _tmp0_);
	}
	if (oldVersion < ((glong) 8)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "\n" \
"                insert into content_item (conversation_id, time, local" \
"_time, content_type, foreign_id, hide)\n" \
"                select conversation.id, message.time, message.local_ti" \
"me, 1, message.id, 0\n" \
"                from message join conversation on\n" \
"                    message.account_id=conversation.account_id and\n" \
"                    message.counterpart_id=conversation.jid_id and\n" \
"                    message.type=conversation.type+1 and\n" \
"                    (message.counterpart_resource=conversation.resourc" \
"e or message.type != 3)\n" \
"                where\n" \
"                    message.body not in (select info from file_transfe" \
"r where info not null) and\n" \
"                    message.id not in (select info from file_transfer " \
"where info not null)\n" \
"                union\n" \
"                select conversation.id, message.time, message.local_ti" \
"me, 2, file_transfer.id, 0\n" \
"                from file_transfer\n" \
"                join message on\n" \
"                    file_transfer.info=message.id\n" \
"                join conversation on\n" \
"                    file_transfer.account_id=conversation.account_id a" \
"nd\n" \
"                    file_transfer.counterpart_id=conversation.jid_id a" \
"nd\n" \
"                    message.type=conversation.type+1 and\n" \
"                    (message.counterpart_resource=conversation.resourc" \
"e or message.type != 3)", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp1_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp1_ = e->message;
			g_error ("database.vala:536: Failed to upgrade to database version 8: %s", _tmp1_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 9)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "\n" \
"                insert into content_item (conversation_id, time, local" \
"_time, content_type, foreign_id, hide)\n" \
"                select conversation.id, message.time, message.local_ti" \
"me, 1, message.id, 1\n" \
"                from message join conversation on\n" \
"                    message.account_id=conversation.account_id and\n" \
"                    message.counterpart_id=conversation.jid_id and\n" \
"                    message.type=conversation.type+1 and\n" \
"                    (message.counterpart_resource=conversation.resourc" \
"e or message.type != 3)\n" \
"                where\n" \
"                    message.body in (select info from file_transfer wh" \
"ere info not null) or\n" \
"                    message.id in (select info from file_transfer wher" \
"e info not null)", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
		}
		goto __finally1;
		__catch1_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp2_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp2_ = e->message;
			g_error ("database.vala:553: Failed to upgrade to database version 9: %s", _tmp2_);
			_g_error_free0 (e);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 11)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "\n" \
"                insert into mam_catchup (account_id, from_end, from_ti" \
"me, to_time)\n" \
"                select id, 1, 0, mam_earliest_synced from account wher" \
"e mam_earliest_synced not null and mam_earliest_synced > 0", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch2_g_error;
			}
		}
		goto __finally2;
		__catch2_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp3_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp3_ = e->message;
			g_error ("database.vala:562: Failed to upgrade to database version 11: %s", _tmp3_);
			_g_error_free0 (e);
		}
		__finally2:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 12)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "delete from avatar", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch3_g_error;
			}
		}
		goto __finally3;
		__catch3_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp4_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp4_ = e->message;
			g_error ("database.vala:569: Failed to upgrade to database version 12: %s", _tmp4_);
			_g_error_free0 (e);
		}
		__finally3:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 15)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "\n" \
"                update conversation\n" \
"                set read_up_to_item=ifnull((\n" \
"                    select content_item.id\n" \
"                    from content_item\n" \
"                    where content_item.foreign_id=conversation.read_up" \
"_to and content_type=1)\n" \
"                , -1);", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch4_g_error;
			}
		}
		goto __finally4;
		__catch4_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp5_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp5_ = e->message;
			g_error ("database.vala:583: Failed to upgrade to database version 15: %s", _tmp5_);
			_g_error_free0 (e);
		}
		__finally4:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 16)) {
		{
			DinoDatabaseAvatarTable* _tmp6_;
			qlite_database_exec ((QliteDatabase*) self, "DROP TABLE contact_avatar", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch5_g_error;
			}
			_tmp6_ = self->priv->_avatar;
			qlite_table_create_table_at_version ((QliteTable*) _tmp6_, (glong) DINO_DATABASE_VERSION);
		}
		goto __finally5;
		__catch5_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp7_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp7_ = e->message;
			g_error ("database.vala:591: Failed to upgrade to database version 16: %s", _tmp7_);
			_g_error_free0 (e);
		}
		__finally5:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 17)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "DROP INDEX IF EXISTS contentitem_localtime_counterpart_idx", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch6_g_error;
			}
			qlite_database_exec ((QliteDatabase*) self, "CREATE INDEX IF NOT EXISTS contentitem_conversation_hide_localtime_tim" \
"e_idx ON content_item (conversation_id, hide, local_time, time)", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch6_g_error;
			}
		}
		goto __finally6;
		__catch6_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp8_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp8_ = e->message;
			g_error ("database.vala:599: Failed to upgrade to database version 17: %s", _tmp8_);
			_g_error_free0 (e);
		}
		__finally6:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 18)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "DROP INDEX IF EXISTS contentitem_conversation_hide_localtime_time_idx", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch7_g_error;
			}
			qlite_database_exec ((QliteDatabase*) self, "CREATE INDEX IF NOT EXISTS contentitem_conversation_hide_time_idx ON c" \
"ontent_item (conversation_id, hide, time)", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch7_g_error;
			}
			qlite_database_exec ((QliteDatabase*) self, "DROP INDEX IF EXISTS message_account_counterpart_localtime_idx", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch7_g_error;
			}
			qlite_database_exec ((QliteDatabase*) self, "CREATE INDEX IF NOT EXISTS message_account_counterpart_time_idx ON mes" \
"sage (account_id, counterpart_id, time)", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch7_g_error;
			}
			qlite_database_exec ((QliteDatabase*) self, "DROP INDEX IF EXISTS filetransfer_localtime_counterpart_idx", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch7_g_error;
			}
		}
		goto __finally7;
		__catch7_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp9_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp9_ = e->message;
			g_error ("database.vala:612: Failed to upgrade to database version 18: %s", _tmp9_);
			_g_error_free0 (e);
		}
		__finally7:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 22)) {
		{
			qlite_database_exec ((QliteDatabase*) self, "INSERT INTO call_counterpart (call_id, jid_id, resource) SELECT id, co" \
"unterpart_id, counterpart_resource FROM call", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch8_g_error;
			}
		}
		goto __finally8;
		__catch8_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp10_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp10_ = e->message;
			g_error ("database.vala:619: Failed to upgrade to database version 22: %s", _tmp10_);
			_g_error_free0 (e);
		}
		__finally8:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	if (oldVersion < ((glong) 23)) {
		{
			DinoDatabaseMamCatchupTable* _tmp11_;
			qlite_database_exec ((QliteDatabase*) self, "ALTER TABLE mam_catchup RENAME TO mam_catchup2", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch9_g_error;
			}
			_tmp11_ = self->priv->_mam_catchup;
			qlite_table_create_table_at_version ((QliteTable*) _tmp11_, (glong) DINO_DATABASE_VERSION);
			qlite_database_exec ((QliteDatabase*) self, "INSERT INTO mam_catchup (id, account_id, server_jid, from_id, from_tim" \
"e, from_end, to_id, to_time)\n" \
"                                SELECT mam_catchup2.id, account_id, ba" \
"re_jid, ifnull(from_id, \"\"), from_time, ifnull(from_end, 0), ifnull(" \
"to_id, \"\"), to_time\n" \
"                                FROM mam_catchup2 JOIN account ON mam_" \
"catchup2.account_id=account.id", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch9_g_error;
			}
			qlite_database_exec ((QliteDatabase*) self, "DROP TABLE mam_catchup2", &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch9_g_error;
			}
		}
		goto __finally9;
		__catch9_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp12_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp12_ = e->message;
			g_error ("database.vala:637: Failed to upgrade to database version 23 (mam_catch" \
"up): %s", _tmp12_);
			_g_error_free0 (e);
		}
		__finally9:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		{
			glong active_last_updated = 0L;
			GDateTime* _tmp13_;
			GDateTime* _tmp14_;
			glong _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			_tmp13_ = g_date_time_new_now_utc ();
			_tmp14_ = _tmp13_;
			_tmp15_ = (glong) g_date_time_to_unix (_tmp14_);
			_g_date_time_unref0 (_tmp14_);
			active_last_updated = _tmp15_;
			_tmp16_ = g_strdup_printf ("%li", active_last_updated);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_strconcat ("UPDATE conversation SET active_last_changed=", _tmp17_, " WHERE active_last_changed=0", NULL);
			_tmp19_ = _tmp18_;
			qlite_database_exec ((QliteDatabase*) self, _tmp19_, &_inner_error0_);
			_g_free0 (_tmp19_);
			_g_free0 (_tmp17_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch10_g_error;
			}
		}
		goto __finally10;
		__catch10_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp20_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp20_ = e->message;
			g_error ("database.vala:644: Failed to upgrade to database version 23 (conversat" \
"ion): %s", _tmp20_);
			_g_error_free0 (e);
		}
		__finally10:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

static gboolean
_dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gboolean result;
	result = dino_entities_account_equals_func ((DinoEntitiesAccount*) a, (DinoEntitiesAccount*) b);
	return result;
}

GeeArrayList*
dino_database_get_accounts (DinoDatabase* self)
{
	GeeArrayList* ret = NULL;
	GeeArrayList* _tmp0_;
	GError* _inner_error0_ = NULL;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL);
	ret = _tmp0_;
	{
		QliteRowIterator* _row_it = NULL;
		DinoDatabaseAccountTable* _tmp1_;
		QliteQueryBuilder* _tmp2_;
		QliteQueryBuilder* _tmp3_;
		QliteRowIterator* _tmp4_;
		QliteRowIterator* _tmp5_;
		_tmp1_ = self->priv->_account;
		_tmp2_ = qlite_table_select ((QliteTable*) _tmp1_, NULL, (gint) 0);
		_tmp3_ = _tmp2_;
		_tmp4_ = qlite_query_builder_iterator (_tmp3_);
		_tmp5_ = _tmp4_;
		_qlite_statement_builder_unref0 (_tmp3_);
		_row_it = _tmp5_;
		while (TRUE) {
			QliteRowIterator* _tmp6_;
			QliteRow* row = NULL;
			QliteRowIterator* _tmp7_;
			QliteRow* _tmp8_;
			_tmp6_ = _row_it;
			if (!qlite_row_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _row_it;
			_tmp8_ = qlite_row_iterator_get (_tmp7_);
			row = _tmp8_;
			{
				DinoEntitiesAccount* account = NULL;
				QliteRow* _tmp9_;
				DinoEntitiesAccount* _tmp10_;
				GeeMap* _tmp11_;
				DinoEntitiesAccount* _tmp12_;
				gint _tmp13_;
				gint _tmp14_;
				GeeArrayList* _tmp20_;
				DinoEntitiesAccount* _tmp21_;
				GeeMap* _tmp22_;
				DinoEntitiesAccount* _tmp23_;
				gint _tmp24_;
				gint _tmp25_;
				DinoEntitiesAccount* _tmp26_;
				_tmp9_ = row;
				_tmp10_ = dino_entities_account_new_from_row (self, _tmp9_, &_inner_error0_);
				account = _tmp10_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
						goto __catch0_xmpp_invalid_jid_error;
					}
					_qlite_row_unref0 (row);
					_qlite_row_iterator_unref0 (_row_it);
					_g_object_unref0 (ret);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp11_ = self->account_table_cache;
				_tmp12_ = account;
				_tmp13_ = dino_entities_account_get_id (_tmp12_);
				_tmp14_ = _tmp13_;
				if (gee_map_has_key (_tmp11_, (gpointer) ((gintptr) _tmp14_))) {
					GeeMap* _tmp15_;
					DinoEntitiesAccount* _tmp16_;
					gint _tmp17_;
					gint _tmp18_;
					gpointer _tmp19_;
					_tmp15_ = self->account_table_cache;
					_tmp16_ = account;
					_tmp17_ = dino_entities_account_get_id (_tmp16_);
					_tmp18_ = _tmp17_;
					_tmp19_ = gee_map_get (_tmp15_, (gpointer) ((gintptr) _tmp18_));
					_g_object_unref0 (account);
					account = (DinoEntitiesAccount*) _tmp19_;
				}
				_tmp20_ = ret;
				_tmp21_ = account;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, _tmp21_);
				_tmp22_ = self->account_table_cache;
				_tmp23_ = account;
				_tmp24_ = dino_entities_account_get_id (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = account;
				gee_map_set (_tmp22_, (gpointer) ((gintptr) _tmp25_), _tmp26_);
				_g_object_unref0 (account);
			}
			goto __finally0;
			__catch0_xmpp_invalid_jid_error:
			{
				GError* e = NULL;
				GError* _tmp27_;
				const gchar* _tmp28_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp27_ = e;
				_tmp28_ = _tmp27_->message;
				g_warning ("database.vala:660: Ignoring account with invalid Jid: %s", _tmp28_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_qlite_row_unref0 (row);
				_qlite_row_iterator_unref0 (_row_it);
				_g_object_unref0 (ret);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			_qlite_row_unref0 (row);
		}
		_qlite_row_iterator_unref0 (_row_it);
	}
	result = ret;
	return result;
}

static gpointer
_qlite_row_ref0 (gpointer self)
{
	return self ? qlite_row_ref (self) : NULL;
}

DinoEntitiesAccount*
dino_database_get_account_by_id (DinoDatabase* self,
                                 gint id)
{
	GeeMap* _tmp0_;
	GError* _inner_error0_ = NULL;
	DinoEntitiesAccount* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->account_table_cache;
	if (gee_map_has_key (_tmp0_, (gpointer) ((gintptr) id))) {
		GeeMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = self->account_table_cache;
		_tmp2_ = gee_map_get (_tmp1_, (gpointer) ((gintptr) id));
		result = (DinoEntitiesAccount*) _tmp2_;
		return result;
	} else {
		QliteRow* row = NULL;
		DinoDatabaseAccountTable* _tmp3_;
		DinoDatabaseAccountTable* _tmp4_;
		QliteColumn* _tmp5_;
		QliteRowOption* _tmp6_;
		QliteRowOption* _tmp7_;
		QliteRow* _tmp8_;
		QliteRow* _tmp9_;
		QliteRow* _tmp10_;
		QliteRow* _tmp11_;
		QliteRow* _tmp12_;
		_tmp3_ = self->priv->_account;
		_tmp4_ = self->priv->_account;
		_tmp5_ = _tmp4_->id;
		_tmp6_ = qlite_table_row_with ((QliteTable*) _tmp3_, G_TYPE_INT, NULL, NULL, _tmp5_, (gpointer) ((gintptr) id));
		_tmp7_ = _tmp6_;
		_tmp8_ = qlite_row_option_get_inner (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _qlite_row_ref0 (_tmp9_);
		_tmp11_ = _tmp10_;
		_qlite_row_option_unref0 (_tmp7_);
		row = _tmp11_;
		_tmp12_ = row;
		if (_tmp12_ != NULL) {
			{
				DinoEntitiesAccount* a = NULL;
				QliteRow* _tmp13_;
				DinoEntitiesAccount* _tmp14_;
				GeeMap* _tmp15_;
				DinoEntitiesAccount* _tmp16_;
				gint _tmp17_;
				gint _tmp18_;
				DinoEntitiesAccount* _tmp19_;
				_tmp13_ = row;
				_tmp14_ = dino_entities_account_new_from_row (self, _tmp13_, &_inner_error0_);
				a = _tmp14_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
						goto __catch0_xmpp_invalid_jid_error;
					}
					_qlite_row_unref0 (row);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp15_ = self->account_table_cache;
				_tmp16_ = a;
				_tmp17_ = dino_entities_account_get_id (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = a;
				gee_map_set (_tmp15_, (gpointer) ((gintptr) _tmp18_), _tmp19_);
				result = a;
				_qlite_row_unref0 (row);
				return result;
			}
			goto __finally0;
			__catch0_xmpp_invalid_jid_error:
			{
				GError* e = NULL;
				GError* _tmp20_;
				const gchar* _tmp21_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp20_ = e;
				_tmp21_ = _tmp20_->message;
				g_warning ("database.vala:677: Ignoring account with invalid Jid: %s", _tmp21_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_qlite_row_unref0 (row);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
		result = NULL;
		_qlite_row_unref0 (row);
		return result;
	}
}

gint
dino_database_add_content_item (DinoDatabase* self,
                                DinoEntitiesConversation* conversation,
                                GDateTime* time,
                                GDateTime* local_time,
                                gint content_type,
                                gint foreign_id,
                                gboolean hide)
{
	DinoDatabaseContentItemTable* _tmp0_;
	QliteInsertBuilder* _tmp1_;
	QliteInsertBuilder* _tmp2_;
	DinoDatabaseContentItemTable* _tmp3_;
	QliteColumn* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	QliteInsertBuilder* _tmp7_;
	QliteInsertBuilder* _tmp8_;
	DinoDatabaseContentItemTable* _tmp9_;
	QliteColumn* _tmp10_;
	QliteInsertBuilder* _tmp11_;
	QliteInsertBuilder* _tmp12_;
	DinoDatabaseContentItemTable* _tmp13_;
	QliteColumn* _tmp14_;
	QliteInsertBuilder* _tmp15_;
	QliteInsertBuilder* _tmp16_;
	DinoDatabaseContentItemTable* _tmp17_;
	QliteColumn* _tmp18_;
	QliteInsertBuilder* _tmp19_;
	QliteInsertBuilder* _tmp20_;
	DinoDatabaseContentItemTable* _tmp21_;
	QliteColumn* _tmp22_;
	QliteInsertBuilder* _tmp23_;
	QliteInsertBuilder* _tmp24_;
	DinoDatabaseContentItemTable* _tmp25_;
	QliteColumn* _tmp26_;
	QliteInsertBuilder* _tmp27_;
	QliteInsertBuilder* _tmp28_;
	gint _tmp29_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (conversation != NULL, -1);
	g_return_val_if_fail (time != NULL, -1);
	g_return_val_if_fail (local_time != NULL, -1);
	_tmp0_ = self->priv->_content_item;
	_tmp1_ = qlite_table_insert ((QliteTable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_content_item;
	_tmp4_ = _tmp3_->conversation_id;
	_tmp5_ = dino_entities_conversation_get_id (conversation);
	_tmp6_ = _tmp5_;
	_tmp7_ = qlite_insert_builder_value (_tmp2_, G_TYPE_INT, NULL, NULL, _tmp4_, (gpointer) ((gintptr) _tmp6_));
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_content_item;
	_tmp10_ = _tmp9_->local_time;
	_tmp11_ = qlite_insert_builder_value (_tmp8_, G_TYPE_LONG, NULL, NULL, _tmp10_, (gpointer) ((gintptr) g_date_time_to_unix (local_time)));
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->_content_item;
	_tmp14_ = _tmp13_->time;
	_tmp15_ = qlite_insert_builder_value (_tmp12_, G_TYPE_LONG, NULL, NULL, _tmp14_, (gpointer) ((gintptr) g_date_time_to_unix (time)));
	_tmp16_ = _tmp15_;
	_tmp17_ = self->priv->_content_item;
	_tmp18_ = _tmp17_->content_type;
	_tmp19_ = qlite_insert_builder_value (_tmp16_, G_TYPE_INT, NULL, NULL, _tmp18_, (gpointer) ((gintptr) content_type));
	_tmp20_ = _tmp19_;
	_tmp21_ = self->priv->_content_item;
	_tmp22_ = _tmp21_->foreign_id;
	_tmp23_ = qlite_insert_builder_value (_tmp20_, G_TYPE_INT, NULL, NULL, _tmp22_, (gpointer) ((gintptr) foreign_id));
	_tmp24_ = _tmp23_;
	_tmp25_ = self->priv->_content_item;
	_tmp26_ = _tmp25_->hide;
	_tmp27_ = qlite_insert_builder_value (_tmp24_, G_TYPE_BOOLEAN, NULL, NULL, _tmp26_, (gpointer) ((gintptr) hide));
	_tmp28_ = _tmp27_;
	_tmp29_ = (gint) qlite_insert_builder_perform (_tmp28_);
	_qlite_statement_builder_unref0 (_tmp28_);
	_qlite_statement_builder_unref0 (_tmp24_);
	_qlite_statement_builder_unref0 (_tmp20_);
	_qlite_statement_builder_unref0 (_tmp16_);
	_qlite_statement_builder_unref0 (_tmp12_);
	_qlite_statement_builder_unref0 (_tmp8_);
	_qlite_statement_builder_unref0 (_tmp2_);
	result = _tmp29_;
	return result;
}

GeeList*
dino_database_get_messages (DinoDatabase* self,
                            XmppJid* jid,
                            DinoEntitiesAccount* account,
                            DinoEntitiesMessageType* type,
                            gint count,
                            GDateTime* before,
                            GDateTime* after,
                            gint id)
{
	QliteQueryBuilder* select = NULL;
	DinoDatabaseMessageTable* _tmp0_;
	QliteQueryBuilder* _tmp1_;
	QliteQueryBuilder* _tmp38_;
	DinoDatabaseMessageTable* _tmp39_;
	QliteColumn* _tmp40_;
	QliteQueryBuilder* _tmp41_;
	QliteQueryBuilder* _tmp42_;
	DinoDatabaseMessageTable* _tmp43_;
	QliteColumn* _tmp44_;
	gint _tmp45_;
	gint _tmp46_;
	QliteQueryBuilder* _tmp47_;
	QliteQueryBuilder* _tmp48_;
	QliteQueryBuilder* _tmp49_;
	QliteQueryBuilder* _tmp50_;
	const gchar* _tmp51_;
	QliteQueryBuilder* _tmp63_;
	DinoDatabaseRealJidTable* _tmp64_;
	DinoDatabaseRealJidTable* _tmp65_;
	QliteColumn* _tmp66_;
	DinoDatabaseMessageTable* _tmp67_;
	QliteColumn* _tmp68_;
	QliteQueryBuilder* _tmp69_;
	QliteQueryBuilder* _tmp70_;
	QliteQueryBuilder* _tmp71_;
	DinoDatabaseMessageCorrectionTable* _tmp72_;
	DinoDatabaseMessageCorrectionTable* _tmp73_;
	QliteColumn* _tmp74_;
	DinoDatabaseMessageTable* _tmp75_;
	QliteColumn* _tmp76_;
	QliteQueryBuilder* _tmp77_;
	QliteQueryBuilder* _tmp78_;
	GeeLinkedList* ret = NULL;
	GeeLinkedList* _tmp79_;
	GError* _inner_error0_ = NULL;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = self->priv->_message;
	_tmp1_ = qlite_table_select ((QliteTable*) _tmp0_, NULL, (gint) 0);
	select = _tmp1_;
	if (before != NULL) {
		if (id > 0) {
			QliteQueryBuilder* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			gchar** _tmp6_;
			gchar** _tmp7_;
			gint _tmp7__length1;
			QliteQueryBuilder* _tmp8_;
			QliteQueryBuilder* _tmp9_;
			_tmp2_ = select;
			_tmp3_ = g_strdup_printf ("%" G_GINT64_FORMAT, g_date_time_to_unix (before));
			_tmp4_ = g_strdup_printf ("%" G_GINT64_FORMAT, g_date_time_to_unix (before));
			_tmp5_ = g_strdup_printf ("%i", id);
			_tmp6_ = g_new0 (gchar*, 3 + 1);
			_tmp6_[0] = _tmp3_;
			_tmp6_[1] = _tmp4_;
			_tmp6_[2] = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp7__length1 = 3;
			_tmp8_ = qlite_query_builder_where (_tmp2_, "time < ? OR (time = ? AND message.id < ?)", _tmp7_, (gint) 3);
			_tmp9_ = _tmp8_;
			_qlite_statement_builder_unref0 (_tmp9_);
			_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
		} else {
			QliteQueryBuilder* _tmp10_;
			DinoDatabaseMessageTable* _tmp11_;
			QliteColumn* _tmp12_;
			QliteQueryBuilder* _tmp13_;
			QliteQueryBuilder* _tmp14_;
			_tmp10_ = select;
			_tmp11_ = self->priv->_message;
			_tmp12_ = _tmp11_->id;
			_tmp13_ = qlite_query_builder_with (_tmp10_, G_TYPE_INT, NULL, NULL, _tmp12_, "<", (gpointer) ((gintptr) id));
			_tmp14_ = _tmp13_;
			_qlite_statement_builder_unref0 (_tmp14_);
		}
	}
	if (after != NULL) {
		if (id > 0) {
			QliteQueryBuilder* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar** _tmp19_;
			gchar** _tmp20_;
			gint _tmp20__length1;
			QliteQueryBuilder* _tmp21_;
			QliteQueryBuilder* _tmp22_;
			_tmp15_ = select;
			_tmp16_ = g_strdup_printf ("%" G_GINT64_FORMAT, g_date_time_to_unix (after));
			_tmp17_ = g_strdup_printf ("%" G_GINT64_FORMAT, g_date_time_to_unix (after));
			_tmp18_ = g_strdup_printf ("%i", id);
			_tmp19_ = g_new0 (gchar*, 3 + 1);
			_tmp19_[0] = _tmp16_;
			_tmp19_[1] = _tmp17_;
			_tmp19_[2] = _tmp18_;
			_tmp20_ = _tmp19_;
			_tmp20__length1 = 3;
			_tmp21_ = qlite_query_builder_where (_tmp15_, "time > ? OR (time = ? AND message.id > ?)", _tmp20_, (gint) 3);
			_tmp22_ = _tmp21_;
			_qlite_statement_builder_unref0 (_tmp22_);
			_tmp20_ = (_vala_array_free (_tmp20_, _tmp20__length1, (GDestroyNotify) g_free), NULL);
		} else {
			QliteQueryBuilder* _tmp23_;
			DinoDatabaseMessageTable* _tmp24_;
			QliteColumn* _tmp25_;
			QliteQueryBuilder* _tmp26_;
			QliteQueryBuilder* _tmp27_;
			_tmp23_ = select;
			_tmp24_ = self->priv->_message;
			_tmp25_ = _tmp24_->time;
			_tmp26_ = qlite_query_builder_with (_tmp23_, G_TYPE_LONG, NULL, NULL, _tmp25_, ">", (gpointer) ((gintptr) g_date_time_to_unix (after)));
			_tmp27_ = _tmp26_;
			_qlite_statement_builder_unref0 (_tmp27_);
		}
		if (id > 0) {
			QliteQueryBuilder* _tmp28_;
			DinoDatabaseMessageTable* _tmp29_;
			QliteColumn* _tmp30_;
			QliteQueryBuilder* _tmp31_;
			QliteQueryBuilder* _tmp32_;
			_tmp28_ = select;
			_tmp29_ = self->priv->_message;
			_tmp30_ = _tmp29_->id;
			_tmp31_ = qlite_query_builder_with (_tmp28_, G_TYPE_INT, NULL, NULL, _tmp30_, ">", (gpointer) ((gintptr) id));
			_tmp32_ = _tmp31_;
			_qlite_statement_builder_unref0 (_tmp32_);
		}
	} else {
		QliteQueryBuilder* _tmp33_;
		DinoDatabaseMessageTable* _tmp34_;
		QliteColumn* _tmp35_;
		QliteQueryBuilder* _tmp36_;
		QliteQueryBuilder* _tmp37_;
		_tmp33_ = select;
		_tmp34_ = self->priv->_message;
		_tmp35_ = _tmp34_->time;
		_tmp36_ = qlite_query_builder_order_by (_tmp33_, _tmp35_, "DESC");
		_tmp37_ = _tmp36_;
		_qlite_statement_builder_unref0 (_tmp37_);
	}
	_tmp38_ = select;
	_tmp39_ = self->priv->_message;
	_tmp40_ = _tmp39_->counterpart_id;
	_tmp41_ = qlite_query_builder_with (_tmp38_, G_TYPE_INT, NULL, NULL, _tmp40_, "=", (gpointer) ((gintptr) dino_database_get_jid_id (self, jid)));
	_tmp42_ = _tmp41_;
	_tmp43_ = self->priv->_message;
	_tmp44_ = _tmp43_->account_id;
	_tmp45_ = dino_entities_account_get_id (account);
	_tmp46_ = _tmp45_;
	_tmp47_ = qlite_query_builder_with (_tmp42_, G_TYPE_INT, NULL, NULL, _tmp44_, "=", (gpointer) ((gintptr) _tmp46_));
	_tmp48_ = _tmp47_;
	_tmp49_ = qlite_query_builder_limit (_tmp48_, count);
	_tmp50_ = _tmp49_;
	_qlite_statement_builder_unref0 (_tmp50_);
	_qlite_statement_builder_unref0 (_tmp48_);
	_qlite_statement_builder_unref0 (_tmp42_);
	_tmp51_ = jid->resourcepart;
	if (_tmp51_ != NULL) {
		QliteQueryBuilder* _tmp52_;
		DinoDatabaseMessageTable* _tmp53_;
		QliteColumn* _tmp54_;
		const gchar* _tmp55_;
		QliteQueryBuilder* _tmp56_;
		QliteQueryBuilder* _tmp57_;
		_tmp52_ = select;
		_tmp53_ = self->priv->_message;
		_tmp54_ = _tmp53_->counterpart_resource;
		_tmp55_ = jid->resourcepart;
		_tmp56_ = qlite_query_builder_with (_tmp52_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp54_, "=", _tmp55_);
		_tmp57_ = _tmp56_;
		_qlite_statement_builder_unref0 (_tmp57_);
	}
	if (type != NULL) {
		QliteQueryBuilder* _tmp58_;
		DinoDatabaseMessageTable* _tmp59_;
		QliteColumn* _tmp60_;
		QliteQueryBuilder* _tmp61_;
		QliteQueryBuilder* _tmp62_;
		_tmp58_ = select;
		_tmp59_ = self->priv->_message;
		_tmp60_ = _tmp59_->type_;
		_tmp61_ = qlite_query_builder_with (_tmp58_, G_TYPE_INT, NULL, NULL, _tmp60_, "=", (gpointer) ((gintptr) (*type)));
		_tmp62_ = _tmp61_;
		_qlite_statement_builder_unref0 (_tmp62_);
	}
	_tmp63_ = select;
	_tmp64_ = self->priv->_real_jid;
	_tmp65_ = self->priv->_real_jid;
	_tmp66_ = _tmp65_->message_id;
	_tmp67_ = self->priv->_message;
	_tmp68_ = _tmp67_->id;
	_tmp69_ = qlite_query_builder_outer_join_with (_tmp63_, G_TYPE_INT, NULL, NULL, (QliteTable*) _tmp64_, _tmp66_, _tmp68_, NULL);
	_tmp70_ = _tmp69_;
	_qlite_statement_builder_unref0 (_tmp70_);
	_tmp71_ = select;
	_tmp72_ = self->priv->_message_correction;
	_tmp73_ = self->priv->_message_correction;
	_tmp74_ = _tmp73_->message_id;
	_tmp75_ = self->priv->_message;
	_tmp76_ = _tmp75_->id;
	_tmp77_ = qlite_query_builder_outer_join_with (_tmp71_, G_TYPE_INT, NULL, NULL, (QliteTable*) _tmp72_, _tmp74_, _tmp76_, NULL);
	_tmp78_ = _tmp77_;
	_qlite_statement_builder_unref0 (_tmp78_);
	_tmp79_ = gee_linked_list_new (DINO_ENTITIES_TYPE_MESSAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	ret = _tmp79_;
	{
		QliteRowIterator* _row_it = NULL;
		QliteQueryBuilder* _tmp80_;
		QliteRowIterator* _tmp81_;
		_tmp80_ = select;
		_tmp81_ = qlite_query_builder_iterator (_tmp80_);
		_row_it = _tmp81_;
		while (TRUE) {
			QliteRowIterator* _tmp82_;
			QliteRow* row = NULL;
			QliteRowIterator* _tmp83_;
			QliteRow* _tmp84_;
			_tmp82_ = _row_it;
			if (!qlite_row_iterator_next (_tmp82_)) {
				break;
			}
			_tmp83_ = _row_it;
			_tmp84_ = qlite_row_iterator_get (_tmp83_);
			row = _tmp84_;
			{
				DinoEntitiesMessage* _tmp85_ = NULL;
				QliteRow* _tmp86_;
				DinoEntitiesMessage* _tmp87_;
				GeeLinkedList* _tmp88_;
				_tmp86_ = row;
				_tmp87_ = dino_entities_message_new_from_row (self, _tmp86_, &_inner_error0_);
				_tmp85_ = _tmp87_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
						goto __catch0_xmpp_invalid_jid_error;
					}
					_qlite_row_unref0 (row);
					_qlite_row_iterator_unref0 (_row_it);
					_g_object_unref0 (ret);
					_qlite_statement_builder_unref0 (select);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp88_ = ret;
				gee_abstract_list_insert ((GeeAbstractList*) _tmp88_, 0, _tmp85_);
				_g_object_unref0 (_tmp85_);
			}
			goto __finally0;
			__catch0_xmpp_invalid_jid_error:
			{
				GError* e = NULL;
				GError* _tmp89_;
				const gchar* _tmp90_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp89_ = e;
				_tmp90_ = _tmp89_->message;
				g_warning ("database.vala:736: Ignoring message with invalid Jid: %s", _tmp90_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_qlite_row_unref0 (row);
				_qlite_row_iterator_unref0 (_row_it);
				_g_object_unref0 (ret);
				_qlite_statement_builder_unref0 (select);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			_qlite_row_unref0 (row);
		}
		_qlite_row_iterator_unref0 (_row_it);
	}
	result = (GeeList*) ret;
	_qlite_statement_builder_unref0 (select);
	return result;
}

DinoEntitiesMessage*
dino_database_get_message_by_id (DinoDatabase* self,
                                 gint id)
{
	QliteRow* row = NULL;
	DinoDatabaseMessageTable* _tmp0_;
	DinoDatabaseMessageTable* _tmp1_;
	QliteColumn* _tmp2_;
	QliteRowOption* _tmp3_;
	QliteRowOption* _tmp4_;
	QliteRow* _tmp5_;
	QliteRow* _tmp6_;
	QliteRow* _tmp7_;
	QliteRow* _tmp8_;
	QliteRow* _tmp9_;
	GError* _inner_error0_ = NULL;
	DinoEntitiesMessage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_message;
	_tmp1_ = self->priv->_message;
	_tmp2_ = _tmp1_->id;
	_tmp3_ = qlite_table_row_with ((QliteTable*) _tmp0_, G_TYPE_INT, NULL, NULL, _tmp2_, (gpointer) ((gintptr) id));
	_tmp4_ = _tmp3_;
	_tmp5_ = qlite_row_option_get_inner (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _qlite_row_ref0 (_tmp6_);
	_tmp8_ = _tmp7_;
	_qlite_row_option_unref0 (_tmp4_);
	row = _tmp8_;
	_tmp9_ = row;
	if (_tmp9_ != NULL) {
		{
			DinoEntitiesMessage* _tmp10_ = NULL;
			QliteRow* _tmp11_;
			DinoEntitiesMessage* _tmp12_;
			DinoEntitiesMessage* _tmp13_;
			_tmp11_ = row;
			_tmp12_ = dino_entities_message_new_from_row (self, _tmp11_, &_inner_error0_);
			_tmp10_ = _tmp12_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_qlite_row_unref0 (row);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			_tmp13_ = _tmp10_;
			_tmp10_ = NULL;
			result = _tmp13_;
			_g_object_unref0 (_tmp10_);
			_qlite_row_unref0 (row);
			return result;
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			GError* e = NULL;
			GError* _tmp14_;
			const gchar* _tmp15_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp14_ = e;
			_tmp15_ = _tmp14_->message;
			g_warning ("database.vala:748: Ignoring message with invalid Jid: %s", _tmp15_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_qlite_row_unref0 (row);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = NULL;
	_qlite_row_unref0 (row);
	return result;
}

GeeArrayList*
dino_database_get_conversations (DinoDatabase* self,
                                 DinoEntitiesAccount* account)
{
	GeeArrayList* ret = NULL;
	GeeArrayList* _tmp0_;
	GError* _inner_error0_ = NULL;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = gee_array_list_new (DINO_ENTITIES_TYPE_CONVERSATION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	ret = _tmp0_;
	{
		QliteRowIterator* _row_it = NULL;
		DinoDatabaseConversationTable* _tmp1_;
		QliteQueryBuilder* _tmp2_;
		QliteQueryBuilder* _tmp3_;
		DinoDatabaseConversationTable* _tmp4_;
		QliteColumn* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		QliteQueryBuilder* _tmp8_;
		QliteQueryBuilder* _tmp9_;
		QliteRowIterator* _tmp10_;
		QliteRowIterator* _tmp11_;
		_tmp1_ = self->priv->_conversation;
		_tmp2_ = qlite_table_select ((QliteTable*) _tmp1_, NULL, (gint) 0);
		_tmp3_ = _tmp2_;
		_tmp4_ = self->priv->_conversation;
		_tmp5_ = _tmp4_->account_id;
		_tmp6_ = dino_entities_account_get_id (account);
		_tmp7_ = _tmp6_;
		_tmp8_ = qlite_query_builder_with (_tmp3_, G_TYPE_INT, NULL, NULL, _tmp5_, "=", (gpointer) ((gintptr) _tmp7_));
		_tmp9_ = _tmp8_;
		_tmp10_ = qlite_query_builder_iterator (_tmp9_);
		_tmp11_ = _tmp10_;
		_qlite_statement_builder_unref0 (_tmp9_);
		_qlite_statement_builder_unref0 (_tmp3_);
		_row_it = _tmp11_;
		while (TRUE) {
			QliteRowIterator* _tmp12_;
			QliteRow* row = NULL;
			QliteRowIterator* _tmp13_;
			QliteRow* _tmp14_;
			_tmp12_ = _row_it;
			if (!qlite_row_iterator_next (_tmp12_)) {
				break;
			}
			_tmp13_ = _row_it;
			_tmp14_ = qlite_row_iterator_get (_tmp13_);
			row = _tmp14_;
			{
				DinoEntitiesConversation* _tmp15_ = NULL;
				QliteRow* _tmp16_;
				DinoEntitiesConversation* _tmp17_;
				GeeArrayList* _tmp18_;
				_tmp16_ = row;
				_tmp17_ = dino_entities_conversation_new_from_row (self, _tmp16_, &_inner_error0_);
				_tmp15_ = _tmp17_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
						goto __catch0_xmpp_invalid_jid_error;
					}
					_qlite_row_unref0 (row);
					_qlite_row_iterator_unref0 (_row_it);
					_g_object_unref0 (ret);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp18_ = ret;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp18_, _tmp15_);
				_g_object_unref0 (_tmp15_);
			}
			goto __finally0;
			__catch0_xmpp_invalid_jid_error:
			{
				GError* e = NULL;
				GError* _tmp19_;
				const gchar* _tmp20_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp19_ = e;
				_tmp20_ = _tmp19_->message;
				g_warning ("database.vala:760: Ignoring conversation with invalid Jid: %s", _tmp20_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_qlite_row_unref0 (row);
				_qlite_row_iterator_unref0 (_row_it);
				_g_object_unref0 (ret);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			_qlite_row_unref0 (row);
		}
		_qlite_row_iterator_unref0 (_row_it);
	}
	result = ret;
	return result;
}

gint
dino_database_get_jid_id (DinoDatabase* self,
                          XmppJid* jid_obj)
{
	XmppJid* bare_jid = NULL;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	GeeMap* _tmp2_;
	XmppJid* _tmp3_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (jid_obj != NULL, -1);
	_tmp0_ = xmpp_jid_get_bare_jid (jid_obj);
	_tmp1_ = _tmp0_;
	bare_jid = _tmp1_;
	_tmp2_ = self->jid_table_reverse;
	_tmp3_ = bare_jid;
	if (gee_map_has_key (_tmp2_, _tmp3_)) {
		GeeMap* _tmp4_;
		XmppJid* _tmp5_;
		gpointer _tmp6_;
		_tmp4_ = self->jid_table_reverse;
		_tmp5_ = bare_jid;
		_tmp6_ = gee_map_get (_tmp4_, _tmp5_);
		result = (gint) ((gintptr) _tmp6_);
		_xmpp_jid_unref0 (bare_jid);
		return result;
	} else {
		QliteRow* row = NULL;
		DinoDatabaseJidTable* _tmp7_;
		DinoDatabaseJidTable* _tmp8_;
		QliteColumn* _tmp9_;
		XmppJid* _tmp10_;
		XmppJid* _tmp11_;
		XmppJid* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		QliteRowOption* _tmp15_;
		QliteRowOption* _tmp16_;
		QliteRow* _tmp17_;
		QliteRow* _tmp18_;
		QliteRow* _tmp19_;
		QliteRow* _tmp20_;
		QliteRow* _tmp21_;
		_tmp7_ = self->priv->_jid;
		_tmp8_ = self->priv->_jid;
		_tmp9_ = _tmp8_->bare_jid;
		_tmp10_ = xmpp_jid_get_bare_jid (jid_obj);
		_tmp11_ = _tmp10_;
		_tmp12_ = _tmp11_;
		_tmp13_ = xmpp_jid_to_string (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = qlite_table_row_with ((QliteTable*) _tmp7_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp9_, _tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = qlite_row_option_get_inner (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = _qlite_row_ref0 (_tmp18_);
		_tmp20_ = _tmp19_;
		_qlite_row_option_unref0 (_tmp16_);
		_g_free0 (_tmp14_);
		_xmpp_jid_unref0 (_tmp12_);
		row = _tmp20_;
		_tmp21_ = row;
		if (_tmp21_ != NULL) {
			gint id = 0;
			QliteRow* _tmp22_;
			DinoDatabaseJidTable* _tmp23_;
			QliteColumn* _tmp24_;
			gpointer _tmp25_;
			GeeMap* _tmp26_;
			XmppJid* _tmp27_;
			GeeMap* _tmp28_;
			XmppJid* _tmp29_;
			_tmp22_ = row;
			_tmp23_ = self->priv->_jid;
			_tmp24_ = _tmp23_->id;
			_tmp25_ = qlite_row_get (_tmp22_, G_TYPE_INT, NULL, NULL, _tmp24_);
			id = (gint) ((gintptr) _tmp25_);
			_tmp26_ = self->jid_table_cache;
			_tmp27_ = bare_jid;
			gee_map_set (_tmp26_, (gpointer) ((gintptr) id), _tmp27_);
			_tmp28_ = self->jid_table_reverse;
			_tmp29_ = bare_jid;
			gee_map_set (_tmp28_, _tmp29_, (gpointer) ((gintptr) id));
			result = id;
			_qlite_row_unref0 (row);
			_xmpp_jid_unref0 (bare_jid);
			return result;
		} else {
			result = dino_database_add_jid (self, jid_obj);
			_qlite_row_unref0 (row);
			_xmpp_jid_unref0 (bare_jid);
			return result;
		}
		_qlite_row_unref0 (row);
	}
}

static gpointer
_qlite_column_ref0 (gpointer self)
{
	return self ? qlite_column_ref (self) : NULL;
}

XmppJid*
dino_database_get_jid_by_id (DinoDatabase* self,
                             gint id,
                             GError** error)
{
	GeeMap* _tmp0_;
	GError* _inner_error0_ = NULL;
	XmppJid* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->jid_table_cache;
	if (gee_map_has_key (_tmp0_, (gpointer) ((gintptr) id))) {
		GeeMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = self->jid_table_cache;
		_tmp2_ = gee_map_get (_tmp1_, (gpointer) ((gintptr) id));
		result = (XmppJid*) _tmp2_;
		return result;
	} else {
		gchar* bare_jid = NULL;
		DinoDatabaseJidTable* _tmp3_;
		DinoDatabaseJidTable* _tmp4_;
		QliteColumn* _tmp5_;
		QliteColumn* _tmp6_;
		QliteColumn** _tmp7_;
		QliteColumn** _tmp8_;
		gint _tmp8__length1;
		QliteQueryBuilder* _tmp9_;
		QliteQueryBuilder* _tmp10_;
		DinoDatabaseJidTable* _tmp11_;
		QliteColumn* _tmp12_;
		QliteQueryBuilder* _tmp13_;
		QliteQueryBuilder* _tmp14_;
		DinoDatabaseJidTable* _tmp15_;
		QliteColumn* _tmp16_;
		gpointer _tmp17_;
		gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp3_ = self->priv->_jid;
		_tmp4_ = self->priv->_jid;
		_tmp5_ = _tmp4_->bare_jid;
		_tmp6_ = _qlite_column_ref0 (_tmp5_);
		_tmp7_ = g_new0 (QliteColumn*, 1 + 1);
		_tmp7_[0] = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp8__length1 = 1;
		_tmp9_ = qlite_table_select ((QliteTable*) _tmp3_, _tmp8_, (gint) 1);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->_jid;
		_tmp12_ = _tmp11_->id;
		_tmp13_ = qlite_query_builder_with (_tmp10_, G_TYPE_INT, NULL, NULL, _tmp12_, "=", (gpointer) ((gintptr) id));
		_tmp14_ = _tmp13_;
		_tmp15_ = self->priv->_jid;
		_tmp16_ = _tmp15_->bare_jid;
		_tmp17_ = qlite_query_builder_get (_tmp14_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp16_, NULL);
		_tmp18_ = (gchar*) _tmp17_;
		_qlite_statement_builder_unref0 (_tmp14_);
		_qlite_statement_builder_unref0 (_tmp10_);
		_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) qlite_column_unref), NULL);
		bare_jid = _tmp18_;
		_tmp19_ = bare_jid;
		if (_tmp19_ != NULL) {
			XmppJid* jid_parsed = NULL;
			const gchar* _tmp20_;
			XmppJid* _tmp21_;
			GeeMap* _tmp22_;
			XmppJid* _tmp23_;
			XmppJid* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			const gchar* _tmp27_;
			gboolean _tmp28_;
			_tmp20_ = bare_jid;
			_tmp21_ = xmpp_jid_new (_tmp20_, &_inner_error0_);
			jid_parsed = _tmp21_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_g_free0 (bare_jid);
					return NULL;
				} else {
					_g_free0 (bare_jid);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp22_ = self->jid_table_cache;
			_tmp23_ = jid_parsed;
			gee_map_set (_tmp22_, (gpointer) ((gintptr) id), _tmp23_);
			_tmp24_ = jid_parsed;
			_tmp25_ = xmpp_jid_to_string (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = bare_jid;
			_tmp28_ = g_strcmp0 (_tmp26_, _tmp27_) == 0;
			_g_free0 (_tmp26_);
			if (_tmp28_) {
				GeeMap* _tmp29_;
				XmppJid* _tmp30_;
				_tmp29_ = self->jid_table_reverse;
				_tmp30_ = jid_parsed;
				gee_map_set (_tmp29_, _tmp30_, (gpointer) ((gintptr) id));
			}
			result = jid_parsed;
			_g_free0 (bare_jid);
			return result;
		}
		result = NULL;
		_g_free0 (bare_jid);
		return result;
	}
}

static gint
dino_database_add_jid (DinoDatabase* self,
                       XmppJid* jid_obj)
{
	XmppJid* bare_jid = NULL;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	gint id = 0;
	DinoDatabaseJidTable* _tmp2_;
	QliteInsertBuilder* _tmp3_;
	QliteInsertBuilder* _tmp4_;
	DinoDatabaseJidTable* _tmp5_;
	QliteColumn* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	QliteInsertBuilder* _tmp9_;
	QliteInsertBuilder* _tmp10_;
	gint _tmp11_;
	GeeMap* _tmp12_;
	GeeMap* _tmp13_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (jid_obj != NULL, -1);
	_tmp0_ = xmpp_jid_get_bare_jid (jid_obj);
	_tmp1_ = _tmp0_;
	bare_jid = _tmp1_;
	_tmp2_ = self->priv->_jid;
	_tmp3_ = qlite_table_insert ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_jid;
	_tmp6_ = _tmp5_->bare_jid;
	_tmp7_ = xmpp_jid_to_string (bare_jid);
	_tmp8_ = _tmp7_;
	_tmp9_ = qlite_insert_builder_value (_tmp4_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp6_, _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = (gint) qlite_insert_builder_perform (_tmp10_);
	_qlite_statement_builder_unref0 (_tmp10_);
	_g_free0 (_tmp8_);
	_qlite_statement_builder_unref0 (_tmp4_);
	id = _tmp11_;
	_tmp12_ = self->jid_table_cache;
	gee_map_set (_tmp12_, (gpointer) ((gintptr) id), bare_jid);
	_tmp13_ = self->jid_table_reverse;
	gee_map_set (_tmp13_, bare_jid, (gpointer) ((gintptr) id));
	result = id;
	_xmpp_jid_unref0 (bare_jid);
	return result;
}

DinoDatabaseAccountTable*
dino_database_get_account (DinoDatabase* self)
{
	DinoDatabaseAccountTable* result;
	DinoDatabaseAccountTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_account (DinoDatabase* self,
                           DinoDatabaseAccountTable* value)
{
	DinoDatabaseAccountTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_account);
	self->priv->_account = _tmp0_;
}

DinoDatabaseJidTable*
dino_database_get_jid (DinoDatabase* self)
{
	DinoDatabaseJidTable* result;
	DinoDatabaseJidTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_jid;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_jid (DinoDatabase* self,
                       DinoDatabaseJidTable* value)
{
	DinoDatabaseJidTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_jid);
	self->priv->_jid = _tmp0_;
}

DinoDatabaseEntityTable*
dino_database_get_entity (DinoDatabase* self)
{
	DinoDatabaseEntityTable* result;
	DinoDatabaseEntityTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_entity;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_entity (DinoDatabase* self,
                          DinoDatabaseEntityTable* value)
{
	DinoDatabaseEntityTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_entity);
	self->priv->_entity = _tmp0_;
}

DinoDatabaseContentItemTable*
dino_database_get_content_item (DinoDatabase* self)
{
	DinoDatabaseContentItemTable* result;
	DinoDatabaseContentItemTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_item;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_content_item (DinoDatabase* self,
                                DinoDatabaseContentItemTable* value)
{
	DinoDatabaseContentItemTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_content_item);
	self->priv->_content_item = _tmp0_;
}

DinoDatabaseMessageTable*
dino_database_get_message (DinoDatabase* self)
{
	DinoDatabaseMessageTable* result;
	DinoDatabaseMessageTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_message;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_message (DinoDatabase* self,
                           DinoDatabaseMessageTable* value)
{
	DinoDatabaseMessageTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_message);
	self->priv->_message = _tmp0_;
}

DinoDatabaseBodyMeta*
dino_database_get_body_meta (DinoDatabase* self)
{
	DinoDatabaseBodyMeta* result;
	DinoDatabaseBodyMeta* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_body_meta;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_body_meta (DinoDatabase* self,
                             DinoDatabaseBodyMeta* value)
{
	DinoDatabaseBodyMeta* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_body_meta);
	self->priv->_body_meta = _tmp0_;
}

DinoDatabaseReplyTable*
dino_database_get_reply (DinoDatabase* self)
{
	DinoDatabaseReplyTable* result;
	DinoDatabaseReplyTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_reply;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_reply (DinoDatabase* self,
                         DinoDatabaseReplyTable* value)
{
	DinoDatabaseReplyTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_reply);
	self->priv->_reply = _tmp0_;
}

DinoDatabaseMessageCorrectionTable*
dino_database_get_message_correction (DinoDatabase* self)
{
	DinoDatabaseMessageCorrectionTable* result;
	DinoDatabaseMessageCorrectionTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_message_correction;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_message_correction (DinoDatabase* self,
                                      DinoDatabaseMessageCorrectionTable* value)
{
	DinoDatabaseMessageCorrectionTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_message_correction);
	self->priv->_message_correction = _tmp0_;
}

DinoDatabaseRealJidTable*
dino_database_get_real_jid (DinoDatabase* self)
{
	DinoDatabaseRealJidTable* result;
	DinoDatabaseRealJidTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_real_jid;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_real_jid (DinoDatabase* self,
                            DinoDatabaseRealJidTable* value)
{
	DinoDatabaseRealJidTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_real_jid);
	self->priv->_real_jid = _tmp0_;
}

DinoDatabaseOccupantIdTable*
dino_database_get_occupantid (DinoDatabase* self)
{
	DinoDatabaseOccupantIdTable* result;
	DinoDatabaseOccupantIdTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_occupantid;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_occupantid (DinoDatabase* self,
                              DinoDatabaseOccupantIdTable* value)
{
	DinoDatabaseOccupantIdTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_occupantid);
	self->priv->_occupantid = _tmp0_;
}

DinoDatabaseFileTransferTable*
dino_database_get_file_transfer (DinoDatabase* self)
{
	DinoDatabaseFileTransferTable* result;
	DinoDatabaseFileTransferTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_transfer;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_file_transfer (DinoDatabase* self,
                                 DinoDatabaseFileTransferTable* value)
{
	DinoDatabaseFileTransferTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_file_transfer);
	self->priv->_file_transfer = _tmp0_;
}

DinoDatabaseFileHashesTable*
dino_database_get_file_hashes (DinoDatabase* self)
{
	DinoDatabaseFileHashesTable* result;
	DinoDatabaseFileHashesTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_hashes;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_file_hashes (DinoDatabase* self,
                               DinoDatabaseFileHashesTable* value)
{
	DinoDatabaseFileHashesTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_file_hashes);
	self->priv->_file_hashes = _tmp0_;
}

DinoDatabaseFileThumbnailsTable*
dino_database_get_file_thumbnails (DinoDatabase* self)
{
	DinoDatabaseFileThumbnailsTable* result;
	DinoDatabaseFileThumbnailsTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_thumbnails;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_file_thumbnails (DinoDatabase* self,
                                   DinoDatabaseFileThumbnailsTable* value)
{
	DinoDatabaseFileThumbnailsTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_file_thumbnails);
	self->priv->_file_thumbnails = _tmp0_;
}

DinoDatabaseSourcesTable*
dino_database_get_sfs_sources (DinoDatabase* self)
{
	DinoDatabaseSourcesTable* result;
	DinoDatabaseSourcesTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sfs_sources;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_sfs_sources (DinoDatabase* self,
                               DinoDatabaseSourcesTable* value)
{
	DinoDatabaseSourcesTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_sfs_sources);
	self->priv->_sfs_sources = _tmp0_;
}

DinoDatabaseCallTable*
dino_database_get_call (DinoDatabase* self)
{
	DinoDatabaseCallTable* result;
	DinoDatabaseCallTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_call;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_call (DinoDatabase* self,
                        DinoDatabaseCallTable* value)
{
	DinoDatabaseCallTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_call);
	self->priv->_call = _tmp0_;
}

DinoDatabaseCallCounterpartTable*
dino_database_get_call_counterpart (DinoDatabase* self)
{
	DinoDatabaseCallCounterpartTable* result;
	DinoDatabaseCallCounterpartTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_call_counterpart;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_call_counterpart (DinoDatabase* self,
                                    DinoDatabaseCallCounterpartTable* value)
{
	DinoDatabaseCallCounterpartTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_call_counterpart);
	self->priv->_call_counterpart = _tmp0_;
}

DinoDatabaseConversationTable*
dino_database_get_conversation (DinoDatabase* self)
{
	DinoDatabaseConversationTable* result;
	DinoDatabaseConversationTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conversation;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_conversation (DinoDatabase* self,
                                DinoDatabaseConversationTable* value)
{
	DinoDatabaseConversationTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_conversation);
	self->priv->_conversation = _tmp0_;
}

DinoDatabaseAvatarTable*
dino_database_get_avatar (DinoDatabase* self)
{
	DinoDatabaseAvatarTable* result;
	DinoDatabaseAvatarTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_avatar;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_avatar (DinoDatabase* self,
                          DinoDatabaseAvatarTable* value)
{
	DinoDatabaseAvatarTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_avatar);
	self->priv->_avatar = _tmp0_;
}

DinoDatabaseEntityIdentityTable*
dino_database_get_entity_identity (DinoDatabase* self)
{
	DinoDatabaseEntityIdentityTable* result;
	DinoDatabaseEntityIdentityTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_entity_identity;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_entity_identity (DinoDatabase* self,
                                   DinoDatabaseEntityIdentityTable* value)
{
	DinoDatabaseEntityIdentityTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_entity_identity);
	self->priv->_entity_identity = _tmp0_;
}

DinoDatabaseEntityFeatureTable*
dino_database_get_entity_feature (DinoDatabase* self)
{
	DinoDatabaseEntityFeatureTable* result;
	DinoDatabaseEntityFeatureTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_entity_feature;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_entity_feature (DinoDatabase* self,
                                  DinoDatabaseEntityFeatureTable* value)
{
	DinoDatabaseEntityFeatureTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_entity_feature);
	self->priv->_entity_feature = _tmp0_;
}

DinoDatabaseRosterTable*
dino_database_get_roster (DinoDatabase* self)
{
	DinoDatabaseRosterTable* result;
	DinoDatabaseRosterTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_roster;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_roster (DinoDatabase* self,
                          DinoDatabaseRosterTable* value)
{
	DinoDatabaseRosterTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_roster);
	self->priv->_roster = _tmp0_;
}

DinoDatabaseMamCatchupTable*
dino_database_get_mam_catchup (DinoDatabase* self)
{
	DinoDatabaseMamCatchupTable* result;
	DinoDatabaseMamCatchupTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mam_catchup;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_mam_catchup (DinoDatabase* self,
                               DinoDatabaseMamCatchupTable* value)
{
	DinoDatabaseMamCatchupTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_mam_catchup);
	self->priv->_mam_catchup = _tmp0_;
}

DinoDatabaseReactionTable*
dino_database_get_reaction (DinoDatabase* self)
{
	DinoDatabaseReactionTable* result;
	DinoDatabaseReactionTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_reaction;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_reaction (DinoDatabase* self,
                            DinoDatabaseReactionTable* value)
{
	DinoDatabaseReactionTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_reaction);
	self->priv->_reaction = _tmp0_;
}

DinoDatabaseSettingsTable*
dino_database_get_settings (DinoDatabase* self)
{
	DinoDatabaseSettingsTable* result;
	DinoDatabaseSettingsTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_settings;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_settings (DinoDatabase* self,
                            DinoDatabaseSettingsTable* value)
{
	DinoDatabaseSettingsTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_settings);
	self->priv->_settings = _tmp0_;
}

DinoDatabaseAccountSettingsTable*
dino_database_get_account_settings (DinoDatabase* self)
{
	DinoDatabaseAccountSettingsTable* result;
	DinoDatabaseAccountSettingsTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account_settings;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_account_settings (DinoDatabase* self,
                                    DinoDatabaseAccountSettingsTable* value)
{
	DinoDatabaseAccountSettingsTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_account_settings);
	self->priv->_account_settings = _tmp0_;
}

DinoDatabaseConversationSettingsTable*
dino_database_get_conversation_settings (DinoDatabase* self)
{
	DinoDatabaseConversationSettingsTable* result;
	DinoDatabaseConversationSettingsTable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conversation_settings;
	result = _tmp0_;
	return result;
}

static void
dino_database_set_conversation_settings (DinoDatabase* self,
                                         DinoDatabaseConversationSettingsTable* value)
{
	DinoDatabaseConversationSettingsTable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _qlite_table_ref0 (value);
	_qlite_table_unref0 (self->priv->_conversation_settings);
	self->priv->_conversation_settings = _tmp0_;
}

DinoDatabaseAccountTable*
dino_database_account_table_construct (GType object_type,
                                       DinoDatabase* db)
{
	DinoDatabaseAccountTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn** _tmp16_;
	QliteColumn** _tmp17_;
	gint _tmp17__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseAccountTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "account");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->bare_jid;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->resourcepart;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->password;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->alias;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->enabled;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->roster_version;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->mam_earliest_synced;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = g_new0 (QliteColumn*, 8 + 1);
	_tmp16_[0] = _tmp1_;
	_tmp16_[1] = _tmp3_;
	_tmp16_[2] = _tmp5_;
	_tmp16_[3] = _tmp7_;
	_tmp16_[4] = _tmp9_;
	_tmp16_[5] = _tmp11_;
	_tmp16_[6] = _tmp13_;
	_tmp16_[7] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 8;
	qlite_table_init ((QliteTable*) self, _tmp17_, (gint) 8, "");
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseAccountTable*
dino_database_account_table_new (DinoDatabase* db)
{
	return dino_database_account_table_construct (DINO_DATABASE_TYPE_ACCOUNT_TABLE, db);
}

static void
dino_database_account_table_class_init (DinoDatabaseAccountTableClass * klass,
                                        gpointer klass_data)
{
	dino_database_account_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_account_table_finalize;
}

static void
dino_database_account_table_instance_init (DinoDatabaseAccountTable * self,
                                           gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnText* _tmp1_ = NULL;
	QliteColumnText* _tmp2_;
	QliteColumnText* _tmp3_;
	QliteColumnText* _tmp4_;
	QliteColumnBoolInt* _tmp5_;
	QliteColumnText* _tmp6_ = NULL;
	QliteColumnLong* _tmp7_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("bare_jid");
	qlite_column_set_unique ((QliteColumn*) _tmp1_, TRUE);
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->bare_jid = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("resourcepart");
	self->resourcepart = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("password");
	self->password = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("alias");
	self->alias = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_bool_int_new ("enabled");
	self->enabled = (QliteColumn*) _tmp5_;
	_tmp6_ = qlite_column_text_new ("roster_version");
	qlite_column_set_min_version ((QliteColumn*) _tmp6_, (glong) 2);
	self->roster_version = (QliteColumn*) _tmp6_;
	_tmp7_ = qlite_column_long_new ("mam_earliest_synced");
	qlite_column_set_min_version ((QliteColumn*) _tmp7_, (glong) 4);
	self->mam_earliest_synced = (QliteColumn*) _tmp7_;
}

static void
dino_database_account_table_finalize (QliteTable * obj)
{
	DinoDatabaseAccountTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_ACCOUNT_TABLE, DinoDatabaseAccountTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->bare_jid);
	_qlite_column_unref0 (self->resourcepart);
	_qlite_column_unref0 (self->password);
	_qlite_column_unref0 (self->alias);
	_qlite_column_unref0 (self->enabled);
	_qlite_column_unref0 (self->roster_version);
	_qlite_column_unref0 (self->mam_earliest_synced);
	QLITE_TABLE_CLASS (dino_database_account_table_parent_class)->finalize (obj);
}

static GType
dino_database_account_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseAccountTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_account_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseAccountTable), 0, (GInstanceInitFunc) dino_database_account_table_instance_init, NULL };
	GType dino_database_account_table_type_id;
	dino_database_account_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseAccountTable", &g_define_type_info, 0);
	return dino_database_account_table_type_id;
}

GType
dino_database_account_table_get_type (void)
{
	static volatile gsize dino_database_account_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_account_table_type_id__once)) {
		GType dino_database_account_table_type_id;
		dino_database_account_table_type_id = dino_database_account_table_get_type_once ();
		g_once_init_leave (&dino_database_account_table_type_id__once, dino_database_account_table_type_id);
	}
	return dino_database_account_table_type_id__once;
}

DinoDatabaseJidTable*
dino_database_jid_table_construct (GType object_type,
                                   DinoDatabase* db)
{
	DinoDatabaseJidTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn** _tmp4_;
	QliteColumn** _tmp5_;
	gint _tmp5__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseJidTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "jid");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->bare_jid;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 2;
	qlite_table_init ((QliteTable*) self, _tmp5_, (gint) 2, "");
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseJidTable*
dino_database_jid_table_new (DinoDatabase* db)
{
	return dino_database_jid_table_construct (DINO_DATABASE_TYPE_JID_TABLE, db);
}

static void
dino_database_jid_table_class_init (DinoDatabaseJidTableClass * klass,
                                    gpointer klass_data)
{
	dino_database_jid_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_jid_table_finalize;
}

static void
dino_database_jid_table_instance_init (DinoDatabaseJidTable * self,
                                       gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnText* _tmp1_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("bare_jid");
	qlite_column_set_unique ((QliteColumn*) _tmp1_, TRUE);
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->bare_jid = (QliteColumn*) _tmp1_;
}

static void
dino_database_jid_table_finalize (QliteTable * obj)
{
	DinoDatabaseJidTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_JID_TABLE, DinoDatabaseJidTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->bare_jid);
	QLITE_TABLE_CLASS (dino_database_jid_table_parent_class)->finalize (obj);
}

static GType
dino_database_jid_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseJidTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_jid_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseJidTable), 0, (GInstanceInitFunc) dino_database_jid_table_instance_init, NULL };
	GType dino_database_jid_table_type_id;
	dino_database_jid_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseJidTable", &g_define_type_info, 0);
	return dino_database_jid_table_type_id;
}

GType
dino_database_jid_table_get_type (void)
{
	static volatile gsize dino_database_jid_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_jid_table_type_id__once)) {
		GType dino_database_jid_table_type_id;
		dino_database_jid_table_type_id = dino_database_jid_table_get_type_once ();
		g_once_init_leave (&dino_database_jid_table_type_id__once, dino_database_jid_table_type_id);
	}
	return dino_database_jid_table_type_id__once;
}

DinoDatabaseEntityTable*
dino_database_entity_table_construct (GType object_type,
                                      DinoDatabase* db)
{
	DinoDatabaseEntityTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn** _tmp12_;
	QliteColumn** _tmp13_;
	gint _tmp13__length1;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn** _tmp20_;
	QliteColumn** _tmp21_;
	gint _tmp21__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseEntityTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "entity");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->jid_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->resource;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->caps_hash;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->last_seen;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = g_new0 (QliteColumn*, 6 + 1);
	_tmp12_[0] = _tmp1_;
	_tmp12_[1] = _tmp3_;
	_tmp12_[2] = _tmp5_;
	_tmp12_[3] = _tmp7_;
	_tmp12_[4] = _tmp9_;
	_tmp12_[5] = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp13__length1 = 6;
	qlite_table_init ((QliteTable*) self, _tmp13_, (gint) 6, "");
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp14_ = self->account_id;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = self->jid_id;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->resource;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp20_[0] = _tmp15_;
	_tmp20_[1] = _tmp17_;
	_tmp20_[2] = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp21__length1 = 3;
	qlite_table_unique ((QliteTable*) self, _tmp21_, (gint) 3, "IGNORE");
	_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseEntityTable*
dino_database_entity_table_new (DinoDatabase* db)
{
	return dino_database_entity_table_construct (DINO_DATABASE_TYPE_ENTITY_TABLE, db);
}

static void
dino_database_entity_table_class_init (DinoDatabaseEntityTableClass * klass,
                                       gpointer klass_data)
{
	dino_database_entity_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_entity_table_finalize;
}

static void
dino_database_entity_table_instance_init (DinoDatabaseEntityTable * self,
                                          gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_;
	QliteColumnInteger* _tmp2_;
	QliteColumnText* _tmp3_;
	QliteColumnText* _tmp4_;
	QliteColumnLong* _tmp5_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("jid_id");
	self->jid_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("resource");
	self->resource = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("caps_hash");
	self->caps_hash = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_long_new ("last_seen");
	self->last_seen = (QliteColumn*) _tmp5_;
}

static void
dino_database_entity_table_finalize (QliteTable * obj)
{
	DinoDatabaseEntityTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_ENTITY_TABLE, DinoDatabaseEntityTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->jid_id);
	_qlite_column_unref0 (self->resource);
	_qlite_column_unref0 (self->caps_hash);
	_qlite_column_unref0 (self->last_seen);
	QLITE_TABLE_CLASS (dino_database_entity_table_parent_class)->finalize (obj);
}

static GType
dino_database_entity_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseEntityTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_entity_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseEntityTable), 0, (GInstanceInitFunc) dino_database_entity_table_instance_init, NULL };
	GType dino_database_entity_table_type_id;
	dino_database_entity_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseEntityTable", &g_define_type_info, 0);
	return dino_database_entity_table_type_id;
}

GType
dino_database_entity_table_get_type (void)
{
	static volatile gsize dino_database_entity_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_entity_table_type_id__once)) {
		GType dino_database_entity_table_type_id;
		dino_database_entity_table_type_id = dino_database_entity_table_get_type_once ();
		g_once_init_leave (&dino_database_entity_table_type_id__once, dino_database_entity_table_type_id);
	}
	return dino_database_entity_table_type_id__once;
}

DinoDatabaseContentItemTable*
dino_database_content_item_table_construct (GType object_type,
                                            DinoDatabase* db)
{
	DinoDatabaseContentItemTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn** _tmp14_;
	QliteColumn** _tmp15_;
	gint _tmp15__length1;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn* _tmp20_;
	QliteColumn* _tmp21_;
	QliteColumn** _tmp22_;
	QliteColumn** _tmp23_;
	gint _tmp23__length1;
	QliteColumn* _tmp24_;
	QliteColumn* _tmp25_;
	QliteColumn* _tmp26_;
	QliteColumn* _tmp27_;
	QliteColumn** _tmp28_;
	QliteColumn** _tmp29_;
	gint _tmp29__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseContentItemTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "content_item");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->conversation_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->time;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->local_time;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->content_type;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->foreign_id;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->hide;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = g_new0 (QliteColumn*, 7 + 1);
	_tmp14_[0] = _tmp1_;
	_tmp14_[1] = _tmp3_;
	_tmp14_[2] = _tmp5_;
	_tmp14_[3] = _tmp7_;
	_tmp14_[4] = _tmp9_;
	_tmp14_[5] = _tmp11_;
	_tmp14_[6] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 7;
	qlite_table_init ((QliteTable*) self, _tmp15_, (gint) 7, "");
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp16_ = self->conversation_id;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->hide;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = self->time;
	_tmp21_ = _qlite_column_ref0 (_tmp20_);
	_tmp22_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp22_[0] = _tmp17_;
	_tmp22_[1] = _tmp19_;
	_tmp22_[2] = _tmp21_;
	_tmp23_ = _tmp22_;
	_tmp23__length1 = 3;
	qlite_table_index ((QliteTable*) self, "contentitem_conversation_hide_time_idx", _tmp23_, (gint) 3, FALSE);
	_tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp24_ = self->content_type;
	_tmp25_ = _qlite_column_ref0 (_tmp24_);
	_tmp26_ = self->foreign_id;
	_tmp27_ = _qlite_column_ref0 (_tmp26_);
	_tmp28_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp28_[0] = _tmp25_;
	_tmp28_[1] = _tmp27_;
	_tmp29_ = _tmp28_;
	_tmp29__length1 = 2;
	qlite_table_unique ((QliteTable*) self, _tmp29_, (gint) 2, "IGNORE");
	_tmp29_ = (_vala_array_free (_tmp29_, _tmp29__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseContentItemTable*
dino_database_content_item_table_new (DinoDatabase* db)
{
	return dino_database_content_item_table_construct (DINO_DATABASE_TYPE_CONTENT_ITEM_TABLE, db);
}

static void
dino_database_content_item_table_class_init (DinoDatabaseContentItemTableClass * klass,
                                             gpointer klass_data)
{
	dino_database_content_item_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_content_item_table_finalize;
}

static void
dino_database_content_item_table_instance_init (DinoDatabaseContentItemTable * self,
                                                gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnLong* _tmp2_ = NULL;
	QliteColumnLong* _tmp3_ = NULL;
	QliteColumnInteger* _tmp4_ = NULL;
	QliteColumnInteger* _tmp5_ = NULL;
	gchar* _tmp6_;
	QliteColumnBoolInt* _tmp7_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("conversation_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->conversation_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_long_new ("time");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->time = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_long_new ("local_time");
	qlite_column_set_not_null ((QliteColumn*) _tmp3_, TRUE);
	self->local_time = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_integer_new ("content_type");
	qlite_column_set_not_null ((QliteColumn*) _tmp4_, TRUE);
	self->content_type = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_integer_new ("foreign_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp5_, TRUE);
	self->foreign_id = (QliteColumn*) _tmp5_;
	_tmp6_ = g_strdup ("0");
	_tmp7_ = qlite_column_bool_int_new ("hide");
	qlite_column_set_default ((QliteColumn*) _tmp7_, _tmp6_);
	_g_free0 (_tmp6_);
	qlite_column_set_not_null ((QliteColumn*) _tmp7_, TRUE);
	qlite_column_set_min_version ((QliteColumn*) _tmp7_, (glong) 9);
	self->hide = (QliteColumn*) _tmp7_;
}

static void
dino_database_content_item_table_finalize (QliteTable * obj)
{
	DinoDatabaseContentItemTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_CONTENT_ITEM_TABLE, DinoDatabaseContentItemTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->conversation_id);
	_qlite_column_unref0 (self->time);
	_qlite_column_unref0 (self->local_time);
	_qlite_column_unref0 (self->content_type);
	_qlite_column_unref0 (self->foreign_id);
	_qlite_column_unref0 (self->hide);
	QLITE_TABLE_CLASS (dino_database_content_item_table_parent_class)->finalize (obj);
}

static GType
dino_database_content_item_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseContentItemTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_content_item_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseContentItemTable), 0, (GInstanceInitFunc) dino_database_content_item_table_instance_init, NULL };
	GType dino_database_content_item_table_type_id;
	dino_database_content_item_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseContentItemTable", &g_define_type_info, 0);
	return dino_database_content_item_table_type_id;
}

GType
dino_database_content_item_table_get_type (void)
{
	static volatile gsize dino_database_content_item_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_content_item_table_type_id__once)) {
		GType dino_database_content_item_table_type_id;
		dino_database_content_item_table_type_id = dino_database_content_item_table_get_type_once ();
		g_once_init_leave (&dino_database_content_item_table_type_id__once, dino_database_content_item_table_type_id);
	}
	return dino_database_content_item_table_type_id__once;
}

DinoDatabaseMessageTable*
dino_database_message_table_construct (GType object_type,
                                       DinoDatabase* db)
{
	DinoDatabaseMessageTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn* _tmp20_;
	QliteColumn* _tmp21_;
	QliteColumn* _tmp22_;
	QliteColumn* _tmp23_;
	QliteColumn* _tmp24_;
	QliteColumn* _tmp25_;
	QliteColumn* _tmp26_;
	QliteColumn* _tmp27_;
	QliteColumn** _tmp28_;
	QliteColumn** _tmp29_;
	gint _tmp29__length1;
	QliteColumn* _tmp30_;
	QliteColumn* _tmp31_;
	QliteColumn* _tmp32_;
	QliteColumn* _tmp33_;
	QliteColumn* _tmp34_;
	QliteColumn* _tmp35_;
	QliteColumn** _tmp36_;
	QliteColumn** _tmp37_;
	gint _tmp37__length1;
	QliteColumn* _tmp38_;
	QliteColumn* _tmp39_;
	QliteColumn* _tmp40_;
	QliteColumn* _tmp41_;
	QliteColumn* _tmp42_;
	QliteColumn* _tmp43_;
	QliteColumn** _tmp44_;
	QliteColumn** _tmp45_;
	gint _tmp45__length1;
	QliteColumn* _tmp46_;
	QliteColumn* _tmp47_;
	QliteColumn* _tmp48_;
	QliteColumn* _tmp49_;
	QliteColumn* _tmp50_;
	QliteColumn* _tmp51_;
	QliteColumn** _tmp52_;
	QliteColumn** _tmp53_;
	gint _tmp53__length1;
	QliteColumn* _tmp54_;
	QliteColumn* _tmp55_;
	QliteColumn* _tmp56_;
	QliteColumn* _tmp57_;
	QliteColumn** _tmp58_;
	QliteColumn** _tmp59_;
	gint _tmp59__length1;
	QliteColumn* _tmp60_;
	QliteColumn* _tmp61_;
	QliteColumn** _tmp62_;
	QliteColumn** _tmp63_;
	gint _tmp63__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseMessageTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "message");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->stanza_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->server_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->account_id;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->counterpart_id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->our_resource;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->counterpart_resource;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->direction;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = self->type_;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->time;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = self->local_time;
	_tmp21_ = _qlite_column_ref0 (_tmp20_);
	_tmp22_ = self->body;
	_tmp23_ = _qlite_column_ref0 (_tmp22_);
	_tmp24_ = self->encryption;
	_tmp25_ = _qlite_column_ref0 (_tmp24_);
	_tmp26_ = self->marked;
	_tmp27_ = _qlite_column_ref0 (_tmp26_);
	_tmp28_ = g_new0 (QliteColumn*, 14 + 1);
	_tmp28_[0] = _tmp1_;
	_tmp28_[1] = _tmp3_;
	_tmp28_[2] = _tmp5_;
	_tmp28_[3] = _tmp7_;
	_tmp28_[4] = _tmp9_;
	_tmp28_[5] = _tmp11_;
	_tmp28_[6] = _tmp13_;
	_tmp28_[7] = _tmp15_;
	_tmp28_[8] = _tmp17_;
	_tmp28_[9] = _tmp19_;
	_tmp28_[10] = _tmp21_;
	_tmp28_[11] = _tmp23_;
	_tmp28_[12] = _tmp25_;
	_tmp28_[13] = _tmp27_;
	_tmp29_ = _tmp28_;
	_tmp29__length1 = 14;
	qlite_table_init ((QliteTable*) self, _tmp29_, (gint) 14, "");
	_tmp29_ = (_vala_array_free (_tmp29_, _tmp29__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp30_ = self->account_id;
	_tmp31_ = _qlite_column_ref0 (_tmp30_);
	_tmp32_ = self->counterpart_id;
	_tmp33_ = _qlite_column_ref0 (_tmp32_);
	_tmp34_ = self->time;
	_tmp35_ = _qlite_column_ref0 (_tmp34_);
	_tmp36_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp36_[0] = _tmp31_;
	_tmp36_[1] = _tmp33_;
	_tmp36_[2] = _tmp35_;
	_tmp37_ = _tmp36_;
	_tmp37__length1 = 3;
	qlite_table_index ((QliteTable*) self, "message_account_counterpart_time_idx", _tmp37_, (gint) 3, FALSE);
	_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp38_ = self->account_id;
	_tmp39_ = _qlite_column_ref0 (_tmp38_);
	_tmp40_ = self->counterpart_id;
	_tmp41_ = _qlite_column_ref0 (_tmp40_);
	_tmp42_ = self->stanza_id;
	_tmp43_ = _qlite_column_ref0 (_tmp42_);
	_tmp44_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp44_[0] = _tmp39_;
	_tmp44_[1] = _tmp41_;
	_tmp44_[2] = _tmp43_;
	_tmp45_ = _tmp44_;
	_tmp45__length1 = 3;
	qlite_table_index ((QliteTable*) self, "message_account_counterpart_stanzaid_idx", _tmp45_, (gint) 3, FALSE);
	_tmp45_ = (_vala_array_free (_tmp45_, _tmp45__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp46_ = self->account_id;
	_tmp47_ = _qlite_column_ref0 (_tmp46_);
	_tmp48_ = self->counterpart_id;
	_tmp49_ = _qlite_column_ref0 (_tmp48_);
	_tmp50_ = self->server_id;
	_tmp51_ = _qlite_column_ref0 (_tmp50_);
	_tmp52_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp52_[0] = _tmp47_;
	_tmp52_[1] = _tmp49_;
	_tmp52_[2] = _tmp51_;
	_tmp53_ = _tmp52_;
	_tmp53__length1 = 3;
	qlite_table_index ((QliteTable*) self, "message_account_counterpart_serverid_idx", _tmp53_, (gint) 3, FALSE);
	_tmp53_ = (_vala_array_free (_tmp53_, _tmp53__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp54_ = self->account_id;
	_tmp55_ = _qlite_column_ref0 (_tmp54_);
	_tmp56_ = self->marked;
	_tmp57_ = _qlite_column_ref0 (_tmp56_);
	_tmp58_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp58_[0] = _tmp55_;
	_tmp58_[1] = _tmp57_;
	_tmp59_ = _tmp58_;
	_tmp59__length1 = 2;
	qlite_table_index ((QliteTable*) self, "message_account_marked_idx", _tmp59_, (gint) 2, FALSE);
	_tmp59_ = (_vala_array_free (_tmp59_, _tmp59__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp60_ = self->body;
	_tmp61_ = _qlite_column_ref0 (_tmp60_);
	_tmp62_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp62_[0] = _tmp61_;
	_tmp63_ = _tmp62_;
	_tmp63__length1 = 1;
	qlite_table_fts ((QliteTable*) self, _tmp63_, (gint) 1);
	_tmp63_ = (_vala_array_free (_tmp63_, _tmp63__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseMessageTable*
dino_database_message_table_new (DinoDatabase* db)
{
	return dino_database_message_table_construct (DINO_DATABASE_TYPE_MESSAGE_TABLE, db);
}

static void
dino_database_message_table_class_init (DinoDatabaseMessageTableClass * klass,
                                        gpointer klass_data)
{
	dino_database_message_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_message_table_finalize;
}

static void
dino_database_message_table_instance_init (DinoDatabaseMessageTable * self,
                                           gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnText* _tmp1_;
	QliteColumnText* _tmp2_ = NULL;
	QliteColumnInteger* _tmp3_ = NULL;
	QliteColumnInteger* _tmp4_ = NULL;
	QliteColumnText* _tmp5_;
	QliteColumnText* _tmp6_;
	QliteColumnBoolInt* _tmp7_ = NULL;
	QliteColumnInteger* _tmp8_;
	QliteColumnLong* _tmp9_;
	QliteColumnLong* _tmp10_;
	QliteColumnText* _tmp11_;
	QliteColumnInteger* _tmp12_;
	QliteColumnInteger* _tmp13_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("stanza_id");
	self->stanza_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("server_id");
	qlite_column_set_min_version ((QliteColumn*) _tmp2_, (glong) 10);
	self->server_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp3_, TRUE);
	self->account_id = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_integer_new ("counterpart_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp4_, TRUE);
	self->counterpart_id = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_text_new ("counterpart_resource");
	self->counterpart_resource = (QliteColumn*) _tmp5_;
	_tmp6_ = qlite_column_text_new ("our_resource");
	self->our_resource = (QliteColumn*) _tmp6_;
	_tmp7_ = qlite_column_bool_int_new ("direction");
	qlite_column_set_not_null ((QliteColumn*) _tmp7_, TRUE);
	self->direction = (QliteColumn*) _tmp7_;
	_tmp8_ = qlite_column_integer_new ("type");
	self->type_ = (QliteColumn*) _tmp8_;
	_tmp9_ = qlite_column_long_new ("time");
	self->time = (QliteColumn*) _tmp9_;
	_tmp10_ = qlite_column_long_new ("local_time");
	self->local_time = (QliteColumn*) _tmp10_;
	_tmp11_ = qlite_column_text_new ("body");
	self->body = (QliteColumn*) _tmp11_;
	_tmp12_ = qlite_column_integer_new ("encryption");
	self->encryption = (QliteColumn*) _tmp12_;
	_tmp13_ = qlite_column_integer_new ("marked");
	self->marked = (QliteColumn*) _tmp13_;
}

static void
dino_database_message_table_finalize (QliteTable * obj)
{
	DinoDatabaseMessageTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_MESSAGE_TABLE, DinoDatabaseMessageTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->stanza_id);
	_qlite_column_unref0 (self->server_id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->counterpart_id);
	_qlite_column_unref0 (self->counterpart_resource);
	_qlite_column_unref0 (self->our_resource);
	_qlite_column_unref0 (self->direction);
	_qlite_column_unref0 (self->type_);
	_qlite_column_unref0 (self->time);
	_qlite_column_unref0 (self->local_time);
	_qlite_column_unref0 (self->body);
	_qlite_column_unref0 (self->encryption);
	_qlite_column_unref0 (self->marked);
	QLITE_TABLE_CLASS (dino_database_message_table_parent_class)->finalize (obj);
}

static GType
dino_database_message_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseMessageTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_message_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseMessageTable), 0, (GInstanceInitFunc) dino_database_message_table_instance_init, NULL };
	GType dino_database_message_table_type_id;
	dino_database_message_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseMessageTable", &g_define_type_info, 0);
	return dino_database_message_table_type_id;
}

GType
dino_database_message_table_get_type (void)
{
	static volatile gsize dino_database_message_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_message_table_type_id__once)) {
		GType dino_database_message_table_type_id;
		dino_database_message_table_type_id = dino_database_message_table_get_type_once ();
		g_once_init_leave (&dino_database_message_table_type_id__once, dino_database_message_table_type_id);
	}
	return dino_database_message_table_type_id__once;
}

DinoDatabaseBodyMeta*
dino_database_body_meta_construct (GType object_type,
                                   DinoDatabase* db)
{
	DinoDatabaseBodyMeta* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn** _tmp12_;
	QliteColumn** _tmp13_;
	gint _tmp13__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseBodyMeta*) qlite_table_construct (object_type, (QliteDatabase*) db, "body_meta");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->message_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->from_char;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->to_char;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->info_type;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->info;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = g_new0 (QliteColumn*, 6 + 1);
	_tmp12_[0] = _tmp1_;
	_tmp12_[1] = _tmp3_;
	_tmp12_[2] = _tmp5_;
	_tmp12_[3] = _tmp7_;
	_tmp12_[4] = _tmp9_;
	_tmp12_[5] = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp13__length1 = 6;
	qlite_table_init ((QliteTable*) self, _tmp13_, (gint) 6, "");
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseBodyMeta*
dino_database_body_meta_new (DinoDatabase* db)
{
	return dino_database_body_meta_construct (DINO_DATABASE_TYPE_BODY_META, db);
}

static void
dino_database_body_meta_class_init (DinoDatabaseBodyMetaClass * klass,
                                    gpointer klass_data)
{
	dino_database_body_meta_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_body_meta_finalize;
}

static void
dino_database_body_meta_instance_init (DinoDatabaseBodyMeta * self,
                                       gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_;
	QliteColumnInteger* _tmp2_;
	QliteColumnInteger* _tmp3_;
	QliteColumnText* _tmp4_;
	QliteColumnText* _tmp5_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("message_id");
	self->message_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("from_char");
	self->from_char = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("to_char");
	self->to_char = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("info_type");
	self->info_type = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_text_new ("info");
	self->info = (QliteColumn*) _tmp5_;
}

static void
dino_database_body_meta_finalize (QliteTable * obj)
{
	DinoDatabaseBodyMeta * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_BODY_META, DinoDatabaseBodyMeta);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->message_id);
	_qlite_column_unref0 (self->from_char);
	_qlite_column_unref0 (self->to_char);
	_qlite_column_unref0 (self->info_type);
	_qlite_column_unref0 (self->info);
	QLITE_TABLE_CLASS (dino_database_body_meta_parent_class)->finalize (obj);
}

static GType
dino_database_body_meta_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseBodyMetaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_body_meta_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseBodyMeta), 0, (GInstanceInitFunc) dino_database_body_meta_instance_init, NULL };
	GType dino_database_body_meta_type_id;
	dino_database_body_meta_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseBodyMeta", &g_define_type_info, 0);
	return dino_database_body_meta_type_id;
}

GType
dino_database_body_meta_get_type (void)
{
	static volatile gsize dino_database_body_meta_type_id__once = 0;
	if (g_once_init_enter (&dino_database_body_meta_type_id__once)) {
		GType dino_database_body_meta_type_id;
		dino_database_body_meta_type_id = dino_database_body_meta_get_type_once ();
		g_once_init_leave (&dino_database_body_meta_type_id__once, dino_database_body_meta_type_id);
	}
	return dino_database_body_meta_type_id__once;
}

DinoDatabaseMessageCorrectionTable*
dino_database_message_correction_table_construct (GType object_type,
                                                  DinoDatabase* db)
{
	DinoDatabaseMessageCorrectionTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn** _tmp6_;
	QliteColumn** _tmp7_;
	gint _tmp7__length1;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseMessageCorrectionTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "message_correction");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->message_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->to_stanza_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp6_[0] = _tmp1_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 3;
	qlite_table_init ((QliteTable*) self, _tmp7_, (gint) 3, "");
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp8_ = self->to_stanza_id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp10_[0] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 1;
	qlite_table_index ((QliteTable*) self, "message_correction_to_stanza_id_idx", _tmp11_, (gint) 1, FALSE);
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseMessageCorrectionTable*
dino_database_message_correction_table_new (DinoDatabase* db)
{
	return dino_database_message_correction_table_construct (DINO_DATABASE_TYPE_MESSAGE_CORRECTION_TABLE, db);
}

static void
dino_database_message_correction_table_class_init (DinoDatabaseMessageCorrectionTableClass * klass,
                                                   gpointer klass_data)
{
	dino_database_message_correction_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_message_correction_table_finalize;
}

static void
dino_database_message_correction_table_instance_init (DinoDatabaseMessageCorrectionTable * self,
                                                      gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnText* _tmp2_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("message_id");
	qlite_column_set_unique ((QliteColumn*) _tmp1_, TRUE);
	self->message_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("to_stanza_id");
	self->to_stanza_id = (QliteColumn*) _tmp2_;
}

static void
dino_database_message_correction_table_finalize (QliteTable * obj)
{
	DinoDatabaseMessageCorrectionTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_MESSAGE_CORRECTION_TABLE, DinoDatabaseMessageCorrectionTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->message_id);
	_qlite_column_unref0 (self->to_stanza_id);
	QLITE_TABLE_CLASS (dino_database_message_correction_table_parent_class)->finalize (obj);
}

static GType
dino_database_message_correction_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseMessageCorrectionTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_message_correction_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseMessageCorrectionTable), 0, (GInstanceInitFunc) dino_database_message_correction_table_instance_init, NULL };
	GType dino_database_message_correction_table_type_id;
	dino_database_message_correction_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseMessageCorrectionTable", &g_define_type_info, 0);
	return dino_database_message_correction_table_type_id;
}

GType
dino_database_message_correction_table_get_type (void)
{
	static volatile gsize dino_database_message_correction_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_message_correction_table_type_id__once)) {
		GType dino_database_message_correction_table_type_id;
		dino_database_message_correction_table_type_id = dino_database_message_correction_table_get_type_once ();
		g_once_init_leave (&dino_database_message_correction_table_type_id__once, dino_database_message_correction_table_type_id);
	}
	return dino_database_message_correction_table_type_id__once;
}

DinoDatabaseReplyTable*
dino_database_reply_table_construct (GType object_type,
                                     DinoDatabase* db)
{
	DinoDatabaseReplyTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn** _tmp14_;
	QliteColumn** _tmp15_;
	gint _tmp15__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseReplyTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "reply");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->message_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->quoted_content_item_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->quoted_message_stanza_id;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->quoted_message_from;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 5 + 1);
	_tmp10_[0] = _tmp1_;
	_tmp10_[1] = _tmp3_;
	_tmp10_[2] = _tmp5_;
	_tmp10_[3] = _tmp7_;
	_tmp10_[4] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 5;
	qlite_table_init ((QliteTable*) self, _tmp11_, (gint) 5, "");
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp12_ = self->quoted_message_stanza_id;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp14_[0] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 1;
	qlite_table_index ((QliteTable*) self, "reply_quoted_message_stanza_id", _tmp15_, (gint) 1, FALSE);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseReplyTable*
dino_database_reply_table_new (DinoDatabase* db)
{
	return dino_database_reply_table_construct (DINO_DATABASE_TYPE_REPLY_TABLE, db);
}

static void
dino_database_reply_table_class_init (DinoDatabaseReplyTableClass * klass,
                                      gpointer klass_data)
{
	dino_database_reply_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_reply_table_finalize;
}

static void
dino_database_reply_table_instance_init (DinoDatabaseReplyTable * self,
                                         gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnInteger* _tmp2_;
	QliteColumnText* _tmp3_;
	QliteColumnText* _tmp4_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("message_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	qlite_column_set_unique ((QliteColumn*) _tmp1_, TRUE);
	self->message_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("quoted_message_id");
	self->quoted_content_item_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("quoted_message_stanza_id");
	self->quoted_message_stanza_id = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("quoted_message_from");
	self->quoted_message_from = (QliteColumn*) _tmp4_;
}

static void
dino_database_reply_table_finalize (QliteTable * obj)
{
	DinoDatabaseReplyTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_REPLY_TABLE, DinoDatabaseReplyTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->message_id);
	_qlite_column_unref0 (self->quoted_content_item_id);
	_qlite_column_unref0 (self->quoted_message_stanza_id);
	_qlite_column_unref0 (self->quoted_message_from);
	QLITE_TABLE_CLASS (dino_database_reply_table_parent_class)->finalize (obj);
}

static GType
dino_database_reply_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseReplyTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_reply_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseReplyTable), 0, (GInstanceInitFunc) dino_database_reply_table_instance_init, NULL };
	GType dino_database_reply_table_type_id;
	dino_database_reply_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseReplyTable", &g_define_type_info, 0);
	return dino_database_reply_table_type_id;
}

GType
dino_database_reply_table_get_type (void)
{
	static volatile gsize dino_database_reply_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_reply_table_type_id__once)) {
		GType dino_database_reply_table_type_id;
		dino_database_reply_table_type_id = dino_database_reply_table_get_type_once ();
		g_once_init_leave (&dino_database_reply_table_type_id__once, dino_database_reply_table_type_id);
	}
	return dino_database_reply_table_type_id__once;
}

DinoDatabaseRealJidTable*
dino_database_real_jid_table_construct (GType object_type,
                                        DinoDatabase* db)
{
	DinoDatabaseRealJidTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn** _tmp4_;
	QliteColumn** _tmp5_;
	gint _tmp5__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseRealJidTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "real_jid");
	_tmp0_ = self->message_id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->real_jid;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 2;
	qlite_table_init ((QliteTable*) self, _tmp5_, (gint) 2, "");
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseRealJidTable*
dino_database_real_jid_table_new (DinoDatabase* db)
{
	return dino_database_real_jid_table_construct (DINO_DATABASE_TYPE_REAL_JID_TABLE, db);
}

static void
dino_database_real_jid_table_class_init (DinoDatabaseRealJidTableClass * klass,
                                         gpointer klass_data)
{
	dino_database_real_jid_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_real_jid_table_finalize;
}

static void
dino_database_real_jid_table_instance_init (DinoDatabaseRealJidTable * self,
                                            gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnText* _tmp1_;
	_tmp0_ = qlite_column_integer_new ("message_id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	self->message_id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("real_jid");
	self->real_jid = (QliteColumn*) _tmp1_;
}

static void
dino_database_real_jid_table_finalize (QliteTable * obj)
{
	DinoDatabaseRealJidTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_REAL_JID_TABLE, DinoDatabaseRealJidTable);
	_qlite_column_unref0 (self->message_id);
	_qlite_column_unref0 (self->real_jid);
	QLITE_TABLE_CLASS (dino_database_real_jid_table_parent_class)->finalize (obj);
}

static GType
dino_database_real_jid_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseRealJidTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_real_jid_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseRealJidTable), 0, (GInstanceInitFunc) dino_database_real_jid_table_instance_init, NULL };
	GType dino_database_real_jid_table_type_id;
	dino_database_real_jid_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseRealJidTable", &g_define_type_info, 0);
	return dino_database_real_jid_table_type_id;
}

GType
dino_database_real_jid_table_get_type (void)
{
	static volatile gsize dino_database_real_jid_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_real_jid_table_type_id__once)) {
		GType dino_database_real_jid_table_type_id;
		dino_database_real_jid_table_type_id = dino_database_real_jid_table_get_type_once ();
		g_once_init_leave (&dino_database_real_jid_table_type_id__once, dino_database_real_jid_table_type_id);
	}
	return dino_database_real_jid_table_type_id__once;
}

DinoDatabaseOccupantIdTable*
dino_database_occupant_id_table_construct (GType object_type,
                                           DinoDatabase* db)
{
	DinoDatabaseOccupantIdTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn** _tmp18_;
	QliteColumn** _tmp19_;
	gint _tmp19__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseOccupantIdTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "occupant_id");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->last_nick;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->jid_id;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->occupant_id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 5 + 1);
	_tmp10_[0] = _tmp1_;
	_tmp10_[1] = _tmp3_;
	_tmp10_[2] = _tmp5_;
	_tmp10_[3] = _tmp7_;
	_tmp10_[4] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 5;
	qlite_table_init ((QliteTable*) self, _tmp11_, (gint) 5, "");
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp12_ = self->account_id;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->jid_id;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = self->occupant_id;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp18_[0] = _tmp13_;
	_tmp18_[1] = _tmp15_;
	_tmp18_[2] = _tmp17_;
	_tmp19_ = _tmp18_;
	_tmp19__length1 = 3;
	qlite_table_unique ((QliteTable*) self, _tmp19_, (gint) 3, "REPLACE");
	_tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseOccupantIdTable*
dino_database_occupant_id_table_new (DinoDatabase* db)
{
	return dino_database_occupant_id_table_construct (DINO_DATABASE_TYPE_OCCUPANT_ID_TABLE, db);
}

static void
dino_database_occupant_id_table_class_init (DinoDatabaseOccupantIdTableClass * klass,
                                            gpointer klass_data)
{
	dino_database_occupant_id_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_occupant_id_table_finalize;
}

static void
dino_database_occupant_id_table_instance_init (DinoDatabaseOccupantIdTable * self,
                                               gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnText* _tmp2_;
	QliteColumnInteger* _tmp3_;
	QliteColumnText* _tmp4_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("last_nick");
	self->last_nick = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("jid_id");
	self->jid_id = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("occupant_id");
	self->occupant_id = (QliteColumn*) _tmp4_;
}

static void
dino_database_occupant_id_table_finalize (QliteTable * obj)
{
	DinoDatabaseOccupantIdTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_OCCUPANT_ID_TABLE, DinoDatabaseOccupantIdTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->last_nick);
	_qlite_column_unref0 (self->jid_id);
	_qlite_column_unref0 (self->occupant_id);
	QLITE_TABLE_CLASS (dino_database_occupant_id_table_parent_class)->finalize (obj);
}

static GType
dino_database_occupant_id_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseOccupantIdTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_occupant_id_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseOccupantIdTable), 0, (GInstanceInitFunc) dino_database_occupant_id_table_instance_init, NULL };
	GType dino_database_occupant_id_table_type_id;
	dino_database_occupant_id_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseOccupantIdTable", &g_define_type_info, 0);
	return dino_database_occupant_id_table_type_id;
}

GType
dino_database_occupant_id_table_get_type (void)
{
	static volatile gsize dino_database_occupant_id_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_occupant_id_table_type_id__once)) {
		GType dino_database_occupant_id_table_type_id;
		dino_database_occupant_id_table_type_id = dino_database_occupant_id_table_get_type_once ();
		g_once_init_leave (&dino_database_occupant_id_table_type_id__once, dino_database_occupant_id_table_type_id);
	}
	return dino_database_occupant_id_table_type_id__once;
}

DinoDatabaseUndecryptedTable*
dino_database_undecrypted_table_construct (GType object_type,
                                           DinoDatabase* db)
{
	DinoDatabaseUndecryptedTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn** _tmp6_;
	QliteColumn** _tmp7_;
	gint _tmp7__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseUndecryptedTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "undecrypted");
	_tmp0_ = self->message_id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->type_;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->data;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp6_[0] = _tmp1_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 3;
	qlite_table_init ((QliteTable*) self, _tmp7_, (gint) 3, "");
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseUndecryptedTable*
dino_database_undecrypted_table_new (DinoDatabase* db)
{
	return dino_database_undecrypted_table_construct (DINO_DATABASE_TYPE_UNDECRYPTED_TABLE, db);
}

static void
dino_database_undecrypted_table_class_init (DinoDatabaseUndecryptedTableClass * klass,
                                            gpointer klass_data)
{
	dino_database_undecrypted_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_undecrypted_table_finalize;
}

static void
dino_database_undecrypted_table_instance_init (DinoDatabaseUndecryptedTable * self,
                                               gpointer klass)
{
	QliteColumnInteger* _tmp0_;
	QliteColumnInteger* _tmp1_;
	QliteColumnText* _tmp2_;
	_tmp0_ = qlite_column_integer_new ("message_id");
	self->message_id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("type");
	self->type_ = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("data");
	self->data = (QliteColumn*) _tmp2_;
}

static void
dino_database_undecrypted_table_finalize (QliteTable * obj)
{
	DinoDatabaseUndecryptedTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_UNDECRYPTED_TABLE, DinoDatabaseUndecryptedTable);
	_qlite_column_unref0 (self->message_id);
	_qlite_column_unref0 (self->type_);
	_qlite_column_unref0 (self->data);
	QLITE_TABLE_CLASS (dino_database_undecrypted_table_parent_class)->finalize (obj);
}

static GType
dino_database_undecrypted_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseUndecryptedTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_undecrypted_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseUndecryptedTable), 0, (GInstanceInitFunc) dino_database_undecrypted_table_instance_init, NULL };
	GType dino_database_undecrypted_table_type_id;
	dino_database_undecrypted_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseUndecryptedTable", &g_define_type_info, 0);
	return dino_database_undecrypted_table_type_id;
}

GType
dino_database_undecrypted_table_get_type (void)
{
	static volatile gsize dino_database_undecrypted_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_undecrypted_table_type_id__once)) {
		GType dino_database_undecrypted_table_type_id;
		dino_database_undecrypted_table_type_id = dino_database_undecrypted_table_get_type_once ();
		g_once_init_leave (&dino_database_undecrypted_table_type_id__once, dino_database_undecrypted_table_type_id);
	}
	return dino_database_undecrypted_table_type_id__once;
}

DinoDatabaseFileTransferTable*
dino_database_file_transfer_table_construct (GType object_type,
                                             DinoDatabase* db)
{
	DinoDatabaseFileTransferTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn* _tmp20_;
	QliteColumn* _tmp21_;
	QliteColumn* _tmp22_;
	QliteColumn* _tmp23_;
	QliteColumn* _tmp24_;
	QliteColumn* _tmp25_;
	QliteColumn* _tmp26_;
	QliteColumn* _tmp27_;
	QliteColumn* _tmp28_;
	QliteColumn* _tmp29_;
	QliteColumn* _tmp30_;
	QliteColumn* _tmp31_;
	QliteColumn* _tmp32_;
	QliteColumn* _tmp33_;
	QliteColumn* _tmp34_;
	QliteColumn* _tmp35_;
	QliteColumn* _tmp36_;
	QliteColumn* _tmp37_;
	QliteColumn* _tmp38_;
	QliteColumn* _tmp39_;
	QliteColumn* _tmp40_;
	QliteColumn* _tmp41_;
	QliteColumn** _tmp42_;
	QliteColumn** _tmp43_;
	gint _tmp43__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseFileTransferTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "file_transfer");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->file_sharing_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->account_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->counterpart_id;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->counterpart_resource;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->our_resource;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->direction;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->time;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = self->local_time;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->encryption;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = self->file_name;
	_tmp21_ = _qlite_column_ref0 (_tmp20_);
	_tmp22_ = self->path;
	_tmp23_ = _qlite_column_ref0 (_tmp22_);
	_tmp24_ = self->mime_type;
	_tmp25_ = _qlite_column_ref0 (_tmp24_);
	_tmp26_ = self->size;
	_tmp27_ = _qlite_column_ref0 (_tmp26_);
	_tmp28_ = self->state;
	_tmp29_ = _qlite_column_ref0 (_tmp28_);
	_tmp30_ = self->provider;
	_tmp31_ = _qlite_column_ref0 (_tmp30_);
	_tmp32_ = self->info;
	_tmp33_ = _qlite_column_ref0 (_tmp32_);
	_tmp34_ = self->modification_date;
	_tmp35_ = _qlite_column_ref0 (_tmp34_);
	_tmp36_ = self->width;
	_tmp37_ = _qlite_column_ref0 (_tmp36_);
	_tmp38_ = self->height;
	_tmp39_ = _qlite_column_ref0 (_tmp38_);
	_tmp40_ = self->length;
	_tmp41_ = _qlite_column_ref0 (_tmp40_);
	_tmp42_ = g_new0 (QliteColumn*, 21 + 1);
	_tmp42_[0] = _tmp1_;
	_tmp42_[1] = _tmp3_;
	_tmp42_[2] = _tmp5_;
	_tmp42_[3] = _tmp7_;
	_tmp42_[4] = _tmp9_;
	_tmp42_[5] = _tmp11_;
	_tmp42_[6] = _tmp13_;
	_tmp42_[7] = _tmp15_;
	_tmp42_[8] = _tmp17_;
	_tmp42_[9] = _tmp19_;
	_tmp42_[10] = _tmp21_;
	_tmp42_[11] = _tmp23_;
	_tmp42_[12] = _tmp25_;
	_tmp42_[13] = _tmp27_;
	_tmp42_[14] = _tmp29_;
	_tmp42_[15] = _tmp31_;
	_tmp42_[16] = _tmp33_;
	_tmp42_[17] = _tmp35_;
	_tmp42_[18] = _tmp37_;
	_tmp42_[19] = _tmp39_;
	_tmp42_[20] = _tmp41_;
	_tmp43_ = _tmp42_;
	_tmp43__length1 = 21;
	qlite_table_init ((QliteTable*) self, _tmp43_, (gint) 21, "");
	_tmp43_ = (_vala_array_free (_tmp43_, _tmp43__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseFileTransferTable*
dino_database_file_transfer_table_new (DinoDatabase* db)
{
	return dino_database_file_transfer_table_construct (DINO_DATABASE_TYPE_FILE_TRANSFER_TABLE, db);
}

static void
dino_database_file_transfer_table_class_init (DinoDatabaseFileTransferTableClass * klass,
                                              gpointer klass_data)
{
	dino_database_file_transfer_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_file_transfer_table_finalize;
}

static void
dino_database_file_transfer_table_instance_init (DinoDatabaseFileTransferTable * self,
                                                 gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnText* _tmp1_ = NULL;
	QliteColumnInteger* _tmp2_ = NULL;
	QliteColumnInteger* _tmp3_ = NULL;
	QliteColumnText* _tmp4_;
	QliteColumnText* _tmp5_;
	QliteColumnBoolInt* _tmp6_ = NULL;
	QliteColumnLong* _tmp7_;
	QliteColumnLong* _tmp8_;
	QliteColumnInteger* _tmp9_;
	QliteColumnText* _tmp10_;
	QliteColumnText* _tmp11_;
	QliteColumnText* _tmp12_;
	QliteColumnLong* _tmp13_;
	QliteColumnInteger* _tmp14_;
	QliteColumnInteger* _tmp15_;
	QliteColumnText* _tmp16_;
	gchar* _tmp17_;
	QliteColumnLong* _tmp18_ = NULL;
	gchar* _tmp19_;
	QliteColumnInteger* _tmp20_ = NULL;
	gchar* _tmp21_;
	QliteColumnInteger* _tmp22_ = NULL;
	gchar* _tmp23_;
	QliteColumnInteger* _tmp24_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("file_sharing_id");
	qlite_column_set_min_version ((QliteColumn*) _tmp1_, (glong) 28);
	self->file_sharing_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->account_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("counterpart_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp3_, TRUE);
	self->counterpart_id = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("counterpart_resource");
	self->counterpart_resource = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_text_new ("our_resource");
	self->our_resource = (QliteColumn*) _tmp5_;
	_tmp6_ = qlite_column_bool_int_new ("direction");
	qlite_column_set_not_null ((QliteColumn*) _tmp6_, TRUE);
	self->direction = (QliteColumn*) _tmp6_;
	_tmp7_ = qlite_column_long_new ("time");
	self->time = (QliteColumn*) _tmp7_;
	_tmp8_ = qlite_column_long_new ("local_time");
	self->local_time = (QliteColumn*) _tmp8_;
	_tmp9_ = qlite_column_integer_new ("encryption");
	self->encryption = (QliteColumn*) _tmp9_;
	_tmp10_ = qlite_column_text_new ("file_name");
	self->file_name = (QliteColumn*) _tmp10_;
	_tmp11_ = qlite_column_text_new ("path");
	self->path = (QliteColumn*) _tmp11_;
	_tmp12_ = qlite_column_text_new ("mime_type");
	self->mime_type = (QliteColumn*) _tmp12_;
	_tmp13_ = qlite_column_long_new ("size");
	self->size = (QliteColumn*) _tmp13_;
	_tmp14_ = qlite_column_integer_new ("state");
	self->state = (QliteColumn*) _tmp14_;
	_tmp15_ = qlite_column_integer_new ("provider");
	self->provider = (QliteColumn*) _tmp15_;
	_tmp16_ = qlite_column_text_new ("info");
	self->info = (QliteColumn*) _tmp16_;
	_tmp17_ = g_strdup ("-1");
	_tmp18_ = qlite_column_long_new ("modification_date");
	qlite_column_set_default ((QliteColumn*) _tmp18_, _tmp17_);
	_g_free0 (_tmp17_);
	qlite_column_set_min_version ((QliteColumn*) _tmp18_, (glong) 28);
	self->modification_date = (QliteColumn*) _tmp18_;
	_tmp19_ = g_strdup ("-1");
	_tmp20_ = qlite_column_integer_new ("width");
	qlite_column_set_default ((QliteColumn*) _tmp20_, _tmp19_);
	_g_free0 (_tmp19_);
	qlite_column_set_min_version ((QliteColumn*) _tmp20_, (glong) 28);
	self->width = (QliteColumn*) _tmp20_;
	_tmp21_ = g_strdup ("-1");
	_tmp22_ = qlite_column_integer_new ("height");
	qlite_column_set_default ((QliteColumn*) _tmp22_, _tmp21_);
	_g_free0 (_tmp21_);
	qlite_column_set_min_version ((QliteColumn*) _tmp22_, (glong) 28);
	self->height = (QliteColumn*) _tmp22_;
	_tmp23_ = g_strdup ("-1");
	_tmp24_ = qlite_column_integer_new ("length");
	qlite_column_set_default ((QliteColumn*) _tmp24_, _tmp23_);
	_g_free0 (_tmp23_);
	qlite_column_set_min_version ((QliteColumn*) _tmp24_, (glong) 28);
	self->length = (QliteColumn*) _tmp24_;
}

static void
dino_database_file_transfer_table_finalize (QliteTable * obj)
{
	DinoDatabaseFileTransferTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_FILE_TRANSFER_TABLE, DinoDatabaseFileTransferTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->file_sharing_id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->counterpart_id);
	_qlite_column_unref0 (self->counterpart_resource);
	_qlite_column_unref0 (self->our_resource);
	_qlite_column_unref0 (self->direction);
	_qlite_column_unref0 (self->time);
	_qlite_column_unref0 (self->local_time);
	_qlite_column_unref0 (self->encryption);
	_qlite_column_unref0 (self->file_name);
	_qlite_column_unref0 (self->path);
	_qlite_column_unref0 (self->mime_type);
	_qlite_column_unref0 (self->size);
	_qlite_column_unref0 (self->state);
	_qlite_column_unref0 (self->provider);
	_qlite_column_unref0 (self->info);
	_qlite_column_unref0 (self->modification_date);
	_qlite_column_unref0 (self->width);
	_qlite_column_unref0 (self->height);
	_qlite_column_unref0 (self->length);
	QLITE_TABLE_CLASS (dino_database_file_transfer_table_parent_class)->finalize (obj);
}

static GType
dino_database_file_transfer_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseFileTransferTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_file_transfer_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseFileTransferTable), 0, (GInstanceInitFunc) dino_database_file_transfer_table_instance_init, NULL };
	GType dino_database_file_transfer_table_type_id;
	dino_database_file_transfer_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseFileTransferTable", &g_define_type_info, 0);
	return dino_database_file_transfer_table_type_id;
}

GType
dino_database_file_transfer_table_get_type (void)
{
	static volatile gsize dino_database_file_transfer_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_file_transfer_table_type_id__once)) {
		GType dino_database_file_transfer_table_type_id;
		dino_database_file_transfer_table_type_id = dino_database_file_transfer_table_get_type_once ();
		g_once_init_leave (&dino_database_file_transfer_table_type_id__once, dino_database_file_transfer_table_type_id);
	}
	return dino_database_file_transfer_table_type_id__once;
}

DinoDatabaseFileHashesTable*
dino_database_file_hashes_table_construct (GType object_type,
                                           DinoDatabase* db)
{
	DinoDatabaseFileHashesTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn** _tmp6_;
	QliteColumn** _tmp7_;
	gint _tmp7__length1;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn** _tmp12_;
	QliteColumn** _tmp13_;
	gint _tmp13__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseFileHashesTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "file_hashes");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->algo;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->value;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp6_[0] = _tmp1_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 3;
	qlite_table_init ((QliteTable*) self, _tmp7_, (gint) 3, "");
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp8_ = self->id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->algo;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp12_[0] = _tmp9_;
	_tmp12_[1] = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp13__length1 = 2;
	qlite_table_unique ((QliteTable*) self, _tmp13_, (gint) 2, "REPLACE");
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseFileHashesTable*
dino_database_file_hashes_table_new (DinoDatabase* db)
{
	return dino_database_file_hashes_table_construct (DINO_DATABASE_TYPE_FILE_HASHES_TABLE, db);
}

static void
dino_database_file_hashes_table_class_init (DinoDatabaseFileHashesTableClass * klass,
                                            gpointer klass_data)
{
	dino_database_file_hashes_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_file_hashes_table_finalize;
}

static void
dino_database_file_hashes_table_instance_init (DinoDatabaseFileHashesTable * self,
                                               gpointer klass)
{
	QliteColumnInteger* _tmp0_;
	QliteColumnText* _tmp1_ = NULL;
	QliteColumnText* _tmp2_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("algo");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->algo = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("value");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->value = (QliteColumn*) _tmp2_;
}

static void
dino_database_file_hashes_table_finalize (QliteTable * obj)
{
	DinoDatabaseFileHashesTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_FILE_HASHES_TABLE, DinoDatabaseFileHashesTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->algo);
	_qlite_column_unref0 (self->value);
	QLITE_TABLE_CLASS (dino_database_file_hashes_table_parent_class)->finalize (obj);
}

static GType
dino_database_file_hashes_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseFileHashesTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_file_hashes_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseFileHashesTable), 0, (GInstanceInitFunc) dino_database_file_hashes_table_instance_init, NULL };
	GType dino_database_file_hashes_table_type_id;
	dino_database_file_hashes_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseFileHashesTable", &g_define_type_info, 0);
	return dino_database_file_hashes_table_type_id;
}

GType
dino_database_file_hashes_table_get_type (void)
{
	static volatile gsize dino_database_file_hashes_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_file_hashes_table_type_id__once)) {
		GType dino_database_file_hashes_table_type_id;
		dino_database_file_hashes_table_type_id = dino_database_file_hashes_table_get_type_once ();
		g_once_init_leave (&dino_database_file_hashes_table_type_id__once, dino_database_file_hashes_table_type_id);
	}
	return dino_database_file_hashes_table_type_id__once;
}

DinoDatabaseFileThumbnailsTable*
dino_database_file_thumbnails_table_construct (GType object_type,
                                               DinoDatabase* db)
{
	DinoDatabaseFileThumbnailsTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseFileThumbnailsTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "file_thumbnails");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->uri;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->mime_type;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->width;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->height;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 5 + 1);
	_tmp10_[0] = _tmp1_;
	_tmp10_[1] = _tmp3_;
	_tmp10_[2] = _tmp5_;
	_tmp10_[3] = _tmp7_;
	_tmp10_[4] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 5;
	qlite_table_init ((QliteTable*) self, _tmp11_, (gint) 5, "");
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseFileThumbnailsTable*
dino_database_file_thumbnails_table_new (DinoDatabase* db)
{
	return dino_database_file_thumbnails_table_construct (DINO_DATABASE_TYPE_FILE_THUMBNAILS_TABLE, db);
}

static void
dino_database_file_thumbnails_table_class_init (DinoDatabaseFileThumbnailsTableClass * klass,
                                                gpointer klass_data)
{
	dino_database_file_thumbnails_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_file_thumbnails_table_finalize;
}

static void
dino_database_file_thumbnails_table_instance_init (DinoDatabaseFileThumbnailsTable * self,
                                                   gpointer klass)
{
	QliteColumnInteger* _tmp0_;
	QliteColumnText* _tmp1_ = NULL;
	QliteColumnText* _tmp2_;
	QliteColumnInteger* _tmp3_;
	QliteColumnInteger* _tmp4_;
	_tmp0_ = qlite_column_integer_new ("id");
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("uri");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->uri = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("mime_type");
	self->mime_type = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("width");
	self->width = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_integer_new ("height");
	self->height = (QliteColumn*) _tmp4_;
}

static void
dino_database_file_thumbnails_table_finalize (QliteTable * obj)
{
	DinoDatabaseFileThumbnailsTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_FILE_THUMBNAILS_TABLE, DinoDatabaseFileThumbnailsTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->uri);
	_qlite_column_unref0 (self->mime_type);
	_qlite_column_unref0 (self->width);
	_qlite_column_unref0 (self->height);
	QLITE_TABLE_CLASS (dino_database_file_thumbnails_table_parent_class)->finalize (obj);
}

static GType
dino_database_file_thumbnails_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseFileThumbnailsTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_file_thumbnails_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseFileThumbnailsTable), 0, (GInstanceInitFunc) dino_database_file_thumbnails_table_instance_init, NULL };
	GType dino_database_file_thumbnails_table_type_id;
	dino_database_file_thumbnails_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseFileThumbnailsTable", &g_define_type_info, 0);
	return dino_database_file_thumbnails_table_type_id;
}

GType
dino_database_file_thumbnails_table_get_type (void)
{
	static volatile gsize dino_database_file_thumbnails_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_file_thumbnails_table_type_id__once)) {
		GType dino_database_file_thumbnails_table_type_id;
		dino_database_file_thumbnails_table_type_id = dino_database_file_thumbnails_table_get_type_once ();
		g_once_init_leave (&dino_database_file_thumbnails_table_type_id__once, dino_database_file_thumbnails_table_type_id);
	}
	return dino_database_file_thumbnails_table_type_id__once;
}

DinoDatabaseSourcesTable*
dino_database_sources_table_construct (GType object_type,
                                       DinoDatabase* db)
{
	DinoDatabaseSourcesTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn** _tmp6_;
	QliteColumn** _tmp7_;
	gint _tmp7__length1;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseSourcesTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "sfs_sources");
	_tmp0_ = self->file_transfer_id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->type;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->data;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp6_[0] = _tmp1_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 3;
	qlite_table_init ((QliteTable*) self, _tmp7_, (gint) 3, "");
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp8_ = self->file_transfer_id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp10_[0] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 1;
	qlite_table_index ((QliteTable*) self, "sfs_sources_file_transfer_id_idx", _tmp11_, (gint) 1, FALSE);
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseSourcesTable*
dino_database_sources_table_new (DinoDatabase* db)
{
	return dino_database_sources_table_construct (DINO_DATABASE_TYPE_SOURCES_TABLE, db);
}

static void
dino_database_sources_table_class_init (DinoDatabaseSourcesTableClass * klass,
                                        gpointer klass_data)
{
	dino_database_sources_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_sources_table_finalize;
}

static void
dino_database_sources_table_instance_init (DinoDatabaseSourcesTable * self,
                                           gpointer klass)
{
	QliteColumnInteger* _tmp0_;
	QliteColumnText* _tmp1_ = NULL;
	QliteColumnText* _tmp2_ = NULL;
	_tmp0_ = qlite_column_integer_new ("file_transfer_id");
	self->file_transfer_id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("type");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->type = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("data");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->data = (QliteColumn*) _tmp2_;
}

static void
dino_database_sources_table_finalize (QliteTable * obj)
{
	DinoDatabaseSourcesTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_SOURCES_TABLE, DinoDatabaseSourcesTable);
	_qlite_column_unref0 (self->file_transfer_id);
	_qlite_column_unref0 (self->type);
	_qlite_column_unref0 (self->data);
	QLITE_TABLE_CLASS (dino_database_sources_table_parent_class)->finalize (obj);
}

static GType
dino_database_sources_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseSourcesTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_sources_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseSourcesTable), 0, (GInstanceInitFunc) dino_database_sources_table_instance_init, NULL };
	GType dino_database_sources_table_type_id;
	dino_database_sources_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseSourcesTable", &g_define_type_info, 0);
	return dino_database_sources_table_type_id;
}

GType
dino_database_sources_table_get_type (void)
{
	static volatile gsize dino_database_sources_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_sources_table_type_id__once)) {
		GType dino_database_sources_table_type_id;
		dino_database_sources_table_type_id = dino_database_sources_table_get_type_once ();
		g_once_init_leave (&dino_database_sources_table_type_id__once, dino_database_sources_table_type_id);
	}
	return dino_database_sources_table_type_id__once;
}

DinoDatabaseCallTable*
dino_database_call_table_construct (GType object_type,
                                    DinoDatabase* db)
{
	DinoDatabaseCallTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn* _tmp20_;
	QliteColumn* _tmp21_;
	QliteColumn** _tmp22_;
	QliteColumn** _tmp23_;
	gint _tmp23__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseCallTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "call");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->counterpart_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->counterpart_resource;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->our_resource;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->direction;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->time;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->local_time;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = self->end_time;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->encryption;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = self->state;
	_tmp21_ = _qlite_column_ref0 (_tmp20_);
	_tmp22_ = g_new0 (QliteColumn*, 11 + 1);
	_tmp22_[0] = _tmp1_;
	_tmp22_[1] = _tmp3_;
	_tmp22_[2] = _tmp5_;
	_tmp22_[3] = _tmp7_;
	_tmp22_[4] = _tmp9_;
	_tmp22_[5] = _tmp11_;
	_tmp22_[6] = _tmp13_;
	_tmp22_[7] = _tmp15_;
	_tmp22_[8] = _tmp17_;
	_tmp22_[9] = _tmp19_;
	_tmp22_[10] = _tmp21_;
	_tmp23_ = _tmp22_;
	_tmp23__length1 = 11;
	qlite_table_init ((QliteTable*) self, _tmp23_, (gint) 11, "");
	_tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseCallTable*
dino_database_call_table_new (DinoDatabase* db)
{
	return dino_database_call_table_construct (DINO_DATABASE_TYPE_CALL_TABLE, db);
}

static void
dino_database_call_table_class_init (DinoDatabaseCallTableClass * klass,
                                     gpointer klass_data)
{
	dino_database_call_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_call_table_finalize;
}

static void
dino_database_call_table_instance_init (DinoDatabaseCallTable * self,
                                        gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnInteger* _tmp2_ = NULL;
	QliteColumnText* _tmp3_;
	QliteColumnText* _tmp4_;
	QliteColumnBoolInt* _tmp5_ = NULL;
	QliteColumnLong* _tmp6_ = NULL;
	QliteColumnLong* _tmp7_ = NULL;
	QliteColumnLong* _tmp8_;
	QliteColumnInteger* _tmp9_ = NULL;
	QliteColumnInteger* _tmp10_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("counterpart_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->counterpart_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("counterpart_resource");
	self->counterpart_resource = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("our_resource");
	self->our_resource = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_bool_int_new ("direction");
	qlite_column_set_not_null ((QliteColumn*) _tmp5_, TRUE);
	self->direction = (QliteColumn*) _tmp5_;
	_tmp6_ = qlite_column_long_new ("time");
	qlite_column_set_not_null ((QliteColumn*) _tmp6_, TRUE);
	self->time = (QliteColumn*) _tmp6_;
	_tmp7_ = qlite_column_long_new ("local_time");
	qlite_column_set_not_null ((QliteColumn*) _tmp7_, TRUE);
	self->local_time = (QliteColumn*) _tmp7_;
	_tmp8_ = qlite_column_long_new ("end_time");
	self->end_time = (QliteColumn*) _tmp8_;
	_tmp9_ = qlite_column_integer_new ("encryption");
	qlite_column_set_min_version ((QliteColumn*) _tmp9_, (glong) 21);
	self->encryption = (QliteColumn*) _tmp9_;
	_tmp10_ = qlite_column_integer_new ("state");
	self->state = (QliteColumn*) _tmp10_;
}

static void
dino_database_call_table_finalize (QliteTable * obj)
{
	DinoDatabaseCallTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_CALL_TABLE, DinoDatabaseCallTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->counterpart_id);
	_qlite_column_unref0 (self->counterpart_resource);
	_qlite_column_unref0 (self->our_resource);
	_qlite_column_unref0 (self->direction);
	_qlite_column_unref0 (self->time);
	_qlite_column_unref0 (self->local_time);
	_qlite_column_unref0 (self->end_time);
	_qlite_column_unref0 (self->encryption);
	_qlite_column_unref0 (self->state);
	QLITE_TABLE_CLASS (dino_database_call_table_parent_class)->finalize (obj);
}

static GType
dino_database_call_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseCallTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_call_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseCallTable), 0, (GInstanceInitFunc) dino_database_call_table_instance_init, NULL };
	GType dino_database_call_table_type_id;
	dino_database_call_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseCallTable", &g_define_type_info, 0);
	return dino_database_call_table_type_id;
}

GType
dino_database_call_table_get_type (void)
{
	static volatile gsize dino_database_call_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_call_table_type_id__once)) {
		GType dino_database_call_table_type_id;
		dino_database_call_table_type_id = dino_database_call_table_get_type_once ();
		g_once_init_leave (&dino_database_call_table_type_id__once, dino_database_call_table_type_id);
	}
	return dino_database_call_table_type_id__once;
}

DinoDatabaseCallCounterpartTable*
dino_database_call_counterpart_table_construct (GType object_type,
                                                DinoDatabase* db)
{
	DinoDatabaseCallCounterpartTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn** _tmp6_;
	QliteColumn** _tmp7_;
	gint _tmp7__length1;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseCallCounterpartTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "call_counterpart");
	_tmp0_ = self->call_id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->jid_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->resource;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp6_[0] = _tmp1_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 3;
	qlite_table_init ((QliteTable*) self, _tmp7_, (gint) 3, "");
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp8_ = self->call_id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp10_[0] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 1;
	qlite_table_index ((QliteTable*) self, "call_counterpart_call_jid_idx", _tmp11_, (gint) 1, FALSE);
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseCallCounterpartTable*
dino_database_call_counterpart_table_new (DinoDatabase* db)
{
	return dino_database_call_counterpart_table_construct (DINO_DATABASE_TYPE_CALL_COUNTERPART_TABLE, db);
}

static void
dino_database_call_counterpart_table_class_init (DinoDatabaseCallCounterpartTableClass * klass,
                                                 gpointer klass_data)
{
	dino_database_call_counterpart_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_call_counterpart_table_finalize;
}

static void
dino_database_call_counterpart_table_instance_init (DinoDatabaseCallCounterpartTable * self,
                                                    gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnInteger* _tmp2_ = NULL;
	QliteColumnText* _tmp3_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("call_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->call_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("jid_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->jid_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("resource");
	self->resource = (QliteColumn*) _tmp3_;
}

static void
dino_database_call_counterpart_table_finalize (QliteTable * obj)
{
	DinoDatabaseCallCounterpartTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_CALL_COUNTERPART_TABLE, DinoDatabaseCallCounterpartTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->call_id);
	_qlite_column_unref0 (self->jid_id);
	_qlite_column_unref0 (self->resource);
	QLITE_TABLE_CLASS (dino_database_call_counterpart_table_parent_class)->finalize (obj);
}

static GType
dino_database_call_counterpart_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseCallCounterpartTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_call_counterpart_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseCallCounterpartTable), 0, (GInstanceInitFunc) dino_database_call_counterpart_table_instance_init, NULL };
	GType dino_database_call_counterpart_table_type_id;
	dino_database_call_counterpart_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseCallCounterpartTable", &g_define_type_info, 0);
	return dino_database_call_counterpart_table_type_id;
}

GType
dino_database_call_counterpart_table_get_type (void)
{
	static volatile gsize dino_database_call_counterpart_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_call_counterpart_table_type_id__once)) {
		GType dino_database_call_counterpart_table_type_id;
		dino_database_call_counterpart_table_type_id = dino_database_call_counterpart_table_get_type_once ();
		g_once_init_leave (&dino_database_call_counterpart_table_type_id__once, dino_database_call_counterpart_table_type_id);
	}
	return dino_database_call_counterpart_table_type_id__once;
}

DinoDatabaseConversationTable*
dino_database_conversation_table_construct (GType object_type,
                                            DinoDatabase* db)
{
	DinoDatabaseConversationTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn* _tmp20_;
	QliteColumn* _tmp21_;
	QliteColumn* _tmp22_;
	QliteColumn* _tmp23_;
	QliteColumn* _tmp24_;
	QliteColumn* _tmp25_;
	QliteColumn* _tmp26_;
	QliteColumn* _tmp27_;
	QliteColumn* _tmp28_;
	QliteColumn* _tmp29_;
	QliteColumn** _tmp30_;
	QliteColumn** _tmp31_;
	gint _tmp31__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseConversationTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "conversation");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->jid_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->resource;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->active;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->active_last_changed;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->last_active;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->type_;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = self->encryption;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->read_up_to;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = self->read_up_to_item;
	_tmp21_ = _qlite_column_ref0 (_tmp20_);
	_tmp22_ = self->notification;
	_tmp23_ = _qlite_column_ref0 (_tmp22_);
	_tmp24_ = self->send_typing;
	_tmp25_ = _qlite_column_ref0 (_tmp24_);
	_tmp26_ = self->send_marker;
	_tmp27_ = _qlite_column_ref0 (_tmp26_);
	_tmp28_ = self->pinned;
	_tmp29_ = _qlite_column_ref0 (_tmp28_);
	_tmp30_ = g_new0 (QliteColumn*, 15 + 1);
	_tmp30_[0] = _tmp1_;
	_tmp30_[1] = _tmp3_;
	_tmp30_[2] = _tmp5_;
	_tmp30_[3] = _tmp7_;
	_tmp30_[4] = _tmp9_;
	_tmp30_[5] = _tmp11_;
	_tmp30_[6] = _tmp13_;
	_tmp30_[7] = _tmp15_;
	_tmp30_[8] = _tmp17_;
	_tmp30_[9] = _tmp19_;
	_tmp30_[10] = _tmp21_;
	_tmp30_[11] = _tmp23_;
	_tmp30_[12] = _tmp25_;
	_tmp30_[13] = _tmp27_;
	_tmp30_[14] = _tmp29_;
	_tmp31_ = _tmp30_;
	_tmp31__length1 = 15;
	qlite_table_init ((QliteTable*) self, _tmp31_, (gint) 15, "");
	_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseConversationTable*
dino_database_conversation_table_new (DinoDatabase* db)
{
	return dino_database_conversation_table_construct (DINO_DATABASE_TYPE_CONVERSATION_TABLE, db);
}

static void
dino_database_conversation_table_class_init (DinoDatabaseConversationTableClass * klass,
                                             gpointer klass_data)
{
	dino_database_conversation_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_conversation_table_finalize;
}

static void
dino_database_conversation_table_instance_init (DinoDatabaseConversationTable * self,
                                                gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnInteger* _tmp2_ = NULL;
	QliteColumnText* _tmp3_ = NULL;
	QliteColumnBoolInt* _tmp4_;
	gchar* _tmp5_;
	QliteColumnInteger* _tmp6_ = NULL;
	QliteColumnLong* _tmp7_;
	QliteColumnInteger* _tmp8_;
	QliteColumnInteger* _tmp9_;
	QliteColumnInteger* _tmp10_;
	gchar* _tmp11_;
	QliteColumnInteger* _tmp12_ = NULL;
	QliteColumnInteger* _tmp13_ = NULL;
	QliteColumnInteger* _tmp14_ = NULL;
	QliteColumnInteger* _tmp15_ = NULL;
	gchar* _tmp16_;
	QliteColumnInteger* _tmp17_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("jid_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->jid_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("resource");
	qlite_column_set_min_version ((QliteColumn*) _tmp3_, (glong) 1);
	self->resource = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_bool_int_new ("active");
	self->active = (QliteColumn*) _tmp4_;
	_tmp5_ = g_strdup ("0");
	_tmp6_ = qlite_column_integer_new ("active_last_changed");
	qlite_column_set_not_null ((QliteColumn*) _tmp6_, TRUE);
	qlite_column_set_default ((QliteColumn*) _tmp6_, _tmp5_);
	_g_free0 (_tmp5_);
	qlite_column_set_min_version ((QliteColumn*) _tmp6_, (glong) 23);
	self->active_last_changed = (QliteColumn*) _tmp6_;
	_tmp7_ = qlite_column_long_new ("last_active");
	self->last_active = (QliteColumn*) _tmp7_;
	_tmp8_ = qlite_column_integer_new ("type");
	self->type_ = (QliteColumn*) _tmp8_;
	_tmp9_ = qlite_column_integer_new ("encryption");
	self->encryption = (QliteColumn*) _tmp9_;
	_tmp10_ = qlite_column_integer_new ("read_up_to");
	self->read_up_to = (QliteColumn*) _tmp10_;
	_tmp11_ = g_strdup ("-1");
	_tmp12_ = qlite_column_integer_new ("read_up_to_item");
	qlite_column_set_not_null ((QliteColumn*) _tmp12_, TRUE);
	qlite_column_set_default ((QliteColumn*) _tmp12_, _tmp11_);
	_g_free0 (_tmp11_);
	qlite_column_set_min_version ((QliteColumn*) _tmp12_, (glong) 15);
	self->read_up_to_item = (QliteColumn*) _tmp12_;
	_tmp13_ = qlite_column_integer_new ("notification");
	qlite_column_set_min_version ((QliteColumn*) _tmp13_, (glong) 3);
	self->notification = (QliteColumn*) _tmp13_;
	_tmp14_ = qlite_column_integer_new ("send_typing");
	qlite_column_set_min_version ((QliteColumn*) _tmp14_, (glong) 3);
	self->send_typing = (QliteColumn*) _tmp14_;
	_tmp15_ = qlite_column_integer_new ("send_marker");
	qlite_column_set_min_version ((QliteColumn*) _tmp15_, (glong) 3);
	self->send_marker = (QliteColumn*) _tmp15_;
	_tmp16_ = g_strdup ("0");
	_tmp17_ = qlite_column_integer_new ("pinned");
	qlite_column_set_default ((QliteColumn*) _tmp17_, _tmp16_);
	_g_free0 (_tmp16_);
	qlite_column_set_min_version ((QliteColumn*) _tmp17_, (glong) 25);
	self->pinned = (QliteColumn*) _tmp17_;
}

static void
dino_database_conversation_table_finalize (QliteTable * obj)
{
	DinoDatabaseConversationTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_CONVERSATION_TABLE, DinoDatabaseConversationTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->jid_id);
	_qlite_column_unref0 (self->resource);
	_qlite_column_unref0 (self->active);
	_qlite_column_unref0 (self->active_last_changed);
	_qlite_column_unref0 (self->last_active);
	_qlite_column_unref0 (self->type_);
	_qlite_column_unref0 (self->encryption);
	_qlite_column_unref0 (self->read_up_to);
	_qlite_column_unref0 (self->read_up_to_item);
	_qlite_column_unref0 (self->notification);
	_qlite_column_unref0 (self->send_typing);
	_qlite_column_unref0 (self->send_marker);
	_qlite_column_unref0 (self->pinned);
	QLITE_TABLE_CLASS (dino_database_conversation_table_parent_class)->finalize (obj);
}

static GType
dino_database_conversation_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseConversationTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_conversation_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseConversationTable), 0, (GInstanceInitFunc) dino_database_conversation_table_instance_init, NULL };
	GType dino_database_conversation_table_type_id;
	dino_database_conversation_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseConversationTable", &g_define_type_info, 0);
	return dino_database_conversation_table_type_id;
}

GType
dino_database_conversation_table_get_type (void)
{
	static volatile gsize dino_database_conversation_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_conversation_table_type_id__once)) {
		GType dino_database_conversation_table_type_id;
		dino_database_conversation_table_type_id = dino_database_conversation_table_get_type_once ();
		g_once_init_leave (&dino_database_conversation_table_type_id__once, dino_database_conversation_table_type_id);
	}
	return dino_database_conversation_table_type_id__once;
}

DinoDatabaseAvatarTable*
dino_database_avatar_table_construct (GType object_type,
                                      DinoDatabase* db)
{
	DinoDatabaseAvatarTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn** _tmp8_;
	QliteColumn** _tmp9_;
	gint _tmp9__length1;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn** _tmp16_;
	QliteColumn** _tmp17_;
	gint _tmp17__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseAvatarTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "contact_avatar");
	_tmp0_ = self->jid_id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->hash;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->type_;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = g_new0 (QliteColumn*, 4 + 1);
	_tmp8_[0] = _tmp1_;
	_tmp8_[1] = _tmp3_;
	_tmp8_[2] = _tmp5_;
	_tmp8_[3] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 4;
	qlite_table_init ((QliteTable*) self, _tmp9_, (gint) 4, "");
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp10_ = self->jid_id;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->account_id;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->type_;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp16_[0] = _tmp11_;
	_tmp16_[1] = _tmp13_;
	_tmp16_[2] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 3;
	qlite_table_unique ((QliteTable*) self, _tmp17_, (gint) 3, "REPLACE");
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseAvatarTable*
dino_database_avatar_table_new (DinoDatabase* db)
{
	return dino_database_avatar_table_construct (DINO_DATABASE_TYPE_AVATAR_TABLE, db);
}

static void
dino_database_avatar_table_class_init (DinoDatabaseAvatarTableClass * klass,
                                       gpointer klass_data)
{
	dino_database_avatar_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_avatar_table_finalize;
}

static void
dino_database_avatar_table_instance_init (DinoDatabaseAvatarTable * self,
                                          gpointer klass)
{
	QliteColumnInteger* _tmp0_;
	QliteColumnInteger* _tmp1_;
	QliteColumnText* _tmp2_;
	QliteColumnInteger* _tmp3_;
	_tmp0_ = qlite_column_integer_new ("jid_id");
	self->jid_id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("hash");
	self->hash = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("type");
	self->type_ = (QliteColumn*) _tmp3_;
}

static void
dino_database_avatar_table_finalize (QliteTable * obj)
{
	DinoDatabaseAvatarTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_AVATAR_TABLE, DinoDatabaseAvatarTable);
	_qlite_column_unref0 (self->jid_id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->hash);
	_qlite_column_unref0 (self->type_);
	QLITE_TABLE_CLASS (dino_database_avatar_table_parent_class)->finalize (obj);
}

static GType
dino_database_avatar_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseAvatarTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_avatar_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseAvatarTable), 0, (GInstanceInitFunc) dino_database_avatar_table_instance_init, NULL };
	GType dino_database_avatar_table_type_id;
	dino_database_avatar_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseAvatarTable", &g_define_type_info, 0);
	return dino_database_avatar_table_type_id;
}

GType
dino_database_avatar_table_get_type (void)
{
	static volatile gsize dino_database_avatar_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_avatar_table_type_id__once)) {
		GType dino_database_avatar_table_type_id;
		dino_database_avatar_table_type_id = dino_database_avatar_table_get_type_once ();
		g_once_init_leave (&dino_database_avatar_table_type_id__once, dino_database_avatar_table_type_id);
	}
	return dino_database_avatar_table_type_id__once;
}

DinoDatabaseEntityIdentityTable*
dino_database_entity_identity_table_construct (GType object_type,
                                               DinoDatabase* db)
{
	DinoDatabaseEntityIdentityTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn** _tmp8_;
	QliteColumn** _tmp9_;
	gint _tmp9__length1;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn** _tmp16_;
	QliteColumn** _tmp17_;
	gint _tmp17__length1;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn** _tmp20_;
	QliteColumn** _tmp21_;
	gint _tmp21__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseEntityIdentityTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "entity_identity");
	_tmp0_ = self->entity;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->category;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->entity_name;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->type;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = g_new0 (QliteColumn*, 4 + 1);
	_tmp8_[0] = _tmp1_;
	_tmp8_[1] = _tmp3_;
	_tmp8_[2] = _tmp5_;
	_tmp8_[3] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 4;
	qlite_table_init ((QliteTable*) self, _tmp9_, (gint) 4, "");
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp10_ = self->entity;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->category;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->type;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp16_[0] = _tmp11_;
	_tmp16_[1] = _tmp13_;
	_tmp16_[2] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 3;
	qlite_table_unique ((QliteTable*) self, _tmp17_, (gint) 3, "IGNORE");
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp18_ = self->entity;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp20_[0] = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp21__length1 = 1;
	qlite_table_index ((QliteTable*) self, "entity_identity_idx", _tmp21_, (gint) 1, FALSE);
	_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseEntityIdentityTable*
dino_database_entity_identity_table_new (DinoDatabase* db)
{
	return dino_database_entity_identity_table_construct (DINO_DATABASE_TYPE_ENTITY_IDENTITY_TABLE, db);
}

static void
dino_database_entity_identity_table_class_init (DinoDatabaseEntityIdentityTableClass * klass,
                                                gpointer klass_data)
{
	dino_database_entity_identity_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_entity_identity_table_finalize;
}

static void
dino_database_entity_identity_table_instance_init (DinoDatabaseEntityIdentityTable * self,
                                                   gpointer klass)
{
	QliteColumnText* _tmp0_;
	QliteColumnText* _tmp1_;
	QliteColumnText* _tmp2_;
	QliteColumnText* _tmp3_;
	_tmp0_ = qlite_column_text_new ("entity");
	self->entity = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("category");
	self->category = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("type");
	self->type = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("name");
	self->entity_name = (QliteColumn*) _tmp3_;
}

static void
dino_database_entity_identity_table_finalize (QliteTable * obj)
{
	DinoDatabaseEntityIdentityTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_ENTITY_IDENTITY_TABLE, DinoDatabaseEntityIdentityTable);
	_qlite_column_unref0 (self->entity);
	_qlite_column_unref0 (self->category);
	_qlite_column_unref0 (self->type);
	_qlite_column_unref0 (self->entity_name);
	QLITE_TABLE_CLASS (dino_database_entity_identity_table_parent_class)->finalize (obj);
}

static GType
dino_database_entity_identity_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseEntityIdentityTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_entity_identity_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseEntityIdentityTable), 0, (GInstanceInitFunc) dino_database_entity_identity_table_instance_init, NULL };
	GType dino_database_entity_identity_table_type_id;
	dino_database_entity_identity_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseEntityIdentityTable", &g_define_type_info, 0);
	return dino_database_entity_identity_table_type_id;
}

GType
dino_database_entity_identity_table_get_type (void)
{
	static volatile gsize dino_database_entity_identity_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_entity_identity_table_type_id__once)) {
		GType dino_database_entity_identity_table_type_id;
		dino_database_entity_identity_table_type_id = dino_database_entity_identity_table_get_type_once ();
		g_once_init_leave (&dino_database_entity_identity_table_type_id__once, dino_database_entity_identity_table_type_id);
	}
	return dino_database_entity_identity_table_type_id__once;
}

DinoDatabaseEntityFeatureTable*
dino_database_entity_feature_table_construct (GType object_type,
                                              DinoDatabase* db)
{
	DinoDatabaseEntityFeatureTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn** _tmp4_;
	QliteColumn** _tmp5_;
	gint _tmp5__length1;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn** _tmp14_;
	QliteColumn** _tmp15_;
	gint _tmp15__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseEntityFeatureTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "entity_feature");
	_tmp0_ = self->entity;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->feature;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 2;
	qlite_table_init ((QliteTable*) self, _tmp5_, (gint) 2, "");
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp6_ = self->entity;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->feature;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp10_[0] = _tmp7_;
	_tmp10_[1] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 2;
	qlite_table_unique ((QliteTable*) self, _tmp11_, (gint) 2, "IGNORE");
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp12_ = self->entity;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp14_[0] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 1;
	qlite_table_index ((QliteTable*) self, "entity_feature_idx", _tmp15_, (gint) 1, FALSE);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseEntityFeatureTable*
dino_database_entity_feature_table_new (DinoDatabase* db)
{
	return dino_database_entity_feature_table_construct (DINO_DATABASE_TYPE_ENTITY_FEATURE_TABLE, db);
}

static void
dino_database_entity_feature_table_class_init (DinoDatabaseEntityFeatureTableClass * klass,
                                               gpointer klass_data)
{
	dino_database_entity_feature_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_entity_feature_table_finalize;
}

static void
dino_database_entity_feature_table_instance_init (DinoDatabaseEntityFeatureTable * self,
                                                  gpointer klass)
{
	QliteColumnText* _tmp0_;
	QliteColumnText* _tmp1_;
	_tmp0_ = qlite_column_text_new ("entity");
	self->entity = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("feature");
	self->feature = (QliteColumn*) _tmp1_;
}

static void
dino_database_entity_feature_table_finalize (QliteTable * obj)
{
	DinoDatabaseEntityFeatureTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_ENTITY_FEATURE_TABLE, DinoDatabaseEntityFeatureTable);
	_qlite_column_unref0 (self->entity);
	_qlite_column_unref0 (self->feature);
	QLITE_TABLE_CLASS (dino_database_entity_feature_table_parent_class)->finalize (obj);
}

static GType
dino_database_entity_feature_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseEntityFeatureTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_entity_feature_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseEntityFeatureTable), 0, (GInstanceInitFunc) dino_database_entity_feature_table_instance_init, NULL };
	GType dino_database_entity_feature_table_type_id;
	dino_database_entity_feature_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseEntityFeatureTable", &g_define_type_info, 0);
	return dino_database_entity_feature_table_type_id;
}

GType
dino_database_entity_feature_table_get_type (void)
{
	static volatile gsize dino_database_entity_feature_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_entity_feature_table_type_id__once)) {
		GType dino_database_entity_feature_table_type_id;
		dino_database_entity_feature_table_type_id = dino_database_entity_feature_table_get_type_once ();
		g_once_init_leave (&dino_database_entity_feature_table_type_id__once, dino_database_entity_feature_table_type_id);
	}
	return dino_database_entity_feature_table_type_id__once;
}

DinoDatabaseRosterTable*
dino_database_roster_table_construct (GType object_type,
                                      DinoDatabase* db)
{
	DinoDatabaseRosterTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn** _tmp10_;
	QliteColumn** _tmp11_;
	gint _tmp11__length1;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn** _tmp16_;
	QliteColumn** _tmp17_;
	gint _tmp17__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseRosterTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "roster");
	_tmp0_ = self->account_id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->jid;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->handle;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->subscription;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->ask;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = g_new0 (QliteColumn*, 5 + 1);
	_tmp10_[0] = _tmp1_;
	_tmp10_[1] = _tmp3_;
	_tmp10_[2] = _tmp5_;
	_tmp10_[3] = _tmp7_;
	_tmp10_[4] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 5;
	qlite_table_init ((QliteTable*) self, _tmp11_, (gint) 5, "");
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp12_ = self->account_id;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->jid;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp16_[0] = _tmp13_;
	_tmp16_[1] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 2;
	qlite_table_unique ((QliteTable*) self, _tmp17_, (gint) 2, "IGNORE");
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseRosterTable*
dino_database_roster_table_new (DinoDatabase* db)
{
	return dino_database_roster_table_construct (DINO_DATABASE_TYPE_ROSTER_TABLE, db);
}

static void
dino_database_roster_table_class_init (DinoDatabaseRosterTableClass * klass,
                                       gpointer klass_data)
{
	dino_database_roster_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_roster_table_finalize;
}

static void
dino_database_roster_table_instance_init (DinoDatabaseRosterTable * self,
                                          gpointer klass)
{
	QliteColumnInteger* _tmp0_;
	QliteColumnText* _tmp1_;
	QliteColumnText* _tmp2_;
	QliteColumnText* _tmp3_;
	QliteColumnText* _tmp4_ = NULL;
	_tmp0_ = qlite_column_integer_new ("account_id");
	self->account_id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("jid");
	self->jid = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("name");
	self->handle = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("subscription");
	self->subscription = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_text_new ("ask");
	qlite_column_set_min_version ((QliteColumn*) _tmp4_, (glong) 29);
	self->ask = (QliteColumn*) _tmp4_;
}

static void
dino_database_roster_table_finalize (QliteTable * obj)
{
	DinoDatabaseRosterTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_ROSTER_TABLE, DinoDatabaseRosterTable);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->jid);
	_qlite_column_unref0 (self->handle);
	_qlite_column_unref0 (self->subscription);
	_qlite_column_unref0 (self->ask);
	QLITE_TABLE_CLASS (dino_database_roster_table_parent_class)->finalize (obj);
}

static GType
dino_database_roster_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseRosterTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_roster_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseRosterTable), 0, (GInstanceInitFunc) dino_database_roster_table_instance_init, NULL };
	GType dino_database_roster_table_type_id;
	dino_database_roster_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseRosterTable", &g_define_type_info, 0);
	return dino_database_roster_table_type_id;
}

GType
dino_database_roster_table_get_type (void)
{
	static volatile gsize dino_database_roster_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_roster_table_type_id__once)) {
		GType dino_database_roster_table_type_id;
		dino_database_roster_table_type_id = dino_database_roster_table_get_type_once ();
		g_once_init_leave (&dino_database_roster_table_type_id__once, dino_database_roster_table_type_id);
	}
	return dino_database_roster_table_type_id__once;
}

DinoDatabaseMamCatchupTable*
dino_database_mam_catchup_table_construct (GType object_type,
                                           DinoDatabase* db)
{
	DinoDatabaseMamCatchupTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn* _tmp14_;
	QliteColumn* _tmp15_;
	QliteColumn** _tmp16_;
	QliteColumn** _tmp17_;
	gint _tmp17__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseMamCatchupTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "mam_catchup");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->server_jid;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->from_end;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->from_id;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->from_time;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->to_id;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = self->to_time;
	_tmp15_ = _qlite_column_ref0 (_tmp14_);
	_tmp16_ = g_new0 (QliteColumn*, 8 + 1);
	_tmp16_[0] = _tmp1_;
	_tmp16_[1] = _tmp3_;
	_tmp16_[2] = _tmp5_;
	_tmp16_[3] = _tmp7_;
	_tmp16_[4] = _tmp9_;
	_tmp16_[5] = _tmp11_;
	_tmp16_[6] = _tmp13_;
	_tmp16_[7] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 8;
	qlite_table_init ((QliteTable*) self, _tmp17_, (gint) 8, "");
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseMamCatchupTable*
dino_database_mam_catchup_table_new (DinoDatabase* db)
{
	return dino_database_mam_catchup_table_construct (DINO_DATABASE_TYPE_MAM_CATCHUP_TABLE, db);
}

static void
dino_database_mam_catchup_table_class_init (DinoDatabaseMamCatchupTableClass * klass,
                                            gpointer klass_data)
{
	dino_database_mam_catchup_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_mam_catchup_table_finalize;
}

static void
dino_database_mam_catchup_table_instance_init (DinoDatabaseMamCatchupTable * self,
                                               gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnText* _tmp2_ = NULL;
	QliteColumnText* _tmp3_ = NULL;
	QliteColumnLong* _tmp4_ = NULL;
	QliteColumnBoolInt* _tmp5_ = NULL;
	QliteColumnText* _tmp6_ = NULL;
	QliteColumnLong* _tmp7_ = NULL;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("server_jid");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->server_jid = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("from_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp3_, TRUE);
	self->from_id = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_long_new ("from_time");
	qlite_column_set_not_null ((QliteColumn*) _tmp4_, TRUE);
	self->from_time = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_bool_int_new ("from_end");
	qlite_column_set_not_null ((QliteColumn*) _tmp5_, TRUE);
	self->from_end = (QliteColumn*) _tmp5_;
	_tmp6_ = qlite_column_text_new ("to_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp6_, TRUE);
	self->to_id = (QliteColumn*) _tmp6_;
	_tmp7_ = qlite_column_long_new ("to_time");
	qlite_column_set_not_null ((QliteColumn*) _tmp7_, TRUE);
	self->to_time = (QliteColumn*) _tmp7_;
}

static void
dino_database_mam_catchup_table_finalize (QliteTable * obj)
{
	DinoDatabaseMamCatchupTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_MAM_CATCHUP_TABLE, DinoDatabaseMamCatchupTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->server_jid);
	_qlite_column_unref0 (self->from_id);
	_qlite_column_unref0 (self->from_time);
	_qlite_column_unref0 (self->from_end);
	_qlite_column_unref0 (self->to_id);
	_qlite_column_unref0 (self->to_time);
	QLITE_TABLE_CLASS (dino_database_mam_catchup_table_parent_class)->finalize (obj);
}

static GType
dino_database_mam_catchup_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseMamCatchupTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_mam_catchup_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseMamCatchupTable), 0, (GInstanceInitFunc) dino_database_mam_catchup_table_instance_init, NULL };
	GType dino_database_mam_catchup_table_type_id;
	dino_database_mam_catchup_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseMamCatchupTable", &g_define_type_info, 0);
	return dino_database_mam_catchup_table_type_id;
}

GType
dino_database_mam_catchup_table_get_type (void)
{
	static volatile gsize dino_database_mam_catchup_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_mam_catchup_table_type_id__once)) {
		GType dino_database_mam_catchup_table_type_id;
		dino_database_mam_catchup_table_type_id = dino_database_mam_catchup_table_get_type_once ();
		g_once_init_leave (&dino_database_mam_catchup_table_type_id__once, dino_database_mam_catchup_table_type_id);
	}
	return dino_database_mam_catchup_table_type_id__once;
}

DinoDatabaseReactionTable*
dino_database_reaction_table_construct (GType object_type,
                                        DinoDatabase* db)
{
	DinoDatabaseReactionTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn* _tmp8_;
	QliteColumn* _tmp9_;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn** _tmp14_;
	QliteColumn** _tmp15_;
	gint _tmp15__length1;
	QliteColumn* _tmp16_;
	QliteColumn* _tmp17_;
	QliteColumn* _tmp18_;
	QliteColumn* _tmp19_;
	QliteColumn* _tmp20_;
	QliteColumn* _tmp21_;
	QliteColumn** _tmp22_;
	QliteColumn** _tmp23_;
	gint _tmp23__length1;
	QliteColumn* _tmp24_;
	QliteColumn* _tmp25_;
	QliteColumn* _tmp26_;
	QliteColumn* _tmp27_;
	QliteColumn* _tmp28_;
	QliteColumn* _tmp29_;
	QliteColumn** _tmp30_;
	QliteColumn** _tmp31_;
	gint _tmp31__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseReactionTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "reaction");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->occupant_id;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->content_item_id;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = self->time;
	_tmp9_ = _qlite_column_ref0 (_tmp8_);
	_tmp10_ = self->jid_id;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->emojis;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = g_new0 (QliteColumn*, 7 + 1);
	_tmp14_[0] = _tmp1_;
	_tmp14_[1] = _tmp3_;
	_tmp14_[2] = _tmp5_;
	_tmp14_[3] = _tmp7_;
	_tmp14_[4] = _tmp9_;
	_tmp14_[5] = _tmp11_;
	_tmp14_[6] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 7;
	qlite_table_init ((QliteTable*) self, _tmp15_, (gint) 7, "");
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp16_ = self->account_id;
	_tmp17_ = _qlite_column_ref0 (_tmp16_);
	_tmp18_ = self->content_item_id;
	_tmp19_ = _qlite_column_ref0 (_tmp18_);
	_tmp20_ = self->jid_id;
	_tmp21_ = _qlite_column_ref0 (_tmp20_);
	_tmp22_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp22_[0] = _tmp17_;
	_tmp22_[1] = _tmp19_;
	_tmp22_[2] = _tmp21_;
	_tmp23_ = _tmp22_;
	_tmp23__length1 = 3;
	qlite_table_unique ((QliteTable*) self, _tmp23_, (gint) 3, "REPLACE");
	_tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp24_ = self->account_id;
	_tmp25_ = _qlite_column_ref0 (_tmp24_);
	_tmp26_ = self->content_item_id;
	_tmp27_ = _qlite_column_ref0 (_tmp26_);
	_tmp28_ = self->occupant_id;
	_tmp29_ = _qlite_column_ref0 (_tmp28_);
	_tmp30_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp30_[0] = _tmp25_;
	_tmp30_[1] = _tmp27_;
	_tmp30_[2] = _tmp29_;
	_tmp31_ = _tmp30_;
	_tmp31__length1 = 3;
	qlite_table_unique ((QliteTable*) self, _tmp31_, (gint) 3, "REPLACE");
	_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseReactionTable*
dino_database_reaction_table_new (DinoDatabase* db)
{
	return dino_database_reaction_table_construct (DINO_DATABASE_TYPE_REACTION_TABLE, db);
}

static void
dino_database_reaction_table_class_init (DinoDatabaseReactionTableClass * klass,
                                         gpointer klass_data)
{
	dino_database_reaction_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_reaction_table_finalize;
}

static void
dino_database_reaction_table_instance_init (DinoDatabaseReactionTable * self,
                                            gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnInteger* _tmp2_;
	QliteColumnInteger* _tmp3_ = NULL;
	QliteColumnLong* _tmp4_ = NULL;
	QliteColumnInteger* _tmp5_;
	QliteColumnText* _tmp6_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_integer_new ("occupant_id");
	self->occupant_id = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_integer_new ("content_item_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp3_, TRUE);
	self->content_item_id = (QliteColumn*) _tmp3_;
	_tmp4_ = qlite_column_long_new ("time");
	qlite_column_set_not_null ((QliteColumn*) _tmp4_, TRUE);
	self->time = (QliteColumn*) _tmp4_;
	_tmp5_ = qlite_column_integer_new ("jid_id");
	self->jid_id = (QliteColumn*) _tmp5_;
	_tmp6_ = qlite_column_text_new ("emojis");
	self->emojis = (QliteColumn*) _tmp6_;
}

static void
dino_database_reaction_table_finalize (QliteTable * obj)
{
	DinoDatabaseReactionTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_REACTION_TABLE, DinoDatabaseReactionTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->occupant_id);
	_qlite_column_unref0 (self->content_item_id);
	_qlite_column_unref0 (self->time);
	_qlite_column_unref0 (self->jid_id);
	_qlite_column_unref0 (self->emojis);
	QLITE_TABLE_CLASS (dino_database_reaction_table_parent_class)->finalize (obj);
}

static GType
dino_database_reaction_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseReactionTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_reaction_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseReactionTable), 0, (GInstanceInitFunc) dino_database_reaction_table_instance_init, NULL };
	GType dino_database_reaction_table_type_id;
	dino_database_reaction_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseReactionTable", &g_define_type_info, 0);
	return dino_database_reaction_table_type_id;
}

GType
dino_database_reaction_table_get_type (void)
{
	static volatile gsize dino_database_reaction_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_reaction_table_type_id__once)) {
		GType dino_database_reaction_table_type_id;
		dino_database_reaction_table_type_id = dino_database_reaction_table_get_type_once ();
		g_once_init_leave (&dino_database_reaction_table_type_id__once, dino_database_reaction_table_type_id);
	}
	return dino_database_reaction_table_type_id__once;
}

DinoDatabaseSettingsTable*
dino_database_settings_table_construct (GType object_type,
                                        DinoDatabase* db)
{
	DinoDatabaseSettingsTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn** _tmp6_;
	QliteColumn** _tmp7_;
	gint _tmp7__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseSettingsTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "settings");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->key;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->value;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = g_new0 (QliteColumn*, 3 + 1);
	_tmp6_[0] = _tmp1_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 3;
	qlite_table_init ((QliteTable*) self, _tmp7_, (gint) 3, "");
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseSettingsTable*
dino_database_settings_table_new (DinoDatabase* db)
{
	return dino_database_settings_table_construct (DINO_DATABASE_TYPE_SETTINGS_TABLE, db);
}

static void
dino_database_settings_table_class_init (DinoDatabaseSettingsTableClass * klass,
                                         gpointer klass_data)
{
	dino_database_settings_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_settings_table_finalize;
}

static void
dino_database_settings_table_instance_init (DinoDatabaseSettingsTable * self,
                                            gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnText* _tmp1_ = NULL;
	QliteColumnText* _tmp2_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_text_new ("key");
	qlite_column_set_unique ((QliteColumn*) _tmp1_, TRUE);
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->key = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("value");
	self->value = (QliteColumn*) _tmp2_;
}

static void
dino_database_settings_table_finalize (QliteTable * obj)
{
	DinoDatabaseSettingsTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_SETTINGS_TABLE, DinoDatabaseSettingsTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->key);
	_qlite_column_unref0 (self->value);
	QLITE_TABLE_CLASS (dino_database_settings_table_parent_class)->finalize (obj);
}

static GType
dino_database_settings_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseSettingsTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_settings_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseSettingsTable), 0, (GInstanceInitFunc) dino_database_settings_table_instance_init, NULL };
	GType dino_database_settings_table_type_id;
	dino_database_settings_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseSettingsTable", &g_define_type_info, 0);
	return dino_database_settings_table_type_id;
}

GType
dino_database_settings_table_get_type (void)
{
	static volatile gsize dino_database_settings_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_settings_table_type_id__once)) {
		GType dino_database_settings_table_type_id;
		dino_database_settings_table_type_id = dino_database_settings_table_get_type_once ();
		g_once_init_leave (&dino_database_settings_table_type_id__once, dino_database_settings_table_type_id);
	}
	return dino_database_settings_table_type_id__once;
}

DinoDatabaseAccountSettingsTable*
dino_database_account_settings_table_construct (GType object_type,
                                                DinoDatabase* db)
{
	DinoDatabaseAccountSettingsTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn** _tmp8_;
	QliteColumn** _tmp9_;
	gint _tmp9__length1;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn** _tmp14_;
	QliteColumn** _tmp15_;
	gint _tmp15__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseAccountSettingsTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "account_settings");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->account_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->key;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->value;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = g_new0 (QliteColumn*, 4 + 1);
	_tmp8_[0] = _tmp1_;
	_tmp8_[1] = _tmp3_;
	_tmp8_[2] = _tmp5_;
	_tmp8_[3] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 4;
	qlite_table_init ((QliteTable*) self, _tmp9_, (gint) 4, "");
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp10_ = self->account_id;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->key;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp14_[0] = _tmp11_;
	_tmp14_[1] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 2;
	qlite_table_unique ((QliteTable*) self, _tmp15_, (gint) 2, "REPLACE");
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseAccountSettingsTable*
dino_database_account_settings_table_new (DinoDatabase* db)
{
	return dino_database_account_settings_table_construct (DINO_DATABASE_TYPE_ACCOUNT_SETTINGS_TABLE, db);
}

gchar*
dino_database_account_settings_table_get_value (DinoDatabaseAccountSettingsTable* self,
                                                gint account_id,
                                                const gchar* key)
{
	QliteRowOption* row_opt = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn** _tmp2_;
	QliteColumn** _tmp3_;
	gint _tmp3__length1;
	QliteQueryBuilder* _tmp4_;
	QliteQueryBuilder* _tmp5_;
	QliteColumn* _tmp6_;
	QliteQueryBuilder* _tmp7_;
	QliteQueryBuilder* _tmp8_;
	QliteColumn* _tmp9_;
	QliteQueryBuilder* _tmp10_;
	QliteQueryBuilder* _tmp11_;
	QliteQueryBuilder* _tmp12_;
	QliteQueryBuilder* _tmp13_;
	QliteRowOption* _tmp14_;
	QliteRowOption* _tmp15_;
	QliteRowOption* _tmp16_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	_tmp0_ = self->value;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 1;
	_tmp4_ = qlite_table_select ((QliteTable*) self, _tmp3_, (gint) 1);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->account_id;
	_tmp7_ = qlite_query_builder_with (_tmp5_, G_TYPE_INT, NULL, NULL, _tmp6_, "=", (gpointer) ((gintptr) account_id));
	_tmp8_ = _tmp7_;
	_tmp9_ = self->key;
	_tmp10_ = qlite_query_builder_with (_tmp8_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp9_, "=", key);
	_tmp11_ = _tmp10_;
	_tmp12_ = qlite_query_builder_single (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = qlite_query_builder_row (_tmp13_);
	_tmp15_ = _tmp14_;
	_qlite_statement_builder_unref0 (_tmp13_);
	_qlite_statement_builder_unref0 (_tmp11_);
	_qlite_statement_builder_unref0 (_tmp8_);
	_qlite_statement_builder_unref0 (_tmp5_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) qlite_column_unref), NULL);
	row_opt = _tmp15_;
	_tmp16_ = row_opt;
	if (qlite_row_option_is_present (_tmp16_)) {
		QliteRowOption* _tmp17_;
		QliteColumn* _tmp18_;
		gpointer _tmp19_;
		_tmp17_ = row_opt;
		_tmp18_ = self->value;
		_tmp19_ = qlite_row_option_get (_tmp17_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp18_, NULL);
		result = (gchar*) _tmp19_;
		_qlite_row_option_unref0 (row_opt);
		return result;
	}
	result = NULL;
	_qlite_row_option_unref0 (row_opt);
	return result;
}

static void
dino_database_account_settings_table_class_init (DinoDatabaseAccountSettingsTableClass * klass,
                                                 gpointer klass_data)
{
	dino_database_account_settings_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_account_settings_table_finalize;
}

static void
dino_database_account_settings_table_instance_init (DinoDatabaseAccountSettingsTable * self,
                                                    gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnText* _tmp2_ = NULL;
	QliteColumnText* _tmp3_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("account_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->account_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("key");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->key = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("value");
	self->value = (QliteColumn*) _tmp3_;
}

static void
dino_database_account_settings_table_finalize (QliteTable * obj)
{
	DinoDatabaseAccountSettingsTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_ACCOUNT_SETTINGS_TABLE, DinoDatabaseAccountSettingsTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->account_id);
	_qlite_column_unref0 (self->key);
	_qlite_column_unref0 (self->value);
	QLITE_TABLE_CLASS (dino_database_account_settings_table_parent_class)->finalize (obj);
}

static GType
dino_database_account_settings_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseAccountSettingsTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_account_settings_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseAccountSettingsTable), 0, (GInstanceInitFunc) dino_database_account_settings_table_instance_init, NULL };
	GType dino_database_account_settings_table_type_id;
	dino_database_account_settings_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseAccountSettingsTable", &g_define_type_info, 0);
	return dino_database_account_settings_table_type_id;
}

GType
dino_database_account_settings_table_get_type (void)
{
	static volatile gsize dino_database_account_settings_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_account_settings_table_type_id__once)) {
		GType dino_database_account_settings_table_type_id;
		dino_database_account_settings_table_type_id = dino_database_account_settings_table_get_type_once ();
		g_once_init_leave (&dino_database_account_settings_table_type_id__once, dino_database_account_settings_table_type_id);
	}
	return dino_database_account_settings_table_type_id__once;
}

DinoDatabaseConversationSettingsTable*
dino_database_conversation_settings_table_construct (GType object_type,
                                                     DinoDatabase* db)
{
	DinoDatabaseConversationSettingsTable* self = NULL;
	QliteColumn* _tmp0_;
	QliteColumn* _tmp1_;
	QliteColumn* _tmp2_;
	QliteColumn* _tmp3_;
	QliteColumn* _tmp4_;
	QliteColumn* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn** _tmp8_;
	QliteColumn** _tmp9_;
	gint _tmp9__length1;
	QliteColumn* _tmp10_;
	QliteColumn* _tmp11_;
	QliteColumn* _tmp12_;
	QliteColumn* _tmp13_;
	QliteColumn** _tmp14_;
	QliteColumn** _tmp15_;
	gint _tmp15__length1;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoDatabaseConversationSettingsTable*) qlite_table_construct (object_type, (QliteDatabase*) db, "conversation_settings");
	_tmp0_ = self->id;
	_tmp1_ = _qlite_column_ref0 (_tmp0_);
	_tmp2_ = self->conversation_id;
	_tmp3_ = _qlite_column_ref0 (_tmp2_);
	_tmp4_ = self->key;
	_tmp5_ = _qlite_column_ref0 (_tmp4_);
	_tmp6_ = self->value;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = g_new0 (QliteColumn*, 4 + 1);
	_tmp8_[0] = _tmp1_;
	_tmp8_[1] = _tmp3_;
	_tmp8_[2] = _tmp5_;
	_tmp8_[3] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 4;
	qlite_table_init ((QliteTable*) self, _tmp9_, (gint) 4, "");
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) qlite_column_unref), NULL);
	_tmp10_ = self->conversation_id;
	_tmp11_ = _qlite_column_ref0 (_tmp10_);
	_tmp12_ = self->key;
	_tmp13_ = _qlite_column_ref0 (_tmp12_);
	_tmp14_ = g_new0 (QliteColumn*, 2 + 1);
	_tmp14_[0] = _tmp11_;
	_tmp14_[1] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 2;
	qlite_table_index ((QliteTable*) self, "settings_conversationid_key", _tmp15_, (gint) 2, TRUE);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) qlite_column_unref), NULL);
	return self;
}

DinoDatabaseConversationSettingsTable*
dino_database_conversation_settings_table_new (DinoDatabase* db)
{
	return dino_database_conversation_settings_table_construct (DINO_DATABASE_TYPE_CONVERSATION_SETTINGS_TABLE, db);
}

static void
dino_database_conversation_settings_table_class_init (DinoDatabaseConversationSettingsTableClass * klass,
                                                      gpointer klass_data)
{
	dino_database_conversation_settings_table_parent_class = g_type_class_peek_parent (klass);
	((QliteTableClass *) klass)->finalize = dino_database_conversation_settings_table_finalize;
}

static void
dino_database_conversation_settings_table_instance_init (DinoDatabaseConversationSettingsTable * self,
                                                         gpointer klass)
{
	QliteColumnInteger* _tmp0_ = NULL;
	QliteColumnInteger* _tmp1_ = NULL;
	QliteColumnText* _tmp2_ = NULL;
	QliteColumnText* _tmp3_;
	_tmp0_ = qlite_column_integer_new ("id");
	qlite_column_set_primary_key ((QliteColumn*) _tmp0_, TRUE);
	qlite_column_set_auto_increment ((QliteColumn*) _tmp0_, TRUE);
	self->id = (QliteColumn*) _tmp0_;
	_tmp1_ = qlite_column_integer_new ("conversation_id");
	qlite_column_set_not_null ((QliteColumn*) _tmp1_, TRUE);
	self->conversation_id = (QliteColumn*) _tmp1_;
	_tmp2_ = qlite_column_text_new ("key");
	qlite_column_set_not_null ((QliteColumn*) _tmp2_, TRUE);
	self->key = (QliteColumn*) _tmp2_;
	_tmp3_ = qlite_column_text_new ("value");
	self->value = (QliteColumn*) _tmp3_;
}

static void
dino_database_conversation_settings_table_finalize (QliteTable * obj)
{
	DinoDatabaseConversationSettingsTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_DATABASE_TYPE_CONVERSATION_SETTINGS_TABLE, DinoDatabaseConversationSettingsTable);
	_qlite_column_unref0 (self->id);
	_qlite_column_unref0 (self->conversation_id);
	_qlite_column_unref0 (self->key);
	_qlite_column_unref0 (self->value);
	QLITE_TABLE_CLASS (dino_database_conversation_settings_table_parent_class)->finalize (obj);
}

static GType
dino_database_conversation_settings_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseConversationSettingsTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_conversation_settings_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabaseConversationSettingsTable), 0, (GInstanceInitFunc) dino_database_conversation_settings_table_instance_init, NULL };
	GType dino_database_conversation_settings_table_type_id;
	dino_database_conversation_settings_table_type_id = g_type_register_static (QLITE_TYPE_TABLE, "DinoDatabaseConversationSettingsTable", &g_define_type_info, 0);
	return dino_database_conversation_settings_table_type_id;
}

GType
dino_database_conversation_settings_table_get_type (void)
{
	static volatile gsize dino_database_conversation_settings_table_type_id__once = 0;
	if (g_once_init_enter (&dino_database_conversation_settings_table_type_id__once)) {
		GType dino_database_conversation_settings_table_type_id;
		dino_database_conversation_settings_table_type_id = dino_database_conversation_settings_table_get_type_once ();
		g_once_init_leave (&dino_database_conversation_settings_table_type_id__once, dino_database_conversation_settings_table_type_id);
	}
	return dino_database_conversation_settings_table_type_id__once;
}

static void
dino_database_class_init (DinoDatabaseClass * klass,
                          gpointer klass_data)
{
	dino_database_parent_class = g_type_class_peek_parent (klass);
	((QliteDatabaseClass *) klass)->finalize = dino_database_finalize;
	g_type_class_adjust_private_offset (klass, &DinoDatabase_private_offset);
	((QliteDatabaseClass *) klass)->migrate = (void (*) (QliteDatabase*, glong)) dino_database_real_migrate;
}

static void
dino_database_instance_init (DinoDatabase * self,
                             gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	self->priv = dino_database_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->jid_table_cache = (GeeMap*) _tmp0_;
	_tmp1_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, G_TYPE_INT, NULL, NULL, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->jid_table_reverse = (GeeMap*) _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->account_table_cache = (GeeMap*) _tmp2_;
}

static void
dino_database_finalize (QliteDatabase * obj)
{
	DinoDatabase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_DATABASE, DinoDatabase);
	_qlite_table_unref0 (self->priv->_account);
	_qlite_table_unref0 (self->priv->_jid);
	_qlite_table_unref0 (self->priv->_entity);
	_qlite_table_unref0 (self->priv->_content_item);
	_qlite_table_unref0 (self->priv->_message);
	_qlite_table_unref0 (self->priv->_body_meta);
	_qlite_table_unref0 (self->priv->_reply);
	_qlite_table_unref0 (self->priv->_message_correction);
	_qlite_table_unref0 (self->priv->_real_jid);
	_qlite_table_unref0 (self->priv->_occupantid);
	_qlite_table_unref0 (self->priv->_file_transfer);
	_qlite_table_unref0 (self->priv->_file_hashes);
	_qlite_table_unref0 (self->priv->_file_thumbnails);
	_qlite_table_unref0 (self->priv->_sfs_sources);
	_qlite_table_unref0 (self->priv->_call);
	_qlite_table_unref0 (self->priv->_call_counterpart);
	_qlite_table_unref0 (self->priv->_conversation);
	_qlite_table_unref0 (self->priv->_avatar);
	_qlite_table_unref0 (self->priv->_entity_identity);
	_qlite_table_unref0 (self->priv->_entity_feature);
	_qlite_table_unref0 (self->priv->_roster);
	_qlite_table_unref0 (self->priv->_mam_catchup);
	_qlite_table_unref0 (self->priv->_reaction);
	_qlite_table_unref0 (self->priv->_settings);
	_qlite_table_unref0 (self->priv->_account_settings);
	_qlite_table_unref0 (self->priv->_conversation_settings);
	_g_object_unref0 (self->jid_table_cache);
	_g_object_unref0 (self->jid_table_reverse);
	_g_object_unref0 (self->account_table_cache);
	QLITE_DATABASE_CLASS (dino_database_parent_class)->finalize (obj);
}

static GType
dino_database_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoDatabase), 0, (GInstanceInitFunc) dino_database_instance_init, NULL };
	GType dino_database_type_id;
	dino_database_type_id = g_type_register_static (QLITE_TYPE_DATABASE, "DinoDatabase", &g_define_type_info, 0);
	DinoDatabase_private_offset = g_type_add_instance_private (dino_database_type_id, sizeof (DinoDatabasePrivate));
	return dino_database_type_id;
}

GType
dino_database_get_type (void)
{
	static volatile gsize dino_database_type_id__once = 0;
	if (g_once_init_enter (&dino_database_type_id__once)) {
		GType dino_database_type_id;
		dino_database_type_id = dino_database_get_type_once ();
		g_once_init_leave (&dino_database_type_id__once, dino_database_type_id);
	}
	return dino_database_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

