Turns the rows of dumps into the API's Dump the same way for every
service that reads dumps: each selects them with the column lists here,
checks each row with isDumpRow and converts it with dumpRowToApi.
Converts a Dump back to a row, for a service that writes an edited dump's columns.
Converts a row to the API's Dump, parsing its preview's JSON. It
leaves categoryIds out: the services add them with attachCategoryIds.
Checks whether obj, a row from a query, is a DumpRow. It checks
each column's type, not that kind is url or file.
Read from the dumps table with DUMP_SELECT_COLUMNS, or written back
from a Dump by dumpApiToRow. It lacks url_canonical, which
only the duplicate lookup reads.
- comment: string | null
-
comment_count: number
Computed by a subquery, which counts the comments that aren't deleted.
- created_at: string
- custom_thumbnail_mime: string | null
- file_mime: string | null
- file_name: string | null
- file_size: number | null
- id: string
- is_private: number
- kind: string
-
owner_username: string
The poster's current name, computed by a subquery.
-
rich_content: string | null
RichContent as JSON.
-
slug: string
Unique among its poster's dumps, and set on every row since 0021.
- title: string
- updated_at: string | null
-
url: string | null
The link as the poster submitted it.
- user_id: string
- vote_count: number
Selects a whole DumpRow, the stored columns and the computed
comment_count and owner_username.
Selects a whole DumpRow in a query that aliases dumps as d to
join it with other tables.
Usage
import * as mod from "api/model/dump.ts";