CamelDB: Camel Reference Manual

## CamelDB CamelDB |

## Functions

gint | (*CamelDBCollate) ()
CamelDBKnownColumnNames | camel_db_get_column_ident ()
gint | (*CamelDBSelectCB) ()
GQuark | camel_db_error_quark ()
CamelDB * | camel_db_new ()
const gchar * | camel_db_get_filename ()
gint | camel_db_command ()
gint | camel_db_transaction_command ()
gint | camel_db_begin_transaction ()
gint | camel_db_add_to_transaction ()
gint | camel_db_end_transaction ()
gint | camel_db_abort_transaction ()
gint | camel_db_clear_folder_summary ()
gint | camel_db_rename_folder ()
gint | camel_db_delete_folder ()
gint | camel_db_delete_uid ()
gint | camel_db_delete_uids ()
gint | camel_db_create_folders_table ()
gint | camel_db_select ()
gint | camel_db_write_folder_info_record ()
gint | camel_db_read_folder_info_record ()
gint | camel_db_prepare_message_info_table ()
gint | camel_db_write_message_info_record ()
gint | camel_db_read_message_info_records ()
gint | camel_db_read_message_info_record_with_uid ()
gint | camel_db_count_junk_message_info ()
gint | camel_db_count_unread_message_info ()
gint | camel_db_count_deleted_message_info ()
gint | camel_db_count_total_message_info ()
gint | camel_db_count_visible_message_info ()
gint | camel_db_count_visible_unread_message_info ()
gint | camel_db_count_junk_not_deleted_message_info ()
gint | camel_db_count_message_info ()
gint | camel_db_get_folder_uids ()
GPtrArray * | camel_db_get_folder_junk_uids ()
GPtrArray * | camel_db_get_folder_deleted_uids ()
gint | camel_db_set_collate ()
gint | camel_db_start_in_memory_transactions ()
gint | camel_db_flush_in_memory_transactions ()
gint | camel_db_reset_folder_version ()
gboolean | camel_db_maybe_run_maintenance ()
void | camel_db_release_cache_memory ()
gchar * | camel_db_sqlize_string ()
void | camel_db_free_sqlized_string ()
gchar * | camel_db_get_column_name ()
void | camel_db_camel_mir_free ()

## Types and Values

#define | CAMEL_DB_ERROR
enum | CamelDBError
struct | CamelDB
#define | CAMEL_DB_FILE
#define | CAMEL_DB_IN_MEMORY_TABLE
#define | CAMEL_DB_IN_MEMORY_TABLE_LIMIT
#define | CAMEL_DB_FREE_CACHE_SIZE
#define | CAMEL_DB_SLEEP_INTERVAL
| CamelMIRecord
| CamelFIRecord
enum | CamelDBKnownColumnNames

## Object Hierarchy

        GObject
        ╰── CamelDB

## Description

## Functions

### CamelDBCollate ()

    gint
    (*CamelDBCollate) (gpointer enc,
                       gint length1,
                       gconstpointer data1,
                       gint length2,
                       gconstpointer data2);

A collation callback function.

#### Parameters

enc | a used encoding (SQLITE_UTF8) |
length1 | length of the `data1` |
data1 | the first value, of lenth `length1` |
length2 | length of the `data2` |
data2 | the second value, of lenth `length2` |

#### Returns

less than zero, zero, or greater than zero value, the same as for example `strcmp()` does.

Since: 2.24

### camel_db_get_column_ident ()

    CamelDBKnownColumnNames
    camel_db_get_column_ident (GHashTable **hash,
                               gint index,
                               gint ncols,
                               gchar **col_names);

Traverses column name from index `index` into an enum CamelDBKnownColumnNames value. The `col_names` contains `ncols` columns. First time this is called is created the `hash` from col_names indexes into the enum, and this is reused for every other call. The function expects that column names are returned always in the same order. When all rows are read the `hash` table can be freed with `g_hash_table_destroy()`.

#### Parameters

hash | a GHashTable. | [inout]
index | an index to start with, between 0 and `ncols` |
ncols | number of `col_names` |
col_names | column names to traverse. | [array length=ncols]

Since: 3.4

### CamelDBSelectCB ()

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

A callback called for the SELECT statements. The items at the same index of `colvalues` and `colnames` correspond to each other.

#### Parameters

user_data | a callback user data |
ncol | how many columns is provided |
colvalues | array of column values, as UTF-8 strings. | [array length=ncol]
colnames | array of column names. | [array length=ncol]

#### Returns

0 to continue the SELECT execution, non-zero to abort the execution.

Since: 2.24

### camel_db_error_quark ()

    GQuark
    camel_db_error_quark (void);

### camel_db_new ()

    CamelDB *
    camel_db_new (const gchar *filename,
                  GError **error);

#### Parameters

filename | A filename with the database to open/create |
error | return location for a GError, or `NULL` |

#### Returns

A new CamelDB with `filename` as its database file. Free it with `g_object_unref()` when no longer needed.

[transfer full]

Since: 3.24

### camel_db_get_filename ()

    const gchar *
    camel_db_get_filename (CamelDB *cdb);

#### Parameters

cdb | a CamelDB |

#### Returns

A filename associated with `cdb` .

[transfer none]

Since: 3.24

### camel_db_command ()

    gint
    camel_db_command (CamelDB *cdb,
                      const gchar *stmt,
                      GError **error);

Executes an SQLite command.

#### Parameters

cdb | a CamelDB |
stmt | an SQL (SQLite) statement to execute |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_transaction_command ()

    gint
    camel_db_transaction_command (CamelDB *cdb,
                                  const GList *qry_list,
                                  GError **error);

Runs the list of commands as a single transaction.

#### Parameters

cdb | a CamelDB |
qry_list | A GList of querries. | [element-type utf8][transfer none]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_begin_transaction ()

    gint
    camel_db_begin_transaction (CamelDB *cdb,
                                GError **error);

Begins transaction. End it with `camel_db_end_transaction()` or `camel_db_abort_transaction()`.

#### Parameters

cdb | a CamelDB |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_add_to_transaction ()

    gint
    camel_db_add_to_transaction (CamelDB *cdb,
                                 const gchar *query,
                                 GError **error);

Adds a statement to an ongoing transaction.

#### Parameters

cdb | a CamelDB |
query | an SQL (SQLite) statement |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_end_transaction ()

    gint
    camel_db_end_transaction (CamelDB *cdb,
                              GError **error);

Ends an ongoing transaction by committing the changes.

#### Parameters

cdb | a CamelDB |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_abort_transaction ()

    gint
    camel_db_abort_transaction (CamelDB *cdb,
                                GError **error);

Ends an ongoing transaction by ignoring the changes.

#### Parameters

cdb | a CamelDB |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_clear_folder_summary ()

    gint
    camel_db_clear_folder_summary (CamelDB *cdb,
                                   const gchar *folder_name,
                                   GError **error);

Deletes the given folder from the 'folders' table and empties its message info table.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_rename_folder ()

    gint
    camel_db_rename_folder (CamelDB *cdb,
                            const gchar *old_folder_name,
                            const gchar *new_folder_name,
                            GError **error);

Renames tables for the `old_folder_name` to be used with `new_folder_name` .

#### Parameters

cdb | a CamelDB |
old_folder_name | full name of the existing folder |
new_folder_name | full name of the folder to rename it to |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_delete_folder ()

    gint
    camel_db_delete_folder (CamelDB *cdb,
                            const gchar *folder_name,
                            GError **error);

Deletes the given folder from the 'folders' table and also drops its message info table.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_delete_uid ()

    gint
    camel_db_delete_uid (CamelDB *cdb,
                         const gchar *folder_name,
                         const gchar *uid,
                         GError **error);

Deletes single mesage info in the given folder with the given UID.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
uid | a message info UID to delete |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_delete_uids ()

    gint
    camel_db_delete_uids (CamelDB *cdb,
                          const gchar *folder_name,
                          const GList *uids,
                          GError **error);

Deletes a list of message UIDs as one transaction.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
uids | A GList of uids. | [element-type utf8][transfer none]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_create_folders_table ()

    gint
    camel_db_create_folders_table (CamelDB *cdb,
                                   GError **error);

Creates a 'folders' table, if it doesn't exist yet.

#### Parameters

cdb | a CamelDB |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_select ()

    gint
    camel_db_select (CamelDB *cdb,
                     const gchar *stmt,
                     CamelDBSelectCB callback,
                     gpointer user_data,
                     GError **error);

Executes a SELECT staement and calls the `callback` for each selected row.

#### Parameters

cdb | a CamelDB |
stmt | a SELECT statment to execute |
callback | a callback to call for each row. | [scope call][closure user_data]
user_data | user data for the `callback` |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_write_folder_info_record ()

    gint
    camel_db_write_folder_info_record (CamelDB *cdb,
                                       CamelFIRecord *record,
                                       GError **error);

Write the `record` to the 'folders' table.

#### Parameters

cdb | a CamelDB |
record | a CamelFIRecord |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_read_folder_info_record ()

    gint
    camel_db_read_folder_info_record (CamelDB *cdb,
                                      const gchar *folder_name,
                                      CamelFIRecord *record,
                                      GError **error);

reads folder information for the given folder and stores it into the `record` .

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
record | a CamelFIRecord. | [out caller-allocates]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_prepare_message_info_table ()

    gint
    camel_db_prepare_message_info_table (CamelDB *cdb,
                                         const gchar *folder_name,
                                         GError **error);

Prepares message info table for the given folder.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_write_message_info_record ()

    gint
    camel_db_write_message_info_record (CamelDB *cdb,
                                        const gchar *folder_name,
                                        CamelMIRecord *record,
                                        GError **error);

Write the `record` to the message info table of the given folder.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
record | a CamelMIRecord |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_read_message_info_records ()

    gint
    camel_db_read_message_info_records (CamelDB *cdb,
                                        const gchar *folder_name,
                                        gpointer user_data,
                                        CamelDBSelectCB callback,
                                        GError **error);

Reads all mesasge info records for the given folder and calls `callback` for them.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
user_data | user data for the `callback` |
callback | callback to call for each found row. | [scope async][closure user_data]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### 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 user_data,
                                    CamelDBSelectCB callback,
                                    GError **error);

Selects single message info for the given `uid` in folder `folder_name` and calls the `callback` for it.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
uid | a message info UID to read the record for |
user_data | user data of the `callback` |
callback | callback to call for the found row. | [scope call][closure user_data]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_count_junk_message_info ()

    gint
    camel_db_count_junk_message_info (CamelDB *cdb,
                                      const gchar *table_name,
                                      guint32 *count,
                                      GError **error);

Counts how many junk messages is stored in the given table.

#### Parameters

cdb | a CamelDB |
table_name | name of the table |
count | where to store the resulting count. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_count_unread_message_info ()

    gint
    camel_db_count_unread_message_info (CamelDB *cdb,
                                        const gchar *table_name,
                                        guint32 *count,
                                        GError **error);

Counts how many unread messages is stored in the given table.

#### Parameters

cdb | a CamelDB |
table_name | name of the table |
count | where to store the resulting count. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_count_deleted_message_info ()

    gint
    camel_db_count_deleted_message_info (CamelDB *cdb,
                                         const gchar *table_name,
                                         guint32 *count,
                                         GError **error);

Counts how many deleted messages is stored in the given table.

#### Parameters

cdb | a CamelDB |
table_name | name of the table |
count | where to store the resulting count. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_count_total_message_info ()

    gint
    camel_db_count_total_message_info (CamelDB *cdb,
                                       const gchar *table_name,
                                       guint32 *count,
                                       GError **error);

Counts how many messages is stored in the given table.

#### Parameters

cdb | a CamelDB |
table_name | name of the table |
count | where to store the resulting count. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_count_visible_message_info ()

    gint
    camel_db_count_visible_message_info (CamelDB *cdb,
                                         const gchar *table_name,
                                         guint32 *count,
                                         GError **error);

Counts how many visible (not deleted and not junk) messages is stored in the given table.

#### Parameters

cdb | a CamelDB |
table_name | name of the table |
count | where to store the resulting count. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_count_visible_unread_message_info ()

    gint
    camel_db_count_visible_unread_message_info
                                   (CamelDB *cdb,
                                    const gchar *table_name,
                                    guint32 *count,
                                    GError **error);

Counts how many visible (not deleted and not junk) and unread messages is stored in the given table.

#### Parameters

cdb | a CamelDB |
table_name | name of the table |
count | where to store the resulting count. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### 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,
                                    GError **error);

### camel_db_count_message_info ()

    gint
    camel_db_count_message_info (CamelDB *cdb,
                                 const gchar *query,
                                 guint32 *count,
                                 GError **error);

Executes a `COUNT()` query (like "SELECT COUNT(*) FROM table") and provides the result of it as an unsigned 32-bit integer.

#### Parameters

cdb | a CamelDB |
query | a `COUNT()` query |
count | the result of the query. | [out]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.26

### camel_db_get_folder_uids ()

    gint
    camel_db_get_folder_uids (CamelDB *cdb,
                              const gchar *folder_name,
                              const gchar *sort_by,
                              const gchar *collate,
                              GHashTable *hash,
                              GError **error);

Fills hash with uid->GUINT_TO_POINTER (flag). Use `camel_pstring_free()` to free the keys of the `hash` .

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
sort_by | optional ORDER BY clause (without the "ORDER BY" prefix). | [nullable]
collate | optional collate function name to use. | [nullable]
hash | a hash table to fill. | [element-type utf8 guint32]
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.24

### camel_db_get_folder_junk_uids ()

    GPtrArray *
    camel_db_get_folder_junk_uids (CamelDB *cdb,
                                   const gchar *folder_name,
                                   GError **error);

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
error | return location for a GError, or `NULL` |

#### Returns

An array of the UID-s of the junk messages in the given folder. Use `camel_pstring_free()` to free the elements.

[element-type utf8][transfer full][nullable]

Since: 2.24

### camel_db_get_folder_deleted_uids ()

    GPtrArray *
    camel_db_get_folder_deleted_uids (CamelDB *cdb,
                                      const gchar *folder_name,
                                      GError **error);

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
error | return location for a GError, or `NULL` |

#### Returns

An array of the UID-s of the deleted messages in the given folder. Use `camel_pstring_free()` to free the elements.

[element-type utf8][transfer full][nullable]

Since: 2.24

### camel_db_set_collate ()

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

Defines a collation `collate` , which can be used in SQL (SQLite) statement as a collation function. The `func` is called when colation is used.

#### Parameters

cdb | a CamelDB |
col | a column name; currently unused |
collate | collation name |
func | a CamelDBCollate collation function. | [scope call]

Since: 2.24

### camel_db_start_in_memory_transactions ()

    gint
    camel_db_start_in_memory_transactions (CamelDB *cdb,
                                           GError **error);

Creates an in-memory table for a batch transactions. Use `camel_db_flush_in_memory_transactions()` to commit the changes and free the in-memory table.

#### Parameters

cdb | a CamelDB |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.26

### camel_db_flush_in_memory_transactions ()

    gint
    camel_db_flush_in_memory_transactions (CamelDB *cdb,
                                           const gchar *folder_name,
                                           GError **error);

A pair function for `camel_db_start_in_memory_transactions()`, to commit the changes to `folder_name` and free the in-memory table.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.26

### camel_db_reset_folder_version ()

    gint
    camel_db_reset_folder_version (CamelDB *cdb,
                                   const gchar *folder_name,
                                   gint reset_version,
                                   GError **error);

Sets a version number for the given folder.

#### Parameters

cdb | a CamelDB |
folder_name | full name of the folder |
reset_version | version number to set |
error | return location for a GError, or `NULL` |

#### Returns

0 on success, -1 on error

Since: 2.28

### camel_db_maybe_run_maintenance ()

    gboolean
    camel_db_maybe_run_maintenance (CamelDB *cdb,
                                    GError **error);

Runs a `cdb` maintenance, which includes vacuum, if necessary.

#### Parameters

cdb | a CamelDB |
error | a GError or `NULL` |

#### Returns

Whether succeeded.

Since: 3.16

### camel_db_release_cache_memory ()

    void
    camel_db_release_cache_memory (void);

Instructs sqlite to release its memory, if possible. This can be avoided when CAMEL_SQLITE_FREE_CACHE environment variable is set.

Since: 3.24

### camel_db_sqlize_string ()

    gchar *
    camel_db_sqlize_string (const gchar *string);

Converts the `string` to be usable in the SQLite statements.

#### Parameters

string | a string to "sqlize" |

#### Returns

A newly allocated sqlized `string` . The returned value should be freed with `camel_db_sqlize_string()`, when no longer needed.

[transfer full]

Since: 2.24

### camel_db_free_sqlized_string ()

    void
    camel_db_free_sqlized_string (gchar *string);

Frees a string previosuly returned by `camel_db_sqlize_string()`.

#### Parameters

string | a string to free. | [nullable]

Since: 2.24

### camel_db_get_column_name ()

    gchar *
    camel_db_get_column_name (const gchar *raw_name);

#### Parameters

raw_name | raw name to find the column name for |

#### Returns

A corresponding column name in the message info table for the `raw_name` , or `NULL`, when there is no corresponding column in the summary.

[nullable]

Since: 2.24

### camel_db_camel_mir_free ()

    void
    camel_db_camel_mir_free (CamelMIRecord *record);

Frees the `record` and all of its associated data.

#### Parameters

record | a CamelMIRecord. | [nullable]

Since: 2.24

## Types and Values

### CAMEL_DB_ERROR

    #define             CAMEL_DB_ERROR

Since: 3.44

### enum CamelDBError

#### Members

CAMEL_DB_ERROR_CORRUPT | database is corrupt |

Since: 3.44

### struct CamelDB

    struct CamelDB;

Since: 2.24

### CAMEL_DB_FILE

    #define CAMEL_DB_FILE "folders.db"

Since: 2.24

### CAMEL_DB_IN_MEMORY_TABLE

    #define CAMEL_DB_IN_MEMORY_TABLE "EVO_IN_meM_hAnDlE.temp"

Since: 2.26

### CAMEL_DB_IN_MEMORY_TABLE_LIMIT

    #define CAMEL_DB_IN_MEMORY_TABLE_LIMIT 100000

Since: 2.26

### CAMEL_DB_FREE_CACHE_SIZE

    #define CAMEL_DB_FREE_CACHE_SIZE 2 * 1024 * 1024

Since: 2.24

### CAMEL_DB_SLEEP_INTERVAL

    #define CAMEL_DB_SLEEP_INTERVAL 1*10*10

Since: 2.24

### CamelMIRecord

    typedef struct {
    	const gchar *uid; /* stored in the string pool */
    	guint32 flags;
    	guint32 msg_type;
    	guint32 dirty;
    	gboolean read;
    	gboolean deleted;
    	gboolean replied;
    	gboolean important;
    	gboolean junk;
    	gboolean attachment;
    	guint32 size;
    	gint64 dsent; /* time_t */
    	gint64 dreceived; /* time_t */
    	const gchar *subject; /* stored in the string pool */
    	const gchar *from; /* stored in the string pool */
    	const gchar *to; /* stored in the string pool */
    	const gchar *cc; /* stored in the string pool */
    	const gchar *mlist; /* stored in the string pool */
    	gchar *followup_flag;
    	gchar *followup_completed_on;
    	gchar *followup_due_by;
    	gchar *part;
    	gchar *labels;
    	gchar *usertags;
    	gchar *cinfo;
    	gchar *bdata;
    	gchar *userheaders;
    	gchar *preview;
    } CamelMIRecord;

The extensive DB format, supporting basic searching and sorting.

#### Members

const gchar *`uid`; | Message UID |
guint32 `flags`; | Camel Message info flags |
guint32 `msg_type`; | unused |
guint32 `dirty`; | whether the message info requires upload to the server; it corresponds to CAMEL_MESSAGE_FOLDER_FLAGGED |
gboolean `read`; | boolean read status |
gboolean `deleted`; | boolean deleted status |
gboolean `replied`; | boolean replied status |
gboolean `important`; | boolean important status |
gboolean `junk`; | boolean junk status |
gboolean `attachment`; | boolean attachment status |
guint32 `size`; | size of the mail |
gint64 `dsent`; | date sent |
gint64 `dreceived`; | date received |
const gchar *`subject`; | subject of the mail |
const gchar *`from`; | sender |
const gchar *`to`; | recipient |
const gchar *`cc`; | CC members |
const gchar *`mlist`; | message list headers |
gchar *`followup_flag`; | followup flag / also can be queried to see for followup or not |
gchar *`followup_completed_on`; | completed date, can be used to see if completed |
gchar *`followup_due_by`; | to see the due by date |
gchar *`part`; | part / references / thread id |
gchar *`labels`; | labels of mails also called as userflags |
gchar *`usertags`; | composite string of user tags |
gchar *`cinfo`; | content info string - composite string |
gchar *`bdata`; | provider specific data |
gchar *`userheaders`; | value for user-defined message headers; Since: 3.42 |
gchar *`preview`; | message body preview; Since: 3.42 |

Since: 2.24

### CamelFIRecord

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

Values to store/load for single folder's CamelFolderSummary structure.

#### Members

gchar *`folder_name`; | name of the folder |
guint32 `version`; | version of the saved information |
guint32 `flags`; | folder flags |
guint32 `nextuid`; | next free uid |
gint64 `timestamp`; | timestamp of the summary |
guint32 `saved_count`; | count of all messages |
guint32 `unread_count`; | count of unread messages |
guint32 `deleted_count`; | count of deleted messages |
guint32 `junk_count`; | count of junk messages |
guint32 `visible_count`; | count of visible (not deleted and not junk) messages |
guint32 `jnd_count`; | count of junk and not deleted messages |
gchar *`bdata`; | custom data of the CamelFolderSummary descendants |

Since: 2.24

### enum CamelDBKnownColumnNames

An enum of all the known columns, which can be used for a quick column lookups.

#### Members

CAMEL_DB_COLUMN_UNKNOWN | unknown column name |
CAMEL_DB_COLUMN_ATTACHMENT | attachment |
CAMEL_DB_COLUMN_BDATA | bdata |
CAMEL_DB_COLUMN_CINFO | cinfo |
CAMEL_DB_COLUMN_DELETED | deleted |
CAMEL_DB_COLUMN_DELETED_COUNT | deleted_count |
CAMEL_DB_COLUMN_DRECEIVED | dreceived |
CAMEL_DB_COLUMN_DSENT | dsent |
CAMEL_DB_COLUMN_FLAGS | flags |
CAMEL_DB_COLUMN_FOLDER_NAME | folder_name |
CAMEL_DB_COLUMN_FOLLOWUP_COMPLETED_ON | followup_completed_on |
CAMEL_DB_COLUMN_FOLLOWUP_DUE_BY | followup_due_by |
CAMEL_DB_COLUMN_FOLLOWUP_FLAG | followup_flag |
CAMEL_DB_COLUMN_IMPORTANT | important |
CAMEL_DB_COLUMN_JND_COUNT | jnd_count |
CAMEL_DB_COLUMN_JUNK | junk |
CAMEL_DB_COLUMN_JUNK_COUNT | junk_count |
CAMEL_DB_COLUMN_LABELS | labels |
CAMEL_DB_COLUMN_MAIL_CC | mail_cc |
CAMEL_DB_COLUMN_MAIL_FROM | mail_from |
CAMEL_DB_COLUMN_MAIL_TO | mail_to |
CAMEL_DB_COLUMN_MLIST | mlist |
CAMEL_DB_COLUMN_NEXTUID | nextuid |
CAMEL_DB_COLUMN_PART | part |
CAMEL_DB_COLUMN_PREVIEW | preview |
CAMEL_DB_COLUMN_READ | read |
CAMEL_DB_COLUMN_REPLIED | replied |
CAMEL_DB_COLUMN_SAVED_COUNT | saved_count |
CAMEL_DB_COLUMN_SIZE | size |
CAMEL_DB_COLUMN_SUBJECT | subject |
CAMEL_DB_COLUMN_TIME | time |
CAMEL_DB_COLUMN_UID | uid |
CAMEL_DB_COLUMN_UNREAD_COUNT | unread_count |
CAMEL_DB_COLUMN_USERHEADERS | userheaders |
CAMEL_DB_COLUMN_USERTAGS | usertags |
CAMEL_DB_COLUMN_VERSION | version |
CAMEL_DB_COLUMN_VISIBLE_COUNT | visible_count |
CAMEL_DB_COLUMN_VUID | vuid |

Since: 3.4