Basics
Guides
API Reference
Basics
Guides
API Reference
[34:7] extends: object
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.
Relation (Handle = null)
Creates a new
Relationby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.