Datatable

SolidGroundUX DocumentationSolidGroundUX
NL

Provide lightweight tabular data structures and utilities

Source: target-root/usr/local/lib/solidgroundux/common/sgnd-datatable.sh

Provide lightweight tabular data structures and utilities

Public functions

Internal functions
FunctionPurposeArgumentsOutput
_sgnd_lib_guardEnsure direct execution is rejected and record that the library has been sourced.——
_dt_build_sortkeyBuild a case-insensitive sort key from a row.- $1 — Schema containing the named columns.Prints the lowercased field values joined by \

Description

Provides a lightweight, schema-driven datatable abstraction for handling structured data within shell scripts.

The library:

  • Defines schema-based row structures using delimited fields
  • Stores and manages tabular data in indexed arrays
  • Supports row insertion, retrieval, and iteration
  • Enables field-based access using schema definitions
  • Provides helper functions for filtering and transformation

Design principles

  • Minimal abstraction on top of native shell arrays
  • Schema-driven access for readability and consistency
  • Predictable and explicit data handling
  • Lightweight implementation without external dependencies

Role in framework

  • Core data structure used across SolidGroundUX tooling
  • Backbone for metadata parsing, UI rendering, and data exchange

Non-goals

  • Full relational data modeling or query capabilities
  • Persistent storage or database functionality
  • Replacement for external data processing tools