sqlite3

  • Version 5.1.7
  • Published
  • 3.35 MB
  • 4 dependencies
  • BSD-3-Clause license

Install

npm i sqlite3
yarn add sqlite3
pnpm add sqlite3

Overview

Asynchronous, non-blocking SQLite3 bindings

Index

Variables

variable ABORT

const ABORT: number;

    variable AUTH

    const AUTH: number;

      variable BUSY

      const BUSY: number;

        variable cached

        const cached: {
        Database(
        filename: string,
        callback?: (this: Database, err: Error | null) => void
        ): Database;
        Database(
        filename: string,
        mode?: number,
        callback?: (this: Database, err: Error | null) => void
        ): Database;
        };

          variable CANTOPEN

          const CANTOPEN: number;

            variable CONSTRAINT

            const CONSTRAINT: number;

              variable CORRUPT

              const CORRUPT: number;

                variable EMPTY

                const EMPTY: number;

                  variable ERROR

                  const ERROR: number;

                    variable FORMAT

                    const FORMAT: number;

                      variable FULL

                      const FULL: number;

                        variable INTERNAL

                        const INTERNAL: number;

                          variable INTERRUPT

                          const INTERRUPT: number;

                            variable IOERR

                            const IOERR: number;

                              variable LIMIT_ATTACHED

                              const LIMIT_ATTACHED: number;

                                variable LIMIT_COLUMN

                                const LIMIT_COLUMN: number;

                                  variable LIMIT_COMPOUND_SELECT

                                  const LIMIT_COMPOUND_SELECT: number;

                                    variable LIMIT_EXPR_DEPTH

                                    const LIMIT_EXPR_DEPTH: number;

                                      variable LIMIT_FUNCTION_ARG

                                      const LIMIT_FUNCTION_ARG: number;

                                        variable LIMIT_LENGTH

                                        const LIMIT_LENGTH: number;

                                          variable LIMIT_LIKE_PATTERN_LENGTH

                                          const LIMIT_LIKE_PATTERN_LENGTH: number;

                                            variable LIMIT_SQL_LENGTH

                                            const LIMIT_SQL_LENGTH: number;

                                              variable LIMIT_TRIGGER_DEPTH

                                              const LIMIT_TRIGGER_DEPTH: number;

                                                variable LIMIT_VARIABLE_NUMBER

                                                const LIMIT_VARIABLE_NUMBER: number;

                                                  variable LIMIT_VDBE_OP

                                                  const LIMIT_VDBE_OP: number;

                                                    variable LIMIT_WORKER_THREADS

                                                    const LIMIT_WORKER_THREADS: number;

                                                      variable LOCKED

                                                      const LOCKED: number;

                                                        variable MISMATCH

                                                        const MISMATCH: number;

                                                          variable MISUSE

                                                          const MISUSE: number;

                                                            variable NOLFS

                                                            const NOLFS: number;

                                                              variable NOMEM

                                                              const NOMEM: number;

                                                                variable NOTADB

                                                                const NOTADB: number;

                                                                  variable NOTFOUND

                                                                  const NOTFOUND: number;

                                                                    variable OK

                                                                    const OK: number;

                                                                      variable OPEN_CREATE

                                                                      const OPEN_CREATE: number;

                                                                        variable OPEN_FULLMUTEX

                                                                        const OPEN_FULLMUTEX: number;

                                                                          variable OPEN_PRIVATECACHE

                                                                          const OPEN_PRIVATECACHE: number;

                                                                            variable OPEN_READONLY

                                                                            const OPEN_READONLY: number;

                                                                              variable OPEN_READWRITE

                                                                              const OPEN_READWRITE: number;

                                                                                variable OPEN_SHAREDCACHE

                                                                                const OPEN_SHAREDCACHE: number;

                                                                                  variable OPEN_URI

                                                                                  const OPEN_URI: number;

                                                                                    variable PERM

                                                                                    const PERM: number;

                                                                                      variable PROTOCOL

                                                                                      const PROTOCOL: number;

                                                                                        variable RANGE

                                                                                        const RANGE: number;

                                                                                          variable READONLY

                                                                                          const READONLY: number;

                                                                                            variable SCHEMA

                                                                                            const SCHEMA: number;

                                                                                              variable SOURCE_ID

                                                                                              const SOURCE_ID: string;

                                                                                                variable TOOBIG

                                                                                                const TOOBIG: number;

                                                                                                  variable VERSION

                                                                                                  const VERSION: string;

                                                                                                    variable VERSION_NUMBER

                                                                                                    const VERSION_NUMBER: number;

                                                                                                      Functions

                                                                                                      function verbose

                                                                                                      verbose: () => sqlite3;

                                                                                                        Classes

                                                                                                        class Database

                                                                                                        class Database extends events.EventEmitter {}

                                                                                                          constructor

                                                                                                          constructor(filename: string, callback?: (err: Error | null) => void);

                                                                                                            constructor

                                                                                                            constructor(
                                                                                                            filename: string,
                                                                                                            mode?: number,
                                                                                                            callback?: (err: Error | null) => void
                                                                                                            );

                                                                                                              method all

                                                                                                              all: {
                                                                                                              <T>(
                                                                                                              sql: string,
                                                                                                              callback?: (this: Statement, err: Error | null, rows: T[]) => void
                                                                                                              ): this;
                                                                                                              <T>(
                                                                                                              sql: string,
                                                                                                              params: any,
                                                                                                              callback?: (this: Statement, err: Error, rows: T[]) => void
                                                                                                              ): this;
                                                                                                              (sql: string, ...params: any[]): this;
                                                                                                              };

                                                                                                                method close

                                                                                                                close: (callback?: (err: Error | null) => void) => void;

                                                                                                                  method configure

                                                                                                                  configure: {
                                                                                                                  (option: 'busyTimeout', value: number): void;
                                                                                                                  (option: 'limit', id: number, value: number): void;
                                                                                                                  };

                                                                                                                    method each

                                                                                                                    each: {
                                                                                                                    <T>(
                                                                                                                    sql: string,
                                                                                                                    callback?: (this: Statement, err: Error | null, row: T) => void,
                                                                                                                    complete?: (err: Error | null, count: number) => void
                                                                                                                    ): this;
                                                                                                                    <T>(
                                                                                                                    sql: string,
                                                                                                                    params: any,
                                                                                                                    callback?: (this: Statement, err: Error, row: T) => void,
                                                                                                                    complete?: (err: Error, count: number) => void
                                                                                                                    ): this;
                                                                                                                    (sql: string, ...params: any[]): this;
                                                                                                                    };

                                                                                                                      method exec

                                                                                                                      exec: (
                                                                                                                      sql: string,
                                                                                                                      callback?: (this: Statement, err: Error | null) => void
                                                                                                                      ) => this;

                                                                                                                        method get

                                                                                                                        get: {
                                                                                                                        <T>(
                                                                                                                        sql: string,
                                                                                                                        callback?: (this: Statement, err: Error | null, row: T) => void
                                                                                                                        ): this;
                                                                                                                        <T>(
                                                                                                                        sql: string,
                                                                                                                        params: any,
                                                                                                                        callback?: (this: Statement, err: Error, row: T) => void
                                                                                                                        ): this;
                                                                                                                        (sql: string, ...params: any[]): this;
                                                                                                                        };

                                                                                                                          method interrupt

                                                                                                                          interrupt: () => void;

                                                                                                                            method loadExtension

                                                                                                                            loadExtension: (
                                                                                                                            filename: string,
                                                                                                                            callback?: (err: Error | null) => void
                                                                                                                            ) => this;

                                                                                                                              method on

                                                                                                                              on: {
                                                                                                                              (event: 'trace', listener: (sql: string) => void): this;
                                                                                                                              (event: 'profile', listener: (sql: string, time: number) => void): this;
                                                                                                                              (
                                                                                                                              event: 'change',
                                                                                                                              listener: (
                                                                                                                              type: string,
                                                                                                                              database: string,
                                                                                                                              table: string,
                                                                                                                              rowid: number
                                                                                                                              ) => void
                                                                                                                              ): this;
                                                                                                                              (event: 'error', listener: (err: Error) => void): this;
                                                                                                                              (event: 'open' | 'close', listener: () => void): this;
                                                                                                                              (event: string, listener: (...args: any[]) => void): this;
                                                                                                                              };

                                                                                                                                method parallelize

                                                                                                                                parallelize: (callback?: () => void) => void;

                                                                                                                                  method prepare

                                                                                                                                  prepare: {
                                                                                                                                  (
                                                                                                                                  sql: string,
                                                                                                                                  callback?: (this: Statement, err: Error | null) => void
                                                                                                                                  ): Statement;
                                                                                                                                  (
                                                                                                                                  sql: string,
                                                                                                                                  params: any,
                                                                                                                                  callback?: (this: Statement, err: Error) => void
                                                                                                                                  ): Statement;
                                                                                                                                  (sql: string, ...params: any[]): Statement;
                                                                                                                                  };

                                                                                                                                    method run

                                                                                                                                    run: {
                                                                                                                                    (sql: string, callback?: (this: RunResult, err: Error | null) => void): this;
                                                                                                                                    (
                                                                                                                                    sql: string,
                                                                                                                                    params: any,
                                                                                                                                    callback?: (this: RunResult, err: Error) => void
                                                                                                                                    ): this;
                                                                                                                                    (sql: string, ...params: any[]): this;
                                                                                                                                    };

                                                                                                                                      method serialize

                                                                                                                                      serialize: (callback?: () => void) => void;

                                                                                                                                        method wait

                                                                                                                                        wait: (callback?: (param: null) => void) => this;

                                                                                                                                          class Statement

                                                                                                                                          class Statement extends events.EventEmitter {}

                                                                                                                                            method all

                                                                                                                                            all: {
                                                                                                                                            <T>(callback?: (err: Error | null, rows: T[]) => void): this;
                                                                                                                                            <T>(
                                                                                                                                            params: any,
                                                                                                                                            callback?: (this: RunResult, err: Error, rows: T[]) => void
                                                                                                                                            ): this;
                                                                                                                                            (...params: any[]): this;
                                                                                                                                            };

                                                                                                                                              method bind

                                                                                                                                              bind: {
                                                                                                                                              (callback?: (err: Error | null) => void): this;
                                                                                                                                              (...params: any[]): this;
                                                                                                                                              };

                                                                                                                                                method each

                                                                                                                                                each: {
                                                                                                                                                <T>(
                                                                                                                                                callback?: (err: Error | null, row: T) => void,
                                                                                                                                                complete?: (err: Error | null, count: number) => void
                                                                                                                                                ): this;
                                                                                                                                                <T>(
                                                                                                                                                params: any,
                                                                                                                                                callback?: (this: RunResult, err: Error, row: T) => void,
                                                                                                                                                complete?: (err: Error, count: number) => void
                                                                                                                                                ): this;
                                                                                                                                                (...params: any[]): this;
                                                                                                                                                };

                                                                                                                                                  method finalize

                                                                                                                                                  finalize: (callback?: (err: Error) => void) => Database;

                                                                                                                                                    method get

                                                                                                                                                    get: {
                                                                                                                                                    <T>(callback?: (err: Error | null, row?: T) => void): this;
                                                                                                                                                    <T>(
                                                                                                                                                    params: any,
                                                                                                                                                    callback?: (this: RunResult, err: Error, row?: T) => void
                                                                                                                                                    ): this;
                                                                                                                                                    (...params: any[]): this;
                                                                                                                                                    };

                                                                                                                                                      method reset

                                                                                                                                                      reset: (callback?: (err: null) => void) => this;

                                                                                                                                                        method run

                                                                                                                                                        run: {
                                                                                                                                                        (callback?: (err: Error | null) => void): this;
                                                                                                                                                        (params: any, callback?: (this: RunResult, err: Error) => void): this;
                                                                                                                                                        (...params: any[]): this;
                                                                                                                                                        };

                                                                                                                                                          Interfaces

                                                                                                                                                          interface RunResult

                                                                                                                                                          interface RunResult extends Statement {}

                                                                                                                                                            property changes

                                                                                                                                                            changes: number;

                                                                                                                                                              property lastID

                                                                                                                                                              lastID: number;

                                                                                                                                                                interface sqlite3

                                                                                                                                                                interface sqlite3 {}

                                                                                                                                                                  property ABORT

                                                                                                                                                                  ABORT: number;

                                                                                                                                                                    property AUTH

                                                                                                                                                                    AUTH: number;

                                                                                                                                                                      property BUSY

                                                                                                                                                                      BUSY: number;

                                                                                                                                                                        property cached

                                                                                                                                                                        cached: typeof cached;

                                                                                                                                                                          property CANTOPEN

                                                                                                                                                                          CANTOPEN: number;

                                                                                                                                                                            property CONSTRAINT

                                                                                                                                                                            CONSTRAINT: number;

                                                                                                                                                                              property CORRUPT

                                                                                                                                                                              CORRUPT: number;

                                                                                                                                                                                property Database

                                                                                                                                                                                Database: typeof Database;

                                                                                                                                                                                  property EMPTY

                                                                                                                                                                                  EMPTY: number;

                                                                                                                                                                                    property ERROR

                                                                                                                                                                                    ERROR: number;

                                                                                                                                                                                      property FORMAT

                                                                                                                                                                                      FORMAT: number;

                                                                                                                                                                                        property FULL

                                                                                                                                                                                        FULL: number;

                                                                                                                                                                                          property INTERNAL

                                                                                                                                                                                          INTERNAL: number;

                                                                                                                                                                                            property INTERRUPT

                                                                                                                                                                                            INTERRUPT: number;

                                                                                                                                                                                              property IOERR

                                                                                                                                                                                              IOERR: number;

                                                                                                                                                                                                property LIMIT_ATTACHED

                                                                                                                                                                                                LIMIT_ATTACHED: number;

                                                                                                                                                                                                  property LIMIT_COLUMN

                                                                                                                                                                                                  LIMIT_COLUMN: number;

                                                                                                                                                                                                    property LIMIT_COMPOUND_SELECT

                                                                                                                                                                                                    LIMIT_COMPOUND_SELECT: number;

                                                                                                                                                                                                      property LIMIT_EXPR_DEPTH

                                                                                                                                                                                                      LIMIT_EXPR_DEPTH: number;

                                                                                                                                                                                                        property LIMIT_FUNCTION_ARG

                                                                                                                                                                                                        LIMIT_FUNCTION_ARG: number;

                                                                                                                                                                                                          property LIMIT_LENGTH

                                                                                                                                                                                                          LIMIT_LENGTH: number;

                                                                                                                                                                                                            property LIMIT_LIKE_PATTERN_LENGTH

                                                                                                                                                                                                            LIMIT_LIKE_PATTERN_LENGTH: number;

                                                                                                                                                                                                              property LIMIT_SQL_LENGTH

                                                                                                                                                                                                              LIMIT_SQL_LENGTH: number;

                                                                                                                                                                                                                property LIMIT_TRIGGER_DEPTH

                                                                                                                                                                                                                LIMIT_TRIGGER_DEPTH: number;

                                                                                                                                                                                                                  property LIMIT_VARIABLE_NUMBER

                                                                                                                                                                                                                  LIMIT_VARIABLE_NUMBER: number;

                                                                                                                                                                                                                    property LIMIT_VDBE_OP

                                                                                                                                                                                                                    LIMIT_VDBE_OP: number;

                                                                                                                                                                                                                      property LIMIT_WORKER_THREADS

                                                                                                                                                                                                                      LIMIT_WORKER_THREADS: number;

                                                                                                                                                                                                                        property LOCKED

                                                                                                                                                                                                                        LOCKED: number;

                                                                                                                                                                                                                          property MISMATCH

                                                                                                                                                                                                                          MISMATCH: number;

                                                                                                                                                                                                                            property MISUSE

                                                                                                                                                                                                                            MISUSE: number;

                                                                                                                                                                                                                              property NOLFS

                                                                                                                                                                                                                              NOLFS: number;

                                                                                                                                                                                                                                property NOMEM

                                                                                                                                                                                                                                NOMEM: number;

                                                                                                                                                                                                                                  property NOTADB

                                                                                                                                                                                                                                  NOTADB: number;

                                                                                                                                                                                                                                    property NOTFOUND

                                                                                                                                                                                                                                    NOTFOUND: number;

                                                                                                                                                                                                                                      property OK

                                                                                                                                                                                                                                      OK: number;

                                                                                                                                                                                                                                        property OPEN_CREATE

                                                                                                                                                                                                                                        OPEN_CREATE: number;

                                                                                                                                                                                                                                          property OPEN_FULLMUTEX

                                                                                                                                                                                                                                          OPEN_FULLMUTEX: number;

                                                                                                                                                                                                                                            property OPEN_PRIVATECACHE

                                                                                                                                                                                                                                            OPEN_PRIVATECACHE: number;

                                                                                                                                                                                                                                              property OPEN_READONLY

                                                                                                                                                                                                                                              OPEN_READONLY: number;

                                                                                                                                                                                                                                                property OPEN_READWRITE

                                                                                                                                                                                                                                                OPEN_READWRITE: number;

                                                                                                                                                                                                                                                  property OPEN_SHAREDCACHE

                                                                                                                                                                                                                                                  OPEN_SHAREDCACHE: number;

                                                                                                                                                                                                                                                    property OPEN_URI

                                                                                                                                                                                                                                                    OPEN_URI: number;

                                                                                                                                                                                                                                                      property PERM

                                                                                                                                                                                                                                                      PERM: number;

                                                                                                                                                                                                                                                        property PROTOCOL

                                                                                                                                                                                                                                                        PROTOCOL: number;

                                                                                                                                                                                                                                                          property RANGE

                                                                                                                                                                                                                                                          RANGE: number;

                                                                                                                                                                                                                                                            property READONLY

                                                                                                                                                                                                                                                            READONLY: number;

                                                                                                                                                                                                                                                              property RunResult

                                                                                                                                                                                                                                                              RunResult: RunResult;

                                                                                                                                                                                                                                                                property SCHEMA

                                                                                                                                                                                                                                                                SCHEMA: number;

                                                                                                                                                                                                                                                                  property SOURCE_ID

                                                                                                                                                                                                                                                                  SOURCE_ID: string;

                                                                                                                                                                                                                                                                    property Statement

                                                                                                                                                                                                                                                                    Statement: typeof Statement;

                                                                                                                                                                                                                                                                      property TOOBIG

                                                                                                                                                                                                                                                                      TOOBIG: number;

                                                                                                                                                                                                                                                                        property VERSION

                                                                                                                                                                                                                                                                        VERSION: string;

                                                                                                                                                                                                                                                                          property VERSION_NUMBER

                                                                                                                                                                                                                                                                          VERSION_NUMBER: number;

                                                                                                                                                                                                                                                                            method verbose

                                                                                                                                                                                                                                                                            verbose: () => this;

                                                                                                                                                                                                                                                                              Package Files (1)

                                                                                                                                                                                                                                                                              Dependencies (4)

                                                                                                                                                                                                                                                                              Dev Dependencies (3)

                                                                                                                                                                                                                                                                              Peer Dependencies (1)

                                                                                                                                                                                                                                                                              Badge

                                                                                                                                                                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/sqlite3.

                                                                                                                                                                                                                                                                              • Markdown
                                                                                                                                                                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/sqlite3)
                                                                                                                                                                                                                                                                              • HTML
                                                                                                                                                                                                                                                                                <a href="https://www.jsdocs.io/package/sqlite3"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>