VidStudio SDK reference
    Preparing search index...

    Class MemoryStorageAdapter

    The StorageAdapter contract held in plain Maps. Used by Node tests and by anything that wants a project without a browser.

    Behaves like the IndexedDB adapter: an index name is the field it reads (getAllByIndex("clips", "track_id", id) filters on row.track_id), and add rejects when the id already exists.

    Rows are structured-cloned on the way in and out, like IndexedDB does, so a caller can never change a stored row by mutating a reference. Rows hold only JSON-like data, never a File or Blob; keep it that way.

    Implements

    Index
    • Insert a new record. Rejects if id already exists.

      Type Parameters

      • T

      Parameters

      • storeName: string
      • record: T

      Returns Promise<void>

    • Delete a record by primary key

      Parameters

      • storeName: string
      • id: string

      Returns Promise<void>

    • Delete all records matching an index value (cascade helper)

      Parameters

      • storeName: string
      • indexName: string
      • value: string

      Returns Promise<void>

    • Get a single record by its primary key

      Type Parameters

      • T

      Parameters

      • storeName: string
      • id: string

      Returns Promise<T | undefined>

    • Get all records in a store

      Type Parameters

      • T

      Parameters

      • storeName: string

      Returns Promise<T[]>

    • Get all records matching a specific index value (foreign key lookup)

      Type Parameters

      • T

      Parameters

      • storeName: string
      • indexName: string
      • value: string

      Returns Promise<T[]>

    • Replace an existing record (full replacement by primary key).

      Type Parameters

      • T

      Parameters

      • storeName: string
      • record: T

      Returns Promise<void>

    • Atomically replace every record matching an index value with a new set, in a single transaction: delete all matches, then insert records. A concurrent read either sees the entire old set or the entire new set, never a partial mix, and a mid-write failure rolls back the whole change.

      Type Parameters

      • T

      Parameters

      • storeName: string
      • indexName: string
      • value: string
      • records: T[]

      Returns Promise<void>