Hubert - Distributed Infrastructure for Secure Multiparty Transactions - v1.0.0-alpha.20
    Preparing search index...

    Class SqliteKv

    SQLite-backed key-value store for Gordian Envelopes.

    Provides persistent storage with TTL support and automatic cleanup of expired entries.

    Port of struct SqliteKv from server/sqlite_kv.rs lines 16-24.

    const store = new SqliteKv("./hubert.db");
    const arid = ARID.new();
    const envelope = Envelope.new("Hello, SQLite!");

    await store.put(arid, envelope, 3600); // 1 hour TTL
    const result = await store.get(arid);

    // Cleanup when done
    store.close();

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Create a new SQLite-backed key-value store.

      Port of SqliteKv::new() from server/sqlite_kv.rs lines 26-67.

      Parameters

      • dbPath: string

        Path to the SQLite database file. Will be created if it doesn't exist.

      Returns SqliteKv

      If database initialization fails

    Methods

    • Store an envelope at the given ARID.

      Port of KvStore::put() implementation from server/sqlite_kv.rs lines 175-236.

      Parameters

      • arid: ARID
      • envelope: Envelope
      • OptionalttlSeconds: number
      • Optionalverbose: boolean

      Returns Promise<string>

    • Retrieve an envelope for the given ARID.

      Port of KvStore::get() implementation from server/sqlite_kv.rs lines 238-354.

      Parameters

      • arid: ARID
      • OptionaltimeoutSeconds: number
      • Optionalverbose: boolean

      Returns Promise<Envelope | null>

    • Check if an envelope exists at the given ARID.

      Port of KvStore::exists() implementation from server/sqlite_kv.rs lines 356-359.

      Parameters

      • arid: ARID

      Returns Promise<boolean>

    • Close the database connection and stop the cleanup task.

      Returns void