@gibme/sql
    Preparing search index...

    Class SQLiteInstance

    Hierarchy

    • EventEmitter
      • SQLiteInstance
    Index

    Constructors

    • Parameters

      • id: string
      • database: Database
      • queueScanInterval: number = 10
      • statementQueue: Entry<any>[] = []

      Returns SQLiteInstance

    Properties

    id: string

    Methods

    • Closes the database

      Returns Promise<void>

    • Retrieves the current PRAGMA setting

      Parameters

      • option: string

      Returns Promise<unknown>

    • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

      server.on('connection', (stream) => {
      console.log('someone connected!');
      });

      Returns a reference to the EventEmitter, so that calls can be chained.

      By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.

      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.on('foo', () => console.log('a'));
      myEE.prependListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a

      Parameters

      • event: "error"
      • listener: (error: Error) => void

        The callback function

      Returns this

      v0.1.101

    • Parameters

      • event: "trace"
      • listener: (sql: string) => void

      Returns this

    • Parameters

      • event: "profile"
      • listener: (sql: string, time: number) => void

      Returns this

    • Parameters

      • event: "change"
      • listener: (type: string, database: string, table: string, rowid: number) => void

      Returns this

    • Parameters

      • event: "open"
      • listener: () => void

      Returns this

    • Parameters

      • event: "close"
      • listener: () => void

      Returns this

    • Sets the given PRAGMA setting

      Parameters

      • option: string
      • value: string | number | boolean

      Returns Promise<void>

    • Loads a new instance of a SQLite database or loads from memory if already opened

      Parameters

      • id: string
      • filename: string
      • mode: number = ...
      • queueScanInterval: number = 10

      Returns Promise<SQLiteInstance>