Skip to content

πŸŽ™οΈ task - dream: convert uuid arrays to native uuid[] columnsΒ #89

Description

@ehm-a-beaver

πŸ¦«πŸŽ™οΈ dispatch to foreman

πŸ’§ task enqueued
   β”œβ”€ priority = ?
   β”œβ”€ yieldage = ?
   └─ leverage = ?

title
dream: convert uuid arrays to native uuid[] columns
description

dream: convert uuid arrays to native uuid[] columns

.what

teach sql-schema-generator to store ARRAY_OF(UUID()) as a native uuid[] column on
the base/version table, instead of the current join-table model (a child _uuid table
plus an array_order_index column).

.why

the native-primitive-enum-array-columns wish adds native array storage for
primitive/enum element arrays, but keeps uuid arrays on the join-table path, per its
stated scope. yet the decisive reason join tables exist for reference arrays β€” postgres
cannot put a foreign-key constraint on an array element [1] β€” does NOT apply to a bare
UUID(). a UUID() array carries no FK today (its child table holds a plain uuid column,
not a FK to a parent). so by the same logic that puts primitives on the native path,
uuid[] belongs there too.

benefits:

  • one uniform array model: primitive + enum + uuid β†’ native column; reference β†’ join table
  • faster single-table reads, with no array_agg join collapse in the view
  • drops the _uuid child table and its array_order_index overhead

.cons to weigh

  • migration cost β€” uuid arrays are the one array kind with real prior use (the extant
    integration tests exercise _uuids). a switch changes already-generated schemas and
    forces a data migration for any consumer that uses them today β€” a break, not an additive
    change.
  • two-way door β€” the hydrated view presents either storage as uuid[], so the move can
    be made later with no DAO-visible contract change. no rush; low risk to defer.

.depends on

  • the native-primitive-enum-array-columns wish ships first β€” it builds the native array
    machinery (DDL column path, upsert single-value write, view straight-through select,
    value-equality change-detection) that this dream reuses. once that lands, a native branch
    that also accepts a UUID() element is a contained addition.

.source

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions