Skip to main content

Module composites

Module composites 

Source
Expand description

Composite type values through the statement’s catalog: attribute metadata, record_in input and the coercion of rows and records to a composite type.

A composite value is a Value::Record whose fields carry the type’s current attribute names in attribute order. Anonymous row constructors are Value::Row until a coercion gives them a composite type.

Modules§

constants
Apply a descriptor change to typed catalog datums without re-reading input text or repeating domain constraints.
constructor
Evaluate retained row positions against the current composite descriptor.
literal
Read an already admitted constant through the current descriptor. Added fields are NULL even when their domains reject fresh NULL inputs; the retained value and its input expression remain unchanged.

Structs§

CompositeAttribute
One live attribute of a composite type in attribute-number order.
CompositeTypeDescriptor
The live attributes of one composite type in the statement’s catalog generation.

Enums§

AttributeChange
A change to one composite type’s attributes, applied to the type’s values.

Traits§

CompositeTypeCatalog
Catalog access for composite values, supplied by the statement’s execution context and by catalog-aware binding.

Functions§

apply_attribute_change
Apply change to every value of the composite type target in value, which has the declared type ty. Nested composite values are rewritten through their types’ attributes before the change.
cast_to_composite
Cast a value to a composite type: the identity for a value of the same type, record_in for unknown literals and string-category sources, and attribute-wise coercion for anonymous rows and records. Returns None when the target is not a composite type.
composite_from_text
record_in for a composite type: the fields are split and each is converted in order, so a field’s input error precedes a later structural error.
descriptor
The attributes of a composite type the statement’s catalog must contain.
parse_record_fields
Split text into columns fields as record_in does, handing each field to field as soon as it is read: None is a NULL field. Leading and trailing whitespace around the parentheses is allowed; whitespace inside an unquoted field belongs to the field.
type_contains_composite
Whether values of ty can hold values of the composite type target.