Gom.CommandBuilder

g GObject.Object GObject.Object Gom.CommandBuilder Gom.CommandBuilder GObject.Object->Gom.CommandBuilder

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

build_count ()

build_create (version)

build_delete ()

build_insert (resource)

build_select ()

build_update (resource)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

adapter

Gom.Adapter

r/w/co

The Gom.Adapter.

filter

Gom.Filter

r/w

The filter for the command.

limit

int

r/w

The maximum number of results.

m2m-table

str

r/w/co

The table to use for many-to-many queries.

m2m-type

GObject.GType

r/w/co

The type for the join within m2m-table.

offset

int

r/w

The number of results to skip.

resource-type

GObject.GType

r/w

The resource type to query for.

sorting

Gom.Sorting

r/w

The sorting for the command.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Gom.CommandBuilder(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gom.CommandBuilderClass

build_count()
Returns:

A Gom.Command.

Return type:

Gom.Command

Builds a new command that will count the number of rows matching the current query parameters.

build_create(version)
Parameters:

version (int) – the version of the database.

Returns:

A GLib.List of Gom.Command.

Return type:

[Gom.Command]

Builds a list of Gom.Command to update the table for the resource_type associated with self up to version.

build_delete()
Returns:

A Gom.Command.

Return type:

Gom.Command

Builds a new Gom.Command to delete the rows matching the current query params.

build_insert(resource)
Parameters:

resource (Gom.Resource) – a Gom.Resource

Returns:

A Gom.Command.

Return type:

Gom.Command

Builds a new Gom.Command that will insert the parameters of the resource into the underlying database.

build_select()
Returns:

A Gom.Command.

Return type:

Gom.Command

Builds a Gom.Command that will select all the rows matching the current query params.

build_update(resource)
Parameters:

resource (Gom.Resource) – a Gom.Resource

Returns:

A Gom.Command.

Return type:

Gom.Command

Builds a new Gom.Command that will update the contents stored for resource in the underlying database.

Property Details

Gom.CommandBuilder.props.adapter
Name:

adapter

Type:

Gom.Adapter

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gom.Adapter.

Gom.CommandBuilder.props.filter
Name:

filter

Type:

Gom.Filter

Default Value:

None

Flags:

READABLE, WRITABLE

The filter for the command.

Gom.CommandBuilder.props.limit
Name:

limit

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The maximum number of results.

Gom.CommandBuilder.props.m2m_table
Name:

m2m-table

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The table to use for many-to-many queries.

Gom.CommandBuilder.props.m2m_type
Name:

m2m-type

Type:

GObject.GType

Default Value:

<GType GomResource>

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The type for the join within m2m-table.

Gom.CommandBuilder.props.offset
Name:

offset

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The number of results to skip.

Gom.CommandBuilder.props.resource_type
Name:

resource-type

Type:

GObject.GType

Default Value:

<GType GomResource>

Flags:

READABLE, WRITABLE

The resource type to query for.

Gom.CommandBuilder.props.sorting
Name:

sorting

Type:

Gom.Sorting

Default Value:

None

Flags:

READABLE, WRITABLE

The sorting for the command.