Gom.Adapter

g GObject.Object GObject.Object Gom.Adapter Gom.Adapter GObject.Object->Gom.Adapter

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

close_async (callback, *user_data)

close_finish (result)

close_sync ()

execute_sql (sql)

get_handle ()

open_async (uri, callback, *user_data)

open_finish (result)

open_sync (uri)

queue_read (callback, *user_data)

queue_write (callback, *user_data)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Gom.Adapter(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gom.AdapterClass

classmethod new()
Return type:

Gom.Adapter

close_async(callback, *user_data)
Parameters:
close_finish(result)
Parameters:

result (Gio.AsyncResult) –

Raises:

GLib.Error

Return type:

bool

close_sync()
Raises:

GLib.Error

Return type:

bool

execute_sql(sql)
Parameters:

sql (str) – SQL to execute.

Raises:

GLib.Error

Returns:

True if successful;

Return type:

bool

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().

get_handle()
Returns:

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

Return type:

object or None

Fetches the sqlite3 structure used by the adapter.

open_async(uri, callback, *user_data)
Parameters:
  • uri (str) – a URI understood by SQLite

  • callback (Gio.AsyncReadyCallback or None) – the function to call when the operation finished, or None

  • user_data (object or None) – the user data to pass to the callback function

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.

open_finish(result)
Parameters:

result (Gio.AsyncResult) –

Raises:

GLib.Error

Return type:

bool

open_sync(uri)
Parameters:

uri (str) –

Raises:

GLib.Error

Return type:

bool

queue_read(callback, *user_data)
Parameters:

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

queue_write(callback, *user_data)
Parameters:

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