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.

Functions

f
dumpApiToRow(dump: Dump): DumpRow

Converts a Dump back to a row, for a service that writes an edited dump's columns.

f
dumpRowToApi(row: DumpRow): Dump

Converts a row to the API's Dump, parsing its preview's JSON. It leaves categoryIds out: the services add them with attachCategoryIds.

f
isDumpRow(obj: unknown): obj is DumpRow

Checks whether obj, a row from a query, is a DumpRow. It checks each column's type, not that kind is url or file.

Interfaces

I
DumpRow

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.

Variables

v
DUMP_COLUMNS: string

Lists the stored columns of DumpRow. A column added to the table must be added here, to DumpRow and to isDumpRow.

v
DUMP_SELECT_COLUMNS: string

Selects a whole DumpRow, the stored columns and the computed comment_count and owner_username.

v
DUMP_SELECT_COLUMNS_ALIASED: string

Selects a whole DumpRow in a query that aliases dumps as d to join it with other tables.