Handles all interactions with the comics-db 'boxes' table.

Create operations:

  • createBox(box): Promise - Creates a single Box and reads the result. Experimental. Read operations:
  • getBox(boxId): Promise - Reads a single Box by ID.
  • getBoxes(): Promise<Box[]> - Reads all Boxes.

Hierarchy

  • Dao
    • BoxesDao

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • db: Knex<any, any[]>

    Returns BoxesDao

Properties

db: Knex<any, any[]>

Accessors

  • get primaryKey(): string
  • The primary key of the table as defined in the database.

    Returns string

  • get tableName(): string
  • The name of the table as defined in the database.

    Returns string

Methods

  • Experimental

    Creates a single Box and reads the result.

    Parameters

    • box: Box

      The Box to create. Note: The value Box.box_id is ignored and generated by the comics-db.

    Returns Promise<Box>

    The Box that was created.

  • Reads a single Box by ID.

    Parameters

    • boxId: string

      The ID of the box.

    Returns Promise<null | Box>

    Box or null if boxId does not exist.

  • Reads all Boxes.

    Returns Promise<Box[]>

    BoxModel[]