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

Create Operations:

  • createGenre(genre): Promise - Creates a single Genre and reads the result. Read operations:
  • getGenre(genreId): Promise - Reads a single Genre by ID.
  • getGenres(): Promise - Reads all Genres.

Hierarchy

  • Dao
    • GenresDao

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • db: Knex<any, any[]>

    Returns GenresDao

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

  • Creates a single Genre and reads the result.

    Parameters

    Returns Promise<Genre>

    Genre that was created.

  • Reads a single Genre by ID.

    Parameters

    • genreId: string

      The ID of the Genre.

    Returns Promise<null | Genre>

    Genre or null if genreId does not exist.

  • Reads all Genres.

    Returns Promise<Genre[]>

    Genre[]