VidStudio SDK reference
    Preparing search index...

    Class IndexedDBAdapter

    Abstract storage contract. IndexedDB is the default implementation, but any backend (SQLite, REST API, in-memory) can implement this.

    Implements

    Index
    • Parameters

      • options: { name?: string } = {}

      Returns IndexedDBAdapter

    • 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[]>

    • Open (or create) the database. Must be called before any other method.

      Returns Promise<void>

    • 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>