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

Read operations:

  • getComic(comicId): Promise - Reads a single Comic by ID.
  • getComicsForSeries(seriesId): Promise<Comic[]> - Reads Comics by series ID.
  • getComics(): Promise<Comic[]> - Reads all Comics.

Hierarchy

  • Dao
    • ComicsDao

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • db: Knex<any, any[]>

    Returns ComicsDao

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 Comic by ID.

    Parameters

    • comicId: string

      The ID of the comic.

    Returns Promise<null | Comic>

    Comic or null if comicId does not exist.

  • Reads all Comics.

    Returns Promise<Comic[]>

    Comic[]

  • Reads Comics by series ID.

    Parameters

    • seriesId: string

      The ID of the Series.

    Returns Promise<Comic[]>

    Comic[]