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

Read operations:

  • getBag(bagId): Promise - Reads a single Bag by ID.
  • getBags(): Promise<Bag[]> - Reads all Bags.

Hierarchy

  • Dao
    • BagsDao

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • db: Knex<any, any[]>

    Returns BagsDao

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

  • Reads a single Bag by ID.

    Parameters

    • bagId: string

      The ID of the bag.

    Returns Promise<null | Bag>

    Bag or null if bagId does not exist.

  • Reads all Bags.

    Returns Promise<Bag[]>

    Bag[]