Skip to content

refactor: split store.rs (2,065 LOC) into focused modules #179

Closed

Description

@ajianaz

Problem

crates/uteke-core/src/memory/store.rs is 2,065 LOC with 30+ public methods covering CRUD, tag ops, aging, tier management, bulk operations, and deprecation — all in one file. This is a God Object that causes merge conflicts and makes navigation slow.

Proposed Split

memory/
├── mod.rs          — re-exports, Store struct, open/init_schema
├── store.rs        — core CRUD: insert, get_by_id, delete, update, list, search_content, load_all, count
├── tags.rs         — unique_tags, tags_with_counts, rename_tag, delete_tag, count_by_tag
├── aging.rs        — find_aged, cleanup_aged, count_never_accessed, touch_access, bulk_delete_cold
├── bulk.rs         — bulk_delete_by_tag, bulk_delete_all
├── tier.rs         — tier_counts, deprecate
├── schema.rs       — init_schema, ensure_schema_version, run_migrations, schema_version, column_exists
└── types.rs        — (existing, stays as-is)

Rules

  • All files import from Store via use super::Store;
  • All methods stay on impl Store blocks — just in different files
  • mod.rs re-exports everything so public API unchanged
  • Zero behavioral changes — pure file reorganization

Target

  • v0.0.9
  • No breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions