@gibme/sql
    Preparing search index...

    Class SQLite

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    config: Partial<SQLite.Config> = {}
    tableOptions: string = ''
    type: Type

    Accessors

    • get idleConnections(): number

      Gets the total number of idle connections in the pool

      Returns number

    • get totalConnections(): number

      Gets the total number of connections in the pool

      Returns number

    • get typeName(): string

      Returns string

    Methods

    • Protected

      Prepares the columns for a CREATE statement

      Parameters

      Returns [string[], any[]]

    • Protected

      Prepares any foreign key constraints based upon the field supplied

      Parameters

      Returns string[]

    • Prepares the creation of a table including the relevant indexes and constraints

      Parameters

      • databaseType: Type
      • table: string
      • columns: Column[]
      • primaryKey: string[] = []
      • tableOptions: string = ''

      Returns Database.Query[]

    • Prepares a query to perform a multi-insert statement which is far faster than a bunch of individual insert statements

      Parameters

      • databaseType: Type
      • table: string
      • columns: string[] = []
      • values: any[][]

      Returns Database.Query[]

    • Prepares a query to perform a multi-update statement which is based upon a multi-insert statement that performs an UPSERT and this is a lot faster than a bunch of individual update statements

      Parameters

      • databaseType: Type
      • table: string
      • primaryKey: string[]
      • columns: string[]
      • values: any[][]

      Returns Database.Query[]

    • Protected

      This does nothing as the underlying instance handles this internally

      Parameters

      • _connection: any

      Returns Promise<void>

    • Closes the database instance

      Note: closing the db using this method will kill the instance for all references to the instance

      Returns Promise<void>

    • Protected

      This does nothing as the underlying instance handles this internally

      Parameters

      • _connection: any

      Returns Promise<void>

    • Protected

      This is not required for this database type

      Returns Promise<void>

    • Prepares and executes the creation of an index on the table specified

      Parameters

      • table: string
      • fields: string[]
      • type: IndexType = Database.Table.IndexType.NONE
      • useTransaction: boolean = true

      Returns Promise<void>

    • Prepares and executes the creation of a table including the relevant indexes and constraints

      Parameters

      • name: string
      • fields: Column[]
      • primaryKey: string[] = []
      • tableOptions: string = ...
      • useTransaction: boolean = true

      Returns Promise<void>

    • Escapes the value for SQL

      Parameters

      • value: string

      Returns string

    • Escapes the ID for sql

      Parameters

      • id: string

      Returns string

    • Retrieves the current PRAGMA setting

      Parameters

      • option: string

      Returns Promise<unknown>

    • Lists the tables in the specified database

      Parameters

      • Optionalfilename: string

      Returns Promise<string[]>

    • Prepares and performs a query that performs a multi-insert statement which is far faster than a bunch of individual insert statements

      Parameters

      • table: string
      • columns: string[] = []
      • values: any[][]
      • useTransaction: boolean = true

      Returns Promise<Database.Query.Result<any>>

    • Prepares and executes a query to that performs a multi-update statement which is based upon a multi-insert statement that performs an UPSERT which is a lot faster than a bunch of update statements

      Parameters

      • table: string
      • primaryKey: string[]
      • columns: string[]
      • values: any[][]
      • useTransaction: boolean = true

      Returns Promise<Database.Query.Result<any>>

    • Prepares the creation of a table including the relevant indexes and constraints

      Parameters

      • name: string
      • fields: Column[]
      • primaryKey: string[] = []
      • tableOptions: string = ...

      Returns Database.Query[]

    • Prepares a query to perform a multi-insert statement which is far faster than a bunch of individual insert statements

      Parameters

      • table: string
      • columns: string[] = []
      • values: any[][]

      Returns Database.Query[]

    • Prepares a query to perform a multi-update statement which is based upon a multi-insert statement that performs an UPSERT and this is a lot faster than a bunch of individual update statements

      Parameters

      • table: string
      • primaryKey: string[]
      • columns: string[]
      • values: any[][]

      Returns Database.Query[]

    • Protected

      This does nothing as the underlying instance handles this internally

      Parameters

      • _connection: any

      Returns Promise<void>

    • Sets the given PRAGMA setting

      Parameters

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

      Returns Promise<void>

    • Truncates the specified table(s)

      Parameters

      • table: string | string[]
      • useTransaction: boolean = true

      Returns Promise<boolean>

    • Creates a new instance connected to the specified database using the same configuration options

      Parameters

      • filename: string

      Returns Promise<SQLite>