## GomAdapter GomAdapter |

## Functions

#define | GOM_ADAPTER_CONST()
void | (*GomAdapterCallback) ()
gboolean | gom_adapter_close_sync ()
void | gom_adapter_close_async ()
gboolean | gom_adapter_close_finish ()
gpointer | gom_adapter_get_handle ()
GomAdapter * | gom_adapter_new ()
gboolean | gom_adapter_open_sync ()
void | gom_adapter_open_async ()
gboolean | gom_adapter_open_finish ()
void | gom_adapter_queue_read ()
void | gom_adapter_queue_write ()
gboolean | gom_adapter_execute_sql ()

## Object Hierarchy

        GObject
        ╰── GomAdapter

## Description

## Functions

### GOM_ADAPTER_CONST()

    #define GOM_ADAPTER_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOM_TYPE_ADAPTER, GomAdapter const))

### GomAdapterCallback ()

    void
    (*GomAdapterCallback) (GomAdapter *adapter,
                           gpointer user_data);

### gom_adapter_close_sync ()

    gboolean
    gom_adapter_close_sync (GomAdapter *adapter,
                            GError **error);

### gom_adapter_close_async ()

    void
    gom_adapter_close_async (GomAdapter *adapter,
                             GAsyncReadyCallback callback,
                             gpointer user_data);

### gom_adapter_close_finish ()

    gboolean
    gom_adapter_close_finish (GomAdapter *adapter,
                              GAsyncResult *result,
                              GError **error);

### gom_adapter_get_handle ()

    gpointer
    gom_adapter_get_handle (GomAdapter *adapter);

Fetches the sqlite3 structure used by the adapter.

#### Parameters

adapter | A GomAdapter. | [in]

#### Returns

A handle to the sqlite3 structure. Side effects: None.

[transfer none]

### gom_adapter_new ()

    GomAdapter *
    gom_adapter_new (void);

### gom_adapter_open_sync ()

    gboolean
    gom_adapter_open_sync (GomAdapter *adapter,
                           const gchar *uri,
                           GError **error);

### gom_adapter_open_async ()

    void
    gom_adapter_open_async (GomAdapter *adapter,
                            const gchar *uri,
                            GAsyncReadyCallback callback,
                            gpointer user_data);

Opens the database pointed to by `uri` . `uri` can be in any format understood by SQLite. See http://www.sqlite.org/c3ref/open.html for details.

#### Parameters

adapter | a GomAdapter |
uri | a URI understood by SQLite |
callback | the function to call when the operation finished, or `NULL` |
user_data | the user data to pass to the callback function |

### gom_adapter_open_finish ()

    gboolean
    gom_adapter_open_finish (GomAdapter *adapter,
                             GAsyncResult *result,
                             GError **error);

### gom_adapter_queue_read ()

    void
    gom_adapter_queue_read (GomAdapter *adapter,
                            GomAdapterCallback callback,
                            gpointer user_data);

Queues a callback to be executed within the SQLite thread. The callback is expected to perform reads only.

#### Parameters

adapter | A GomAdapter. | [in]
callback | A callback to execute read queries on SQLite. | [in][scope async]
user_data | User data for `callback` . | [in]

### gom_adapter_queue_write ()

    void
    gom_adapter_queue_write (GomAdapter *adapter,
                             GomAdapterCallback callback,
                             gpointer user_data);

Queues a callback to be executed within the SQLite thwrite. The callback can perform reads and writes.

#### Parameters

adapter | A GomAdapter. | [in]
callback | A callback to execute write queries on SQLite. | [in][scope async]
user_data | User data for `callback` . | [in]

### gom_adapter_execute_sql ()

    gboolean
    gom_adapter_execute_sql (GomAdapter *adapter,
                             const gchar *sql,
                             GError **error);

This is a helper function to make simple execution of SQL easier. It is primarily meant for things like "BEGIN;" and "COMMIT;".

This MUST be called from within a write transaction using `gom_adapter_queue_write()`.

#### Parameters

adapter | A GomAdapter. |
sql | SQL to execute. |
error | a GError |

#### Returns

`TRUE` if successful;

## Types and Values