Camel.DB
Description: Reference for Camel.DB

### Class

# CamelDB

since: 2.24

#### Description

    class Camel.DB : GObject.Object
    {
      /* No available fields */
    }

No description available.

Available since: 2.24

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- CamelStoreDB

#### Constructors

###### camel_db_new

Creates a new `CamelDB` instance and calls `camel_db_open()` to open a database file. Free the returned object with g_object_unref(), when no longer needed.

since: 3.58

#### Functions

###### camel_db_error_quark

No description available.

###### camel_db_free_sqlized_string

Frees a string previously returned by camel_db_sqlize_string().

since: 2.24

###### camel_db_release_cache_memory

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

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

since: 2.24

###### camel_db_sqlize_to_statement

Encodes the `str` to be safe to use as a string in an SQL statement and appends it to the `stmt`. When `str` is `NULL`, a NULL word is appended.

since: 3.58

#### Instance methods

###### camel_db_abort_transaction

Ends an ongoing transaction by ignoring the changes.

since: 3.58

###### camel_db_begin_transaction

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

since: 3.58

###### camel_db_end_transaction

Ends an ongoing transaction by committing the changes.

since: 3.58

###### camel_db_exec_select

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

since: 3.58

###### camel_db_exec_statement

Executes an SQLite statement.

since: 3.58

###### camel_db_get_filename

No description available.

since: 3.24

###### camel_db_has_table

Checks whether the `table_name` exists in the `cdb`.

since: 3.58

###### camel_db_has_table_with_column

Checks whether the `table_name` exists in the `cdb` and contains column named `column_name`.

since: 3.58

###### camel_db_maybe_run_maintenance

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

since: 3.16

###### camel_db_open

Opens the database stored as `filename`. The function can be called only once, all following calls will result into failures.

since: 3.58

###### camel_db_reader_lock

Acquires a reader lock on the `cdb`. It can be called multiple times. Call pair function `camel_db_reader_unlock()` to release it. it’s okay to call this function when a writer lock is already acquired by the calling thread.

since: 3.58

###### camel_db_reader_unlock

Releases a reader lock on the `cdb` previously acquired by calling camel_db_reader_lock().

since: 3.58

###### camel_db_set_collate

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

since: 2.24

###### camel_db_writer_lock

Acquires a writer lock on the `cdb`. It can be called multiple times. Call pair function `camel_db_writer_unlock()` to release it.

since: 3.58

###### camel_db_writer_unlock

Releases a write lock on the `cdb` previously acquired by calling camel_db_writer_lock().

since: 3.58

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct CamelDBClass {
      /* no available fields */
    }

No description available.