© 2026 Hedgehog Software, LLC
const statement = sql`select * from ${items}, json_each(${items.tags}) as "jsonTags"` .append(sql` where "jsonTags"."value" ->> '$.name' = 'hello'`) await searchDB().all(statement);
select
const columns = getTableColumns(items); await db .select(columns) .from(sql`${items}, json_each(${items.tags}) as "jsonTags"`) .where(sql` "jsonTags"."value" ->> '$.name' = 'hello'`)
Your "id" field references a column "items"."id", but the table "items" is not part of the query! Did you forget to join it?