Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BasieStatic

Hierarchy

  • BasieStatic

Index

Properties

Private engine

engine: DatabaseEngine | null = null

Methods

getEngine

  • Returns the engine currently in use, or throws if there is no engine configured.

    Returns DatabaseEngine

mysql

  • mysql(connection: Connection): void
  • Configures basie to be used with the specified mysql connection.

    Parameters

    • connection: Connection

    Returns void

postgres

  • postgres(db: Pool): void
  • Configures basie to be used with the specified postgres connection pool.

    Parameters

    • db: Pool

    Returns void

sqlite

  • sqlite(db: sqliteDatabase): void
  • Configures basie to be used with the specified sqlite database.

    Parameters

    • db: sqliteDatabase

    Returns void

use

  • Changes the current database engine to the specified engine.

    Parameters

    Returns void

wrap

  • wrap<InstanceType, Fields>(): (Anonymous function)
  • Wraps the specified model with basie-specific methods that give it static querying methods. This does not create a table within the database, and instead expects the table to already be present. This function is called a bit weirdly (Basie.wrap<_Model>()(_Model)) to overcome some typescript type system limits and statically typecheck that you're only using valid members.

    Type parameters

    Returns (Anonymous function)

Generated using TypeDoc