Xmlb.Query

g GObject.Object GObject.Object Xmlb.Query Xmlb.Query GObject.Object->Xmlb.Query

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (silo, xpath)

class

new_full (silo, xpath, flags)

bind_str (idx, str)

bind_val (idx, val)

get_flags ()

get_limit ()

get_xpath ()

set_flags (flags)

set_limit (limit)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Xmlb.Query(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Xmlb.QueryClass

classmethod new(silo, xpath)
Parameters:
Raises:

GLib.Error

Returns:

a Xmlb.Query

Return type:

Xmlb.Query

Creates a query to be used by silo. It may be quicker to create a query manually and re-use it multiple times.

New in version 0.1.4.

classmethod new_full(silo, xpath, flags)
Parameters:
Raises:

GLib.Error

Returns:

a Xmlb.Query

Return type:

Xmlb.Query

Creates a query to be used by silo. It may be quicker to create a query manually and re-use it multiple times.

The query will point to strings inside silo, so the lifetime of silo must exceed the lifetime of the returned query.

New in version 0.1.6.

bind_str(idx, str)
Parameters:
  • idx (int) – an integer index

  • str (str) – string to assign to the bound variable

Raises:

GLib.Error

Returns:

True if the idx existed

Return type:

bool

Assigns a string to a bound value specified using ?.

New in version 0.1.4.

Deprecated since version 0.3.0: Use Xmlb.ValueBindings and Xmlb.ValueBindings.bind_str() instead. That keeps the value bindings separate from the Xmlb.Query, allowing queries to be re-used over time and between threads.

bind_val(idx, val)
Parameters:
  • idx (int) – an integer index

  • val (int) – value to assign to the bound variable

Raises:

GLib.Error

Returns:

True if the idx existed

Return type:

bool

Assigns a string to a bound value specified using ?.

New in version 0.1.4.

Deprecated since version 0.3.0: Use Xmlb.ValueBindings and Xmlb.ValueBindings.bind_val() instead. That keeps the value bindings separate from the Xmlb.Query, allowing queries to be re-used over time and between threads.

get_flags()
Returns:

Xmlb.QueryFlags, default Xmlb.QueryFlags.NONE

Return type:

Xmlb.QueryFlags

Gets the flags used for this query.

New in version 0.1.15.

Deprecated since version 0.3.0: This is not thread-safe. Use Xmlb.QueryContext.get_flags() instead.

get_limit()
Returns:

integer, default 0

Return type:

int

Gets the results limit on this query, where 0 is ‘all’.

New in version 0.1.4.

Deprecated since version 0.3.0: This is not thread-safe. Use Xmlb.QueryContext.get_limit() instead.

get_xpath()
Returns:

string

Return type:

str

Gets the XPath string that created the query.

New in version 0.1.4.

set_flags(flags)
Parameters:

flags (Xmlb.QueryFlags) – a Xmlb.QueryFlags, e.g. Xmlb.QueryFlags.USE_INDEXES

Sets the flags to use for this query.

New in version 0.1.15.

Deprecated since version 0.3.0: This is not thread-safe. Use Xmlb.QueryContext.set_flags() instead.

set_limit(limit)
Parameters:

limit (int) – integer

Sets the results limit on this query, where 0 is ‘all’.

New in version 0.1.4.

Deprecated since version 0.3.0: This is not thread-safe. Use Xmlb.QueryContext.set_limit() instead.