dzql 0.6.33 → 0.6.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dzql",
3
- "version": "0.6.33",
3
+ "version": "0.6.34",
4
4
  "description": "Database-first real-time framework with TypeScript support",
5
5
  "repository": {
6
6
  "type": "git",
@@ -223,6 +223,12 @@ export class DzqlNamespace {
223
223
 
224
224
  const query = `SELECT ${qualifiedName}(${sqlArgs.join(", ")}) as result`;
225
225
  const rows = await sql.unsafe(query, dbParams);
226
+
227
+ // Handle search/lookup functions that return SETOF jsonb (array of rows)
228
+ if (fnName.startsWith('search_') || fnName.startsWith('lookup_')) {
229
+ return rows.map((r: any) => r.result).filter((i: any) => i !== null);
230
+ }
231
+
226
232
  return rows[0]?.result;
227
233
  }
228
234