type alias ListingWhere

A declarative filter for a listing read. Each present field adds one WHERE clause (absent fields don't constrain), so a caller says WHICH listings it wants rather than hand-writing SQL. An empty filter reads every listing.

Properties

optional
ids: number[]

Listings by id. A single listing is a one-element array — there is no separate = ? path, so one and many read the same way.

optional
slugIndexes: string[]

Listings by the blind index of their slug. A single slug is a one-element array.

optional
inGroups: number[]

Listings that ARE members of any of these groups. This one also changes the shape of the read: it joins through group_listings, groups the rows by listing (a listing may be in several of the requested groups), and projects the extra group_ids column naming which of them it belongs to. That column is meaningless without this filter, which is why the two are one field rather than a separate opt-in.

optional
activeOnly: boolean

Keep only active listings.

Usage

import { type ListingWhere } from "doc.ts";