@types/better-sqlite3

  • Version 7.6.9
  • Published
  • 9.1 kB
  • 1 dependency
  • MIT license

Install

npm i @types/better-sqlite3
yarn add @types/better-sqlite3
pnpm add @types/better-sqlite3

Overview

TypeScript definitions for better-sqlite3

Index

Variables

variable Database

const Database: BetterSqlite3.DatabaseConstructor;

    Interfaces

    interface BackupMetadata

    interface BackupMetadata {}

      property remainingPages

      remainingPages: number;

        property totalPages

        totalPages: number;

          interface BackupOptions

          interface BackupOptions {}

            property progress

            progress: (info: BackupMetadata) => number;

              interface Options

              interface Options {}

                property fileMustExist

                fileMustExist?: boolean | undefined;

                  property nativeBinding

                  nativeBinding?: string | undefined;

                    property readonly

                    readonly?: boolean | undefined;

                      property timeout

                      timeout?: number | undefined;

                        property verbose

                        verbose?:
                        | ((message?: unknown, ...additionalArgs: unknown[]) => void)
                        | undefined;

                          interface PragmaOptions

                          interface PragmaOptions {}

                            property simple

                            simple?: boolean | undefined;

                              interface RegistrationOptions

                              interface RegistrationOptions {}

                                property deterministic

                                deterministic?: boolean | undefined;

                                  property directOnly

                                  directOnly?: boolean | undefined;

                                    property safeIntegers

                                    safeIntegers?: boolean | undefined;

                                      property varargs

                                      varargs?: boolean | undefined;

                                        interface RunResult

                                        interface RunResult {}

                                          property changes

                                          changes: number;

                                            property lastInsertRowid

                                            lastInsertRowid: number | bigint;

                                              interface SerializeOptions

                                              interface SerializeOptions {}

                                                property attached

                                                attached?: string;

                                                  Type Aliases

                                                  type AggregateOptions

                                                  type AggregateOptions = Parameters<BetterSqlite3.Database['aggregate']>[1];

                                                    type ColumnDefinition

                                                    type ColumnDefinition = BetterSqlite3.ColumnDefinition;

                                                      type Database

                                                      type Database = BetterSqlite3.Database;

                                                        type SqliteError

                                                        type SqliteError = typeof SqliteError;

                                                          type Statement

                                                          type Statement<BindParameters extends unknown[] | {} = unknown[]> =
                                                          BindParameters extends unknown[]
                                                          ? BetterSqlite3.Statement<BindParameters>
                                                          : BetterSqlite3.Statement<[BindParameters]>;

                                                            type Transaction

                                                            type Transaction<T extends VariableArgFunction = VariableArgFunction> =
                                                            BetterSqlite3.Transaction<T>;

                                                              Namespaces

                                                              namespace BetterSqlite3

                                                              namespace BetterSqlite3 {}

                                                                interface ColumnDefinition

                                                                interface ColumnDefinition {}

                                                                  property column

                                                                  column: string | null;

                                                                    property database

                                                                    database: string | null;

                                                                      property name

                                                                      name: string;

                                                                        property table

                                                                        table: string | null;

                                                                          property type

                                                                          type: string | null;

                                                                            interface Database

                                                                            interface Database {}

                                                                              property inTransaction

                                                                              inTransaction: boolean;

                                                                                property memory

                                                                                memory: boolean;

                                                                                  property name

                                                                                  name: string;

                                                                                    property open

                                                                                    open: boolean;

                                                                                      property readonly

                                                                                      readonly: boolean;

                                                                                        method aggregate

                                                                                        aggregate: <T>(
                                                                                        name: string,
                                                                                        options: Database.RegistrationOptions & {
                                                                                        start?: T | (() => T);
                                                                                        step: (total: T, next: ElementOf<T>) => T | void;
                                                                                        inverse?: (total: T, dropped: T) => T;
                                                                                        result?: (total: T) => unknown;
                                                                                        }
                                                                                        ) => this;

                                                                                          method backup

                                                                                          backup: (
                                                                                          destinationFile: string,
                                                                                          options?: Database.BackupOptions
                                                                                          ) => Promise<Database.BackupMetadata>;

                                                                                            method close

                                                                                            close: () => this;

                                                                                              method defaultSafeIntegers

                                                                                              defaultSafeIntegers: (toggleState?: boolean) => this;

                                                                                                method exec

                                                                                                exec: (source: string) => this;

                                                                                                  method function

                                                                                                  function: {
                                                                                                  (name: string, cb: (...params: unknown[]) => unknown): this;
                                                                                                  (
                                                                                                  name: string,
                                                                                                  options: Database.RegistrationOptions,
                                                                                                  cb: (...params: unknown[]) => unknown
                                                                                                  ): this;
                                                                                                  };

                                                                                                    method loadExtension

                                                                                                    loadExtension: (path: string) => this;

                                                                                                      method pragma

                                                                                                      pragma: (source: string, options?: Database.PragmaOptions) => unknown;

                                                                                                        method prepare

                                                                                                        prepare: <BindParameters extends {} | unknown[] = unknown[]>(
                                                                                                        source: string
                                                                                                        ) => BindParameters extends unknown[]
                                                                                                        ? Statement<BindParameters>
                                                                                                        : Statement<[BindParameters]>;

                                                                                                          method serialize

                                                                                                          serialize: (options?: Database.SerializeOptions) => Buffer;

                                                                                                            method table

                                                                                                            table: (name: string, options: VirtualTableOptions) => this;

                                                                                                              method transaction

                                                                                                              transaction: <F extends VariableArgFunction>(fn: F) => Transaction<F>;

                                                                                                                method unsafeMode

                                                                                                                unsafeMode: (unsafe?: boolean) => this;

                                                                                                                  interface DatabaseConstructor

                                                                                                                  interface DatabaseConstructor {}

                                                                                                                    property prototype

                                                                                                                    prototype: Database;

                                                                                                                      property SqliteError

                                                                                                                      SqliteError: typeof SqliteError;

                                                                                                                        construct signature

                                                                                                                        new (filename?: string | Buffer, options?: Database.Options): Database;

                                                                                                                          call signature

                                                                                                                          (filename?: string, options?: Database.Options): Database;

                                                                                                                            interface Statement

                                                                                                                            interface Statement<BindParameters extends unknown[]> {}

                                                                                                                              property busy

                                                                                                                              busy: boolean;

                                                                                                                                property database

                                                                                                                                database: Database;

                                                                                                                                  property reader

                                                                                                                                  reader: boolean;

                                                                                                                                    property readonly

                                                                                                                                    readonly: boolean;

                                                                                                                                      property source

                                                                                                                                      source: string;

                                                                                                                                        method all

                                                                                                                                        all: (...params: BindParameters) => unknown[];

                                                                                                                                          method bind

                                                                                                                                          bind: (...params: BindParameters) => this;

                                                                                                                                            method columns

                                                                                                                                            columns: () => ColumnDefinition[];

                                                                                                                                              method expand

                                                                                                                                              expand: (toggleState?: boolean) => this;

                                                                                                                                                method get

                                                                                                                                                get: (...params: BindParameters) => unknown;

                                                                                                                                                  method iterate

                                                                                                                                                  iterate: (...params: BindParameters) => IterableIterator<unknown>;

                                                                                                                                                    method pluck

                                                                                                                                                    pluck: (toggleState?: boolean) => this;

                                                                                                                                                      method raw

                                                                                                                                                      raw: (toggleState?: boolean) => this;

                                                                                                                                                        method run

                                                                                                                                                        run: (...params: BindParameters) => Database.RunResult;

                                                                                                                                                          method safeIntegers

                                                                                                                                                          safeIntegers: (toggleState?: boolean) => this;

                                                                                                                                                            interface Transaction

                                                                                                                                                            interface Transaction<F extends VariableArgFunction> {}

                                                                                                                                                              method default

                                                                                                                                                              default: (...params: ArgumentTypes<F>) => ReturnType<F>;

                                                                                                                                                                method deferred

                                                                                                                                                                deferred: (...params: ArgumentTypes<F>) => ReturnType<F>;

                                                                                                                                                                  method exclusive

                                                                                                                                                                  exclusive: (...params: ArgumentTypes<F>) => ReturnType<F>;

                                                                                                                                                                    method immediate

                                                                                                                                                                    immediate: (...params: ArgumentTypes<F>) => ReturnType<F>;

                                                                                                                                                                      call signature

                                                                                                                                                                      (...params: ArgumentTypes<F>): ReturnType<F>;

                                                                                                                                                                        interface VirtualTableOptions

                                                                                                                                                                        interface VirtualTableOptions {}

                                                                                                                                                                          property columns

                                                                                                                                                                          columns: string[];

                                                                                                                                                                            property directOnly

                                                                                                                                                                            directOnly?: boolean | undefined;

                                                                                                                                                                              property parameters

                                                                                                                                                                              parameters?: string[] | undefined;

                                                                                                                                                                                property rows

                                                                                                                                                                                rows: () => Generator;

                                                                                                                                                                                  property safeIntegers

                                                                                                                                                                                  safeIntegers?: boolean | undefined;

                                                                                                                                                                                    Package Files (1)

                                                                                                                                                                                    Dependencies (1)

                                                                                                                                                                                    Dev Dependencies (0)

                                                                                                                                                                                    No dev dependencies.

                                                                                                                                                                                    Peer Dependencies (0)

                                                                                                                                                                                    No peer dependencies.

                                                                                                                                                                                    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/@types/better-sqlite3.

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