Neon HTTP Composable SQL
A query module for edge handlers built on the composable HTTP query path that @neondatabase/serverless shipped in 1.0.0. Compilation to SQL-with-placeholders moved to query time, so a sql fragment is inert until an outer query consumes it and its parameters get renumbered in traversal order; this snippet uses that to turn optional status, search, date, and service filters into fragments folded pairwise into one WHERE clause, replacing the string concatenation or the one-query-per-filter-combination that 0.x forced. It documents the traps the release notes skip: an interpolated array of fragments binds as a single parameter instead of composing, and a parameterized sql.query() result throws a not-composable error, which makes it a whole-query escape hatch rather than a fragment. The client pins down what one-shot HTTP cannot do, covering non-interactive sql.transaction, no surviving session state, and the WebSocket Pool path for anything needing BEGIN, and explains why sql(...) with parentheses now throws so a 0.x migration knows what broke.
npx shadcn@latest add @compronents/neon-http-composable-sqlInstalls from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.
A sql fragment stays inert until an outer query consumes it, renumbering placeholders in traversal order, so optional filters compose safely.
@neondatabase/[email protected]