Path in the Gestor bibliotecas/db-data.php
The default part limit is 80 MiB including JSON framing. A record larger than the limit throws; records are never split. Small tables stay monolithic. Readers validate sequence, bytes, SHA-256 and record totals before returning data. Do not deploy a partial table: synchronization, recovery and ZIP packaging share this reader. The writer preserves input order; callers can use db_data_order_rows first. It still returns all records in memory, so partitioning limits file size rather than guaranteeing constant memory.
-
db_data_base: Validates the table name and builds the PascalCaseData prefix. -
db_data_order_rows: Sorts by the column list, preserving exporter-defined order. -
db_data_locked: Shared/exclusive directory lock released in finally. -
db_data_json: Validates JSON and optional record lists; invalid input throws. -
db_data_manifest_unlocked: Validates manifest and all parts; caller already holds the lock. -
db_data_table_manifest: Returns a validated manifest or null when absent. -
db_data_read_table: Reads all parts or monolithic/legacy format; parts without a manifest throw. -
db_data_list_tables: Enumerates tables from monolithic names and manifests. -
db_data_table_files: Returns only validated complete-table files. -
db_data_zip_add_tables: Adds all parts and manifests to ZIP; failed addition throws. -
db_data_table_checksum: Keeps the historical key; monolithic uses md5_file, parts use MD5 of metadata. -
db_data_stage_write: Checks bytes written; retries up to five times. -
db_data_publish: Publishes by rename, with up to five attempts. -
db_data_atomic_write: Does not rewrite identical content; uses temporary file and rename for changes. -
db_data_write_table: Keeps whole records, publishes parts before manifest and removes obsolete format.
Generated function reference
Generated from gestor/bibliotecas/db-data.php · 15 functions
db_data_base
view source · line 7 ↗db_data_base(string $table): stringParameters
$tablestring
Returns
db_data_order_rows
view source · line 15 ↗db_data_order_rows(array $rows, array $columns): arrayExporters supply natural keys or PKs; the storage writer preserves this order verbatim.
Parameters
$rowsarray$columnsarray
Returns
db_data_locked
view source · line 31 ↗db_data_locked(string $dir, int $mode, callable $operation)A directory-wide lock also protects transitions between the two formats.
Parameters
$dirstring$modeint$operationcallable
db_data_json
view source · line 45 ↗db_data_json(string $path, bool $list = false): arrayParameters
$pathstring$listbool
Returns
db_data_manifest_unlocked
view source · line 61 ↗db_data_manifest_unlocked(string $table, string $dir): ?arrayInternal: callers hold the directory lock. Validate every part before returning.
Parameters
$tablestring$dirstring
Returns
db_data_table_manifest
view source · line 101 ↗db_data_table_manifest(string $table, string $dir): ?arrayParameters
$tablestring$dirstring
Returns
db_data_read_table
view source · line 107 ↗db_data_read_table(string $table, string $dir): arrayParameters
$tablestring$dirstring
Returns
db_data_list_tables
view source · line 130 ↗db_data_list_tables(string $dir): arrayParameters
$dirstring
Returns
db_data_table_files
view source · line 143 ↗db_data_table_files(string $table, string $dir): arrayOnly export the files of a validated, complete table.
Parameters
$tablestring$dirstring
Returns
db_data_zip_add_tables
view source · line 152 ↗db_data_zip_add_tables(ZipArchive $zip, string $dir): voidParameters
$zipZipArchive$dirstring
Returns
db_data_table_checksum
view source · line 163 ↗db_data_table_checksum(string $table, string $dir): stringPer-table checksum remains keyed by the historical monolithic filename.
Parameters
$tablestring$dirstring
Returns
db_data_stage_write
view source · line 174 ↗db_data_stage_write(string $path, string $json): stringParameters
$pathstring$jsonstring
Returns
db_data_publish
view source · line 184 ↗db_data_publish(string $tmp, string $path): voidParameters
$tmpstring$pathstring
Returns
db_data_atomic_write
view source · line 192 ↗db_data_atomic_write(string $path, string $json): voidParameters
$pathstring$jsonstring
Returns
db_data_write_table
view source · line 200 ↗db_data_write_table(string $table, array $rows, string $dir, array $options = []): arrayPreserve the caller's stable ordering and complete records. All sizes include JSON framing.
Parameters
$tablestring$rowsarray$dirstring$optionsarray
Returns