Collection (Company) Queries Deep Dive
Comprehensive reference for all company/collection CRUD operations, item-company associations, search, pagination, and statistics query functions.
Overview
The collection query layer manages companies and their associations with items:
company.queries.ts-- Full company CRUD, search with pagination, item-company linking (1:1 relationship), statistics, and item listing by company
Companies in this system represent the organizations behind listed items. Each item can belong to at most one company (enforced by a unique constraint on itemSlug).
Source File
lib/db/queries/company.queries.ts