Skip to content

perf: add batch get_many/delete_many to VaultStorage — fix N-query loops in revoke and list #180

@manojbajaj95

Description

@manojbajaj95

Ref: docs/suggestions.md A12

Problem

VaultStorage only offers single-record get, put, delete. AuthService.revoke() loops calling logout()store.delete() per connection (non-atomic: a crash mid-revoke leaves partial state). list_connections() calls vault.get() N times in a loop, one SQLite query per connection.

Solution

Add get_many(keys: list[str]) -> dict[str, str | None] and delete_many(keys: list[str]) -> int to VaultStorage (interfaces.py) with a SQLite implementation using a single transaction. revoke() and list_connections() use them.

Files

  • store/interfaces.py — add get_many, delete_many to VaultStorage
  • store/local.py — implement with single-transaction SQLite
  • auth/service.py:revoke() and list_connections() — use batch methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions