Gom.Repository¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The adapter for the repository. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Gom.Repository(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(adapter)¶
- Parameters:
adapter (
Gom.Adapter
) –- Return type:
- automatic_migrate_async(version, object_types, callback, *user_data)¶
- Parameters:
version (
int
) – The version to migrate to.object_types ([
GObject.GType
]) – aGLib.List
ofGObject.GType
callback (
Gio.AsyncReadyCallback
orNone
) – A callback to execute upon completion.
Performs an automatic migration on the underlying database. See
Gom.Repository.automatic_migrate_sync
() for details.Upon completion, callback will be executed and it must call
Gom.Repository.automatic_migrate_finish
().
- automatic_migrate_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) –- Raises:
- Return type:
- automatic_migrate_sync(version, object_types)¶
- Parameters:
version (
int
) – The version to migrate to.object_types ([
GObject.GType
]) – aGLib.List
ofGObject.GType
- Raises:
- Returns:
True
in case of success.- Return type:
Performs an automatic migration on the underlying database. For each of the
GObject.GType
passed in object_types, the table will be created if necessary, and each of the columns corresponding to properties will be added if needed.
- find_async(resource_type, filter, callback, *user_data)¶
- Parameters:
resource_type (
GObject.GType
) –filter (
Gom.Filter
) –callback (
Gio.AsyncReadyCallback
orNone
) –
- find_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
- Return type:
Completes an asynchronous request to fetch a group of resources.
- find_one_async(resource_type, filter, callback, *user_data)¶
- Parameters:
resource_type (
GObject.GType
) –filter (
Gom.Filter
) –callback (
Gio.AsyncReadyCallback
orNone
) –
- find_one_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
.- Raises:
- Returns:
A
Gom.Resource
if successful, otherwiseNone
.- Return type:
Completes an asynchronous request to find a single resource in the repository. See
Gom.Repository.find_one_async
() for more info.
- find_one_sync(resource_type, filter)¶
- Parameters:
resource_type (
GObject.GType
) – AGObject.GType
of the resource to lookup.filter (
Gom.Filter
orNone
) – AGom.Filter
to apply to your search.
- Raises:
- Returns:
A
Gom.Resource
orNone
.- Return type:
Synchronous version of
Gom.Repository.find_async
().
- find_sorted_async(resource_type, filter, sorting, callback, *user_data)¶
- Parameters:
resource_type (
GObject.GType
) –filter (
Gom.Filter
) –sorting (
Gom.Sorting
) –callback (
Gio.AsyncReadyCallback
orNone
) –
- find_sorted_sync(resource_type, filter, sorting)¶
- Parameters:
resource_type (
GObject.GType
) – TheGObject.GType
of the resources to query.filter (
Gom.Filter
orNone
) – An optional filter for the query.sorting (
Gom.Sorting
orNone
) – An optionalGom.Sorting
to order the query results.
- Raises:
- Returns:
A
Gom.ResourceGroup
orNone
.- Return type:
Synchronously queries the
Gom.Repository
for objects matching the requested query. This must only be run from a callback provided toGom.Adapter.queue_read
().
- find_sync(resource_type, filter)¶
- Parameters:
resource_type (
GObject.GType
) – TheGObject.GType
of the resources to query.filter (
Gom.Filter
orNone
) – An optional filter for the query.
- Raises:
- Returns:
A
Gom.ResourceGroup
orNone
.- Return type:
Synchronously queries the
Gom.Repository
for objects matching the requested query. This must only be run from a callback provided toGom.Adapter.queue_read
().
- get_adapter()¶
- Returns:
A
Gom.Adapter
.- Return type:
Fetches the underlying adapter.
- migrate_async(version, migrator, migrator_data, callback, *user_data)¶
- Parameters:
version (
int
) – The version to migrate to.migrator (
Gom.RepositoryMigrator
) – A function to perform the migrations.callback (
Gio.AsyncReadyCallback
orNone
) – A callback to execute upon completion.
Asynchronously performs a migration on the underlying database. This will call migrator from the SQLite thread for each migration to perform.
Upon completion, callback will be executed and it must call
Gom.Repository.migrate_finish
().
- migrate_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) –- Raises:
- Return type:
- migrate_sync(version, migrator, *migrator_data)¶
- Parameters:
version (
int
) – The version to migrate to.migrator (
Gom.RepositoryMigrator
) – A function to perform the migrations.
- Raises:
- Returns:
True
in case of success.- Return type:
Performs a migration on the underlying database. This will call migrator from the SQLite thread for each migration to perform.
Property Details¶
- Gom.Repository.props.adapter¶
- Name:
adapter
- Type:
- Default Value:
- Flags:
The adapter for the repository.