NAME

AmberDB::Base - Core encoding, decoding, schema loading, and path resolution base class

SYNOPSIS

use parent 'AmberDB::Base';

DESCRIPTION

AmberDB::Base serves as the foundational layer for flat-file database serialization, table schema parsing, data path resolution, character escaping, and index maintenance.

TABLE NAMING CONVENTIONS

AmberDB enforces a strict, deterministic table naming convention:

  • Format: All table identifiers must be lowercase alphanumeric characters using snake_case, formatted as <database>_<table_name> (e.g. catalog_product, member_address, orders_item).

  • Database Prefix: The prefix prior to the first underscore (_) represents the logical database/group schema name (mapped to <database>.dbase).

  • Schema Mapping: A table named catalog_product maps to schema file catalog_product.table and database group configuration catalog.dbase.

  • Constraint: Uppercase characters or mixed-case identifiers (such as Catalog_Product) are not supported and will fail database group extraction.

METHODS

db_encode(@fields) / db_decode($record)

Serializes Perl structures (scalars, arrays, hashes) into tab-delimited strings and deserializes them back.

table_info($table_id)

Loads and returns metadata schema hash for specified table. $table_id must follow the lowercase snake_case naming convention (e.g., catalog_product).

table_path($table_id)

Resolves physical file system path for target table based on dbase, year, section, and language settings.

AUTHOR

Maruf Cetin <marufcetin@gmail.com>

LICENSE AND COPYRIGHT

Copyright (C) 2014-2026 Maruf Cetin.

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.