piqit

piqit exports the query builder, result-shaping utilities, and the type machinery behind select-path inference.

Install

npm install piqit

Exports

import {
  piq,
  from,
  QueryBuilder,
  SingleQueryBuilder,
  undot,
  undotWithAliases,
  undotAll,
  undotAllWithAliases,
  expandWildcards,
} from 'piqit'

Also exports type contracts/utilities including:

  • StandardSchema, Infer
  • Resolver, QuerySpec
  • SelectablePaths, HasCollision, Undot, UndotWithAliases

Primary API

import { piq } from 'piqit'

const rows = await piq
  .from(postsResolver)
  .scan({ year: '2024' })
  .filter({ status: 'published' })
  .select('params.slug', 'frontmatter.title')
  .exec()

Execution Notes

  • select() is required before execution.
  • scan() and filter() merge constraints across repeated calls.
  • sort(path, direction?) orders rows and limit(n) caps them; both run after resolution, before flattening.
  • single() wraps a query for first-row access (exec, execOrThrow).
  • stream() currently emits from an already-resolved result array.

Build/Check (Workspace)

bun run --filter piqit build
bun run --filter piqit check