Database

com.alecdorrington.omnibrowser.Database
See theDatabase companion object
abstract class Database(val name: String, val version: Int)

A database of the extension's in the browser's IndexedDB, named name, for more than Browser.Storage holds, read and written through Browser.Databases. Its object stores are those that the object extending it makes with store, each a val of it, so that every one is made before the database is first opened:

object Lexicon extends Database("lexicon", version = 1):
 val lexemes = store[Lexeme]("lexemes")
 val counts  = store[Int]("counts")

The browser makes it with its stores the first time it is opened, and adds the stores that it lacks whenever it is opened at a version above its own, which must be raised whenever a store is added, and never lowered. A store left out stays in the database, unused, with what it kept.

Only the background and the extension's pages reach it: a content script's IndexedDB is the web page's, not the extension's, so its browser has no databases. No permission is needed. Without Permission.UnlimitedStorage, it has the browser's default quota, and the browser may evict it when the device runs short of space.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def stores: List[ObjectStore[_]]

The database's object stores, in the order that they were made.

The database's object stores, in the order that they were made.

Attributes

Concrete fields

val name: String
val version: Int