@gibme/sql
    Preparing search index...

    Class MariaDB

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    config: MySQL.Config = {}
    pool: Pool
    tableOptions: string = ''

    Accessors

    • 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 transaction on the specified connection

      Parameters

      • connection: PoolConnection

      Returns Promise<void>

    • Closes all the pooled connections

      Returns Promise<void>

    • Protected

      Commits a transaction on the specified connection

      Parameters

      • connection: PoolConnection

      Returns Promise<void>

    • Protected

      Returns a database connection from the pool

      Returns Promise<PoolConnection>

    • 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

      • database: undefined | 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>>

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

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

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

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

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

      Parameters

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

        The callback function

      Returns this

      v0.1.101

    • Parameters

      • event: "acquire"
      • listener: (connection: PoolConnection) => void

      Returns this

    • Parameters

      • event: "connection"
      • listener: (connection: PoolConnection) => void

      Returns this

    • Parameters

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

      Returns this

    • Parameters

      • event: "release"
      • listener: (connection: PoolConnection) => void

      Returns this

    • 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 a transaction on the specified connection

      Parameters

      • connection: PoolConnection

      Returns Promise<void>

    • Truncates the specified table(s)

      Parameters

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

      Returns Promise<boolean>

    • Switches the default database referenced by the connection

      Parameters

      • database: string

      Returns Promise<MySQL>