Relation

class Relation(val glibRelationPointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance(source)

⚠️ Deprecated ⚠️

This is deprecated since version 2.26.

Rarely used API

---

A GRelation is a table of data which can be indexed on any number of fields, rather like simple database tables. A GRelation contains a number of records, called tuples. Each record contains a number of fields. Records are not ordered, so it is not possible to find the record at a particular index.

Note that GRelation tables are currently limited to 2 fields.

To create a GRelation, use func@GLib.Relation.new.

To specify which fields should be indexed, use method@GLib.Relation.index. Note that this must be called before any tuples are added to the GRelation.

To add records to a GRelation use method@GLib.Relation.insert.

To determine if a given record appears in a GRelation, use method@GLib.Relation.exists. Note that fields are compared directly, so pointers must point to the exact same position (i.e. different copies of the same string will not match.)

To count the number of records which have a particular value in a given field, use method@GLib.Relation.count.

To get all the records which have a particular value in a given field, use method@GLib.Relation.select. To access fields of the resulting records, use method@GLib.Tuples.index. To free the resulting records use method@GLib.Tuples.destroy.

To delete all records which have a particular value in a given field, use method@GLib.Relation.delete.

To destroy the GRelation, use method@GLib.Relation.destroy.

To help debug GRelation objects, use method@GLib.Relation.print.

GRelation has been marked as deprecated, since this API has never been fully implemented, is not very actively maintained and rarely used.

Skipped during bindings generation

  • method exists: Varargs parameter is not supported

  • parameter hash_func: HashFunc

  • method insert: Varargs parameter is not supported

Constructors

Link copied to clipboard
constructor(glibRelationPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val glibRelationPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>

Functions

Link copied to clipboard
open override fun addCleaner(cleaner: <Error class: unknown class>): Boolean

Registers a cleaner to be executed when this proxy object is garbage collected.

Link copied to clipboard
fun count(key: <Error class: unknown class>? = null, field: <Error class: unknown class>): <Error class: unknown class>

This is deprecated since version 2.26.

Link copied to clipboard
fun delete(key: <Error class: unknown class>? = null, field: <Error class: unknown class>): <Error class: unknown class>

This is deprecated since version 2.26.

Link copied to clipboard
fun destroy()

This is deprecated since version 2.26.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun print()

This is deprecated since version 2.26.

Link copied to clipboard
open override fun removeCleaner(cleaner: <Error class: unknown class>): Boolean

Removes a previously registered cleaner from this proxy object.

Link copied to clipboard
fun select(key: <Error class: unknown class>? = null, field: <Error class: unknown class>): Tuples

This is deprecated since version 2.26.