CamelDB

## CamelDB CamelDB |

## Synopsis

    #define             CAMEL_DB_FILE
    #define             CAMEL_DB_IN_MEMORY_TABLE
    #define             CAMEL_DB_IN_MEMORY_DB
    #define             CAMEL_DB_IN_MEMORY_TABLE_LIMIT
    #define             CAMEL_DB_FREE_CACHE_SIZE
    #define             CAMEL_DB_SLEEP_INTERVAL
    #define             CAMEL_DB_RELEASE_SQLITE_MEMORY
    #define             CAMEL_DB_USE_SHARED_CACHE
    gint                (*CamelDBCollate)                   (gpointer ,
                                                             ...,
                                                             gconstpointer ,
                                                             ...,
                                                             gconstpointer );
                        CamelDB;
                        CamelMIRecord;
                        CamelFIRecord;
    gint                (*CamelDBSelectCB)                  (gpointer data,
                                                             gint ncol,
                                                             gchar **colvalues,
                                                             gchar **colnames);
    CamelDB *           camel_db_open                       (const gchar *path,
                                                             CamelException *ex);
    CamelDB *           camel_db_clone                      (CamelDB *cdb,
                                                             CamelException *ex);
    void                camel_db_close                      (CamelDB *cdb);
    gint                camel_db_command                    (CamelDB *cdb,
                                                             const gchar *stmt,
                                                             CamelException *ex);
    gint                camel_db_transaction_command        (CamelDB *cdb,
                                                             GSList *qry_list,
                                                             CamelException *ex);
    gint                camel_db_begin_transaction          (CamelDB *cdb,
                                                             CamelException *ex);
    gint                camel_db_add_to_transaction         (CamelDB *cdb,
                                                             const gchar *query,
                                                             CamelException *ex);
    gint                camel_db_end_transaction            (CamelDB *cdb,
                                                             CamelException *ex);
    gint                camel_db_abort_transaction          (CamelDB *cdb,
                                                             CamelException *ex);
    gint                camel_db_clear_folder_summary       (CamelDB *cdb,
                                                             gchar *folder,
                                                             CamelException *ex);
    gint                camel_db_rename_folder              (CamelDB *cdb,
                                                             const gchar *old_folder,
                                                             const gchar *new_folder,
                                                             CamelException *ex);
    gint                camel_db_delete_folder              (CamelDB *cdb,
                                                             const gchar *folder,
                                                             CamelException *ex);
    gint                camel_db_delete_uid                 (CamelDB *cdb,
                                                             const gchar *folder,
                                                             const gchar *uid,
                                                             CamelException *ex);
    gint                camel_db_delete_uids                (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             GSList *uids,
                                                             CamelException *ex);
    gint                camel_db_delete_vuids               (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             const gchar *shash,
                                                             GSList *uids,
                                                             CamelException *ex);
    gint                camel_db_create_folders_table       (CamelDB *cdb,
                                                             CamelException *ex);
    gint                camel_db_select                     (CamelDB *cdb,
                                                             const gchar *stmt,
                                                             CamelDBSelectCB callback,
                                                             gpointer data,
                                                             CamelException *ex);
    gint                camel_db_write_folder_info_record   (CamelDB *cdb,
                                                             CamelFIRecord *record,
                                                             CamelException *ex);
    gint                camel_db_read_folder_info_record    (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelFIRecord **record,
                                                             CamelException *ex);
    gint                camel_db_prepare_message_info_table (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelException *ex);
    gint                camel_db_write_message_info_record  (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelMIRecord *record,
                                                             CamelException *ex);
    gint                camel_db_write_fresh_message_info_record
                                                            (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelMIRecord *record,
                                                             CamelException *ex);
    gint                camel_db_read_message_info_records  (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             gpointer p,
                                                             CamelDBSelectCB read_mir_callback,
                                                             CamelException *ex);
    gint                camel_db_read_message_info_record_with_uid
                                                            (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             const gchar *uid,
                                                             gpointer p,
                                                             CamelDBSelectCB read_mir_callback,
                                                             CamelException *ex);
    gint                camel_db_count_junk_message_info    (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_unread_message_info  (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_deleted_message_info (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_total_message_info   (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_visible_message_info (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_visible_unread_message_info
                                                            (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_junk_not_deleted_message_info
                                                            (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);
    gint                camel_db_count_message_info         (CamelDB *cdb,
                                                             const gchar *query,
                                                             guint32 *count,
                                                             CamelException *ex);
    void                camel_db_camel_mir_free             (CamelMIRecord *record);
    gint                camel_db_create_vfolder             (CamelDB *db,
                                                             const gchar *folder_name,
                                                             CamelException *ex);
    gint                camel_db_recreate_vfolder           (CamelDB *db,
                                                             const gchar *folder_name,
                                                             CamelException *ex);
    gint                camel_db_delete_uid_from_vfolder    (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *vuid,
                                                             CamelException *ex);
    gint                camel_db_delete_uid_from_vfolder_transaction
                                                            (CamelDB *db,
                                                             const gchar *folder_name,
                                                             const gchar *vuid,
                                                             CamelException *ex);
    GPtrArray *         camel_db_get_vuids_from_vfolder     (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *filter,
                                                             CamelException *ex);
    gint                camel_db_add_to_vfolder             (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *vuid,
                                                             CamelException *ex);
    gint                camel_db_add_to_vfolder_transaction (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *vuid,
                                                             CamelException *ex);
    gint                camel_db_get_folder_uids            (CamelDB *db,
                                                             const gchar *folder_name,
                                                             const gchar *sort_by,
                                                             const gchar *collate,
                                                             GPtrArray *array,
                                                             CamelException *ex);
    gint                camel_db_get_folder_uids_flags      (CamelDB *db,
                                                             const gchar *folder_name,
                                                             const gchar *sort_by,
                                                             const gchar *collate,
                                                             GPtrArray *summary,
                                                             GHashTable *table,
                                                             CamelException *ex);
    GPtrArray *         camel_db_get_folder_junk_uids       (CamelDB *db,
                                                             gchar *folder_name,
                                                             CamelException *ex);
    GPtrArray *         camel_db_get_folder_deleted_uids    (CamelDB *db,
                                                             gchar *folder_name,
                                                             CamelException *ex);
    gchar *             camel_db_sqlize_string              (const gchar *string);
    void                camel_db_free_sqlized_string        (gchar *string);
    gchar *             camel_db_get_column_name            (const gchar *raw_name);
    gint                camel_db_set_collate                (CamelDB *cdb,
                                                             const gchar *col,
                                                             const gchar *collate,
                                                             CamelDBCollate func);
    gint                camel_db_migrate_vfolders_to_14     (CamelDB *cdb,
                                                             const gchar *folder,
                                                             CamelException *ex);
    gint                camel_db_start_in_memory_transactions
                                                            (CamelDB *cdb,
                                                             CamelException *ex);
    gint                camel_db_flush_in_memory_transactions
                                                            (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelException *ex);
    GHashTable *        camel_db_get_folder_preview         (CamelDB *db,
                                                             gchar *folder_name,
                                                             CamelException *ex);
    gint                camel_db_write_preview_record       (CamelDB *db,
                                                             gchar *folder_name,
                                                             const gchar *uid,
                                                             const gchar *msg,
                                                             CamelException *ex);
    gint                camel_db_reset_folder_version       (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             gint reset_version,
                                                             CamelException *ex);

## Description

## Details

### CAMEL_DB_FILE

    #define CAMEL_DB_FILE "folders.db"

### CAMEL_DB_IN_MEMORY_TABLE

    #define CAMEL_DB_IN_MEMORY_TABLE "EVO_IN_meM_hAnDlE.temp"

### CAMEL_DB_IN_MEMORY_DB

    #define CAMEL_DB_IN_MEMORY_DB "EVO_IN_meM_hAnDlE"

### CAMEL_DB_IN_MEMORY_TABLE_LIMIT

    #define CAMEL_DB_IN_MEMORY_TABLE_LIMIT 100000

### CAMEL_DB_FREE_CACHE_SIZE

    #define CAMEL_DB_FREE_CACHE_SIZE 2 * 1024 * 1024

### CAMEL_DB_SLEEP_INTERVAL

    #define CAMEL_DB_SLEEP_INTERVAL 1*10*10

### CAMEL_DB_RELEASE_SQLITE_MEMORY

    #define CAMEL_DB_RELEASE_SQLITE_MEMORY if(!g_getenv("CAMEL_SQLITE_FREE_CACHE")) sqlite3_release_memory(CAMEL_DB_FREE_CACHE_SIZE);

### CAMEL_DB_USE_SHARED_CACHE

    #define CAMEL_DB_USE_SHARED_CACHE if(g_getenv("CAMEL_SQLITE_SHARED_CACHE")) sqlite3_enable_shared_cache(TRUE);

### CamelDBCollate ()

    gint                (*CamelDBCollate)                   (gpointer ,
                                                             ...,
                                                             gconstpointer ,
                                                             ...,
                                                             gconstpointer );

`Param1` : |
`...` : |
`Param3` : |
`...` : |
`Param5` : |
Returns : |

### CamelDB

    typedef struct {
    	sqlite3 *db;
    	GMutex *lock;
    	CamelDBPrivate *priv;
    } CamelDB;

### CamelMIRecord

    typedef struct {
    	gchar *uid;
    	guint32 flags;
    	guint32 msg_type;
    	guint32 dirty;
    	gboolean read;
    	gboolean deleted;
    	gboolean replied;
    	gboolean important;
    	gboolean junk;
    	gboolean attachment;
    	guint32 size;
    	time_t dsent;
    	time_t dreceived;
    	gchar *subject;
    	gchar *from;
    	gchar *to;
    	gchar *cc;
    	gchar *mlist;
    	gchar *followup_flag;
    	gchar *followup_completed_on;
    	gchar *followup_due_by;
    	gchar *part;
    	gchar *labels;
    	gchar *usertags;
    	gchar *cinfo;
    	gchar *bdata;
    } CamelMIRecord;

### CamelFIRecord

    typedef struct {
    	gchar *folder_name;
    	guint32 version;
    	guint32 flags;
    	guint32 nextuid;
    	time_t time;
    	guint32 saved_count;
    	guint32 unread_count;
    	guint32 deleted_count;
    	guint32 junk_count;
    	guint32 visible_count;
    	guint32 jnd_count;  /* Junked not deleted */
    	gchar *bdata;
    } CamelFIRecord;

### CamelDBSelectCB ()

    gint                (*CamelDBSelectCB)                  (gpointer data,
                                                             gint ncol,
                                                             gchar **colvalues,
                                                             gchar **colnames);

`data` : |
`ncol` : |
`colvalues` : |
`colnames` : |
Returns : |

### camel_db_open ()

    CamelDB *           camel_db_open                       (const gchar *path,
                                                             CamelException *ex);

`path` : |
`ex` : |
Returns : |

### camel_db_clone ()

    CamelDB *           camel_db_clone                      (CamelDB *cdb,
                                                             CamelException *ex);

`cdb` : |
`ex` : |
Returns : |

### camel_db_close ()

    void                camel_db_close                      (CamelDB *cdb);

`cdb` : |

### camel_db_command ()

    gint                camel_db_command                    (CamelDB *cdb,
                                                             const gchar *stmt,
                                                             CamelException *ex);

`cdb` : |
`stmt` : |
`ex` : |
Returns : |

### camel_db_transaction_command ()

    gint                camel_db_transaction_command        (CamelDB *cdb,
                                                             GSList *qry_list,
                                                             CamelException *ex);

`cdb` : |
`qry_list` : |
`ex` : |
Returns : |

### camel_db_begin_transaction ()

    gint                camel_db_begin_transaction          (CamelDB *cdb,
                                                             CamelException *ex);

`cdb` : |
`ex` : |
Returns : |

### camel_db_add_to_transaction ()

    gint                camel_db_add_to_transaction         (CamelDB *cdb,
                                                             const gchar *query,
                                                             CamelException *ex);

`cdb` : |
`query` : |
`ex` : |
Returns : |

### camel_db_end_transaction ()

    gint                camel_db_end_transaction            (CamelDB *cdb,
                                                             CamelException *ex);

`cdb` : |
`ex` : |
Returns : |

### camel_db_abort_transaction ()

    gint                camel_db_abort_transaction          (CamelDB *cdb,
                                                             CamelException *ex);

`cdb` : |
`ex` : |
Returns : |

### camel_db_clear_folder_summary ()

    gint                camel_db_clear_folder_summary       (CamelDB *cdb,
                                                             gchar *folder,
                                                             CamelException *ex);

`cdb` : |
`folder` : |
`ex` : |
Returns : |

### camel_db_rename_folder ()

    gint                camel_db_rename_folder              (CamelDB *cdb,
                                                             const gchar *old_folder,
                                                             const gchar *new_folder,
                                                             CamelException *ex);

`cdb` : |
`old_folder` : |
`new_folder` : |
`ex` : |
Returns : |

### camel_db_delete_folder ()

    gint                camel_db_delete_folder              (CamelDB *cdb,
                                                             const gchar *folder,
                                                             CamelException *ex);

`cdb` : |
`folder` : |
`ex` : |
Returns : |

### camel_db_delete_uid ()

    gint                camel_db_delete_uid                 (CamelDB *cdb,
                                                             const gchar *folder,
                                                             const gchar *uid,
                                                             CamelException *ex);

`cdb` : |
`folder` : |
`uid` : |
`ex` : |
Returns : |

### camel_db_delete_uids ()

    gint                camel_db_delete_uids                (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             GSList *uids,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`uids` : |
`ex` : |
Returns : |

### camel_db_delete_vuids ()

    gint                camel_db_delete_vuids               (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             const gchar *shash,
                                                             GSList *uids,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`shash` : |
`uids` : |
`ex` : |
Returns : |

### camel_db_create_folders_table ()

    gint                camel_db_create_folders_table       (CamelDB *cdb,
                                                             CamelException *ex);

`cdb` : |
`ex` : |
Returns : |

### camel_db_select ()

    gint                camel_db_select                     (CamelDB *cdb,
                                                             const gchar *stmt,
                                                             CamelDBSelectCB callback,
                                                             gpointer data,
                                                             CamelException *ex);

`cdb` : |
`stmt` : |
`callback` : |
`data` : |
`ex` : |
Returns : |

### camel_db_write_folder_info_record ()

    gint                camel_db_write_folder_info_record   (CamelDB *cdb,
                                                             CamelFIRecord *record,
                                                             CamelException *ex);

`cdb` : |
`record` : |
`ex` : |
Returns : |

### camel_db_read_folder_info_record ()

    gint                camel_db_read_folder_info_record    (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelFIRecord **record,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`record` : |
`ex` : |
Returns : |

### camel_db_prepare_message_info_table ()

    gint                camel_db_prepare_message_info_table (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_write_message_info_record ()

    gint                camel_db_write_message_info_record  (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelMIRecord *record,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`record` : |
`ex` : |
Returns : |

### camel_db_write_fresh_message_info_record ()

    gint                camel_db_write_fresh_message_info_record
                                                            (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelMIRecord *record,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`record` : |
`ex` : |
Returns : |

### camel_db_read_message_info_records ()

    gint                camel_db_read_message_info_records  (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             gpointer p,
                                                             CamelDBSelectCB read_mir_callback,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`p` : |
`read_mir_callback` : |
`ex` : |
Returns : |

### camel_db_read_message_info_record_with_uid ()

    gint                camel_db_read_message_info_record_with_uid
                                                            (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             const gchar *uid,
                                                             gpointer p,
                                                             CamelDBSelectCB read_mir_callback,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`uid` : |
`p` : |
`read_mir_callback` : |
`ex` : |
Returns : |

### camel_db_count_junk_message_info ()

    gint                camel_db_count_junk_message_info    (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_unread_message_info ()

    gint                camel_db_count_unread_message_info  (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_deleted_message_info ()

    gint                camel_db_count_deleted_message_info (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_total_message_info ()

    gint                camel_db_count_total_message_info   (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_visible_message_info ()

    gint                camel_db_count_visible_message_info (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_visible_unread_message_info ()

    gint                camel_db_count_visible_unread_message_info
                                                            (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_junk_not_deleted_message_info ()

    gint                camel_db_count_junk_not_deleted_message_info
                                                            (CamelDB *cdb,
                                                             const gchar *table_name,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`table_name` : |
`count` : |
`ex` : |
Returns : |

### camel_db_count_message_info ()

    gint                camel_db_count_message_info         (CamelDB *cdb,
                                                             const gchar *query,
                                                             guint32 *count,
                                                             CamelException *ex);

`cdb` : |
`query` : |
`count` : |
`ex` : |
Returns : |

### camel_db_camel_mir_free ()

    void                camel_db_camel_mir_free             (CamelMIRecord *record);

`record` : |

### camel_db_create_vfolder ()

    gint                camel_db_create_vfolder             (CamelDB *db,
                                                             const gchar *folder_name,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_recreate_vfolder ()

    gint                camel_db_recreate_vfolder           (CamelDB *db,
                                                             const gchar *folder_name,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_delete_uid_from_vfolder ()

    gint                camel_db_delete_uid_from_vfolder    (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *vuid,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`vuid` : |
`ex` : |
Returns : |

### camel_db_delete_uid_from_vfolder_transaction ()

    gint                camel_db_delete_uid_from_vfolder_transaction
                                                            (CamelDB *db,
                                                             const gchar *folder_name,
                                                             const gchar *vuid,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`vuid` : |
`ex` : |
Returns : |

### camel_db_get_vuids_from_vfolder ()

    GPtrArray *         camel_db_get_vuids_from_vfolder     (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *filter,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`filter` : |
`ex` : |
Returns : |

### camel_db_add_to_vfolder ()

    gint                camel_db_add_to_vfolder             (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *vuid,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`vuid` : |
`ex` : |
Returns : |

### camel_db_add_to_vfolder_transaction ()

    gint                camel_db_add_to_vfolder_transaction (CamelDB *db,
                                                             gchar *folder_name,
                                                             gchar *vuid,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`vuid` : |
`ex` : |
Returns : |

### camel_db_get_folder_uids ()

    gint                camel_db_get_folder_uids            (CamelDB *db,
                                                             const gchar *folder_name,
                                                             const gchar *sort_by,
                                                             const gchar *collate,
                                                             GPtrArray *array,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`sort_by` : |
`collate` : |
`array` : |
`ex` : |
Returns : |

### camel_db_get_folder_uids_flags ()

    gint                camel_db_get_folder_uids_flags      (CamelDB *db,
                                                             const gchar *folder_name,
                                                             const gchar *sort_by,
                                                             const gchar *collate,
                                                             GPtrArray *summary,
                                                             GHashTable *table,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`sort_by` : |
`collate` : |
`summary` : |
`table` : |
`ex` : |
Returns : |

### camel_db_get_folder_junk_uids ()

    GPtrArray *         camel_db_get_folder_junk_uids       (CamelDB *db,
                                                             gchar *folder_name,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_get_folder_deleted_uids ()

    GPtrArray *         camel_db_get_folder_deleted_uids    (CamelDB *db,
                                                             gchar *folder_name,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_sqlize_string ()

    gchar *             camel_db_sqlize_string              (const gchar *string);

`string` : |
Returns : |

### camel_db_free_sqlized_string ()

    void                camel_db_free_sqlized_string        (gchar *string);

`string` : |

### camel_db_get_column_name ()

    gchar *             camel_db_get_column_name            (const gchar *raw_name);

`raw_name` : |
Returns : |

### camel_db_set_collate ()

    gint                camel_db_set_collate                (CamelDB *cdb,
                                                             const gchar *col,
                                                             const gchar *collate,
                                                             CamelDBCollate func);

`cdb` : |
`col` : |
`collate` : |
`func` : |
Returns : |

### camel_db_migrate_vfolders_to_14 ()

    gint                camel_db_migrate_vfolders_to_14     (CamelDB *cdb,
                                                             const gchar *folder,
                                                             CamelException *ex);

`cdb` : |
`folder` : |
`ex` : |
Returns : |

### camel_db_start_in_memory_transactions ()

    gint                camel_db_start_in_memory_transactions
                                                            (CamelDB *cdb,
                                                             CamelException *ex);

`cdb` : |
`ex` : |
Returns : |

### camel_db_flush_in_memory_transactions ()

    gint                camel_db_flush_in_memory_transactions
                                                            (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_get_folder_preview ()

    GHashTable *        camel_db_get_folder_preview         (CamelDB *db,
                                                             gchar *folder_name,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`ex` : |
Returns : |

### camel_db_write_preview_record ()

    gint                camel_db_write_preview_record       (CamelDB *db,
                                                             gchar *folder_name,
                                                             const gchar *uid,
                                                             const gchar *msg,
                                                             CamelException *ex);

`db` : |
`folder_name` : |
`uid` : |
`msg` : |
`ex` : |
Returns : |

### camel_db_reset_folder_version ()

    gint                camel_db_reset_folder_version       (CamelDB *cdb,
                                                             const gchar *folder_name,
                                                             gint reset_version,
                                                             CamelException *ex);

`cdb` : |
`folder_name` : |
`reset_version` : |
`ex` : |
Returns : |