pipeworks_mud_mapper.services.map_db_service

SQLite storage service for mapper authoring data.

This module replaces map JSON files as the authoring source of truth. Maps are stored in a single shared SQLite database, while zone exports remain JSON files for the game server.

Design goals: - Keep SQLite as the canonical authoring store. - Preserve existing MapFile/MapRoom models in memory. - Use clear, explicit SQL (no ORM) to keep dependencies light.

Functions

list_maps([db_path])

Return map IDs stored in the database.

map_exists(map_id[, db_path])

Return True if the map ID exists in the database.

load_map(map_id[, db_path])

Load a map from SQLite into a MapFile model.

save_map(map_file[, db_path])

Persist a MapFile to SQLite (upsert + full room refresh).

delete_map(map_id[, db_path])

Delete a map and its rooms from SQLite.

get_db_stats([db_path])

Return high-level database stats for UI health panels.

get_map_overview([db_path])

Return per-map summary rows for UI tables.

Module Contents

pipeworks_mud_mapper.services.map_db_service.list_maps(db_path=None)[source]

Return map IDs stored in the database.

pipeworks_mud_mapper.services.map_db_service.map_exists(map_id, db_path=None)[source]

Return True if the map ID exists in the database.

pipeworks_mud_mapper.services.map_db_service.load_map(map_id, db_path=None)[source]

Load a map from SQLite into a MapFile model.

pipeworks_mud_mapper.services.map_db_service.save_map(map_file, db_path=None)[source]

Persist a MapFile to SQLite (upsert + full room refresh).

pipeworks_mud_mapper.services.map_db_service.delete_map(map_id, db_path=None)[source]

Delete a map and its rooms from SQLite.

pipeworks_mud_mapper.services.map_db_service.get_db_stats(db_path=None)[source]

Return high-level database stats for UI health panels.

pipeworks_mud_mapper.services.map_db_service.get_map_overview(db_path=None)[source]

Return per-map summary rows for UI tables.