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

Read operations:

  • getComicsInTx(txId): Promise<Comic[]> - Retrieves all Comics from a tx_id. Experimental.
  • getTxForComic(comicId): Promise - Retrieves a Transaction by comic_id. Experimental.
  • getPurchasePriceForComic(comicId): Promise - Retrieves the purchase_price for a Comic. Deprecated.
  • getComicTx(comicId): Promise<ComicTx | null> - Reads a single ComicTx by comicId.
  • getComicTxs(): Promise<ComicTx[]> - Reads all ComicTxs.

Hierarchy

  • Dao
    • ComicTxDao

Constructors

  • Parameters

    • db: Knex<any, any[]>

    Returns ComicTxDao

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

    Retrieves all Comics from a tx_id.

    Parameters

    Returns Promise<Comic[]>

    ComicModel[]

  • Reads a single ComicTx by comicId.

    Parameters

    • comicId: string

      The ID of the comic.

    Returns Promise<null | ComicTx>

    ComicTx or null if comicId does not exist.

  • Reads all ComicTxs.

    Returns Promise<ComicTx[]>

    ComicTx[]

  • Retrieves the purchase_price for a Comic.

    Parameters

    • comicId: string

      The ID of the Comic.

    Returns Promise<number>

    number purchase price of Comic.

    Use getComicTx

  • Experimental

    Retrieves a Transaction by comic_id.

    Parameters

    • comicId: string

      The ID of the Comic to look up the TransactionModel for.

    Returns Promise<Transaction>

    Transaction