Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Database

Hierarchy

  • Database

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Parameters

    • path_or_sqlite3: string | Sqlite3.Database

      path or better-sqlite3 Database instance

    • Optional options: DatabaseOptions

      better-sqlite3 Database option and table name used by sqlite3-storage

    Returns Database

Properties

db

db: Sqlite3.Database

Accessors

inTransaction

  • get inTransaction(): boolean
  • Return whether database is in transaction.

    Returns boolean

Methods

close

  • close(): void
  • Close database.

    Returns void

getStorage

  • getStorage(name: string): Storage
  • Get storage.

    Parameters

    • name: string

      Storage name

    Returns Storage

transaction

  • Execute function in transaction.

    Parameters

    • options: TransactionOptions | null | undefined

      Transaction options about rollback and lock.

    • func: function

      Function to be executed in a transaction.

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc