@gibme/sql
    Preparing search index...

    Class LibSQL

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    tableOptions: string = ''

    Accessors

    • get transactionsEnabled(): boolean

      Returns if transactions are enabled

      Returns boolean

    • 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: Database.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: Database.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: Database.Type
      • table: string
      • primaryKey: string[]
      • columns: string[]
      • values: any[][]

      Returns Database.Query[]

    • Protected

      Starts a new transaction

      Returns Promise<Transaction>

    • Closes the database

      Returns Promise<void>

    • Protected

      Commits the open transaction

      Parameters

      • connection: Transaction

      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

    • Lists the tables in the specified database

      Parameters

      • Optionalpath: 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

      Rolls back the open transaction

      Parameters

      • connection: Transaction

      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

      • path: string

      Returns Promise<LibSQL>