Sha256: 4034e6ef373a83dbf08a7b5fd30874b210f7f9f1518233101fc618bc986a1252

Contents?: true

Size: 882 Bytes

Versions: 6

Compression:

Stored size: 882 Bytes

Contents

# Unwrap

Inverse of wrap

## Signature

unwrap(operand: Relation, tva: AttrName) -> Relation

## Examples

unwrap(wrap(suppliers, [:city, :status], :extra), :extra)

## Description

Computes the relation obtained by unwrapping a tuple-valued attribute `tva`.
Unwrapping of `tva` on an input tuple `t` consists in removing `tva` from
`t` and extending the result with `tva`'s own attributes:

Tuple(x: 1, tva: Tuple(y: 2, z: 3)) -> Tuple(x: 1, y: 2, z: 3)

`tva` must be a tuple-valued attribute. It should not itself contain any
attribute whose name clashes with an attribute of `operand`. In the examples
above, `tva` may not contain an attribute called `x`.

## Implementation notes

This operator does not compile to SQL so far. Contributions are welcome to
provide it with a SQL compilation for SQL DBMSs that support this kind of
feature (e.g. PostgreSQL with JSON data type)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alf-shell-0.16.4 doc/txt/unwrap.txt
alf-shell-0.16.3 doc/txt/unwrap.txt
alf-shell-0.16.2 doc/txt/unwrap.txt
alf-shell-0.16.1 doc/txt/unwrap.txt
alf-shell-0.16.0 doc/txt/unwrap.txt
alf-shell-0.15.0 doc/txt/unwrap.txt