Options
All
  • Public
  • Public/Protected
  • All
Menu

Core service layer.

Hierarchy

  • GBCoreService

Implements

  • any

Index

Constructors

constructor

Properties

adminService

adminService: GBAdminService

Administrative services.

Private changeColumnQuery

changeColumnQuery: function

Custom change column query.

Type declaration

    • (tableName: any, attributes: any): string
    • Parameters

      • tableName: any
      • attributes: any

      Returns string

Private createTableQuery

createTableQuery: function

Custom create table query.

Type declaration

    • (tableName: any, attributes: any, options: any): string
    • Parameters

      • tableName: any
      • attributes: any
      • options: any

      Returns string

Private dialect

dialect: string

Dialect used. Tested: mssql and sqlite.

Private queryGenerator

queryGenerator: any

Allows filtering on SQL generated before send to the database.

sequelize

sequelize: Sequelize

Data access layer instance.

Methods

Private changeColumnQueryOverride

  • changeColumnQueryOverride(tableName: any, attributes: any): string
  • SQL: let sql = '' + 'ALTER TABLE [UserGroup]\n' + ' ADD CONSTRAINT [invalid1] FOREIGN KEY ([userId1], [userId2], [userId3]) REFERENCES [User] ([userId1], [userId2], [userId3]) ON DELETE NO ACTION,\n' + ' CONSTRAINT [invalid2] FOREIGN KEY ([groupId1], [groupId2]) REFERENCES [Group] ([groupId1], [groupId2]) ON DELETE NO ACTION, \n' + ' CONSTRAINT [invalid3] FOREIGN KEY ([instanceId1]) REFERENCES [Instance] ([instanceId1]) ON DELETE NO ACTION\n'

    Parameters

    • tableName: any
    • attributes: any

    Returns string

Private createTableQueryOverride

  • createTableQueryOverride(tableName: any, attributes: any, options: any): string
  • SQL:

    // let sql: string = '' + // 'IF OBJECT_ID(\'[UserGroup]\', \'U\') IS NULL\n' + // 'CREATE TABLE [UserGroup] (\n' + // ' [id] INTEGER NOT NULL IDENTITY(1,1),\n' + // ' [userId] INTEGER NULL,\n' + // ' [groupId] INTEGER NULL,\n' + // ' [instanceId] INTEGER NULL,\n' + // ' PRIMARY KEY ([id1], [id2]),\n' + // ' FOREIGN KEY ([userId1], [userId2], [userId3]) REFERENCES [User] ([userId1], [userId2], [userId3]) ON DELETE NO ACTION,\n' + // ' FOREIGN KEY ([groupId1], [groupId2]) REFERENCES [Group] ([groupId1], [groupId1]) ON DELETE NO ACTION,\n' + // ' FOREIGN KEY ([instanceId]) REFERENCES [Instance] ([instanceId]) ON DELETE NO ACTION)'

    Parameters

    • tableName: any
    • attributes: any
    • options: any

    Returns string

initDatabase

  • initDatabase(): Promise<Object>

loadInstance

  • loadInstance(botId: string): Promise<IGBInstance>

loadInstances

  • loadInstances(): Promise<IGBInstance>

syncDatabaseStructure

  • syncDatabaseStructure(): Promise<any>

Generated using TypeDoc