forge-sql-orm 2.1.8 → 2.1.9

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": "forge-sql-orm",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "Drizzle ORM integration for Atlassian @forge/sql. Provides a custom driver, schema migration, two levels of caching (local and global via @forge/kvs), optimistic locking, and query analysis.",
5
5
  "main": "dist/ForgeSQLORM.js",
6
6
  "module": "dist/ForgeSQLORM.mjs",
@@ -150,16 +150,16 @@ async function processExecuteMethod(query: string, params: unknown[]): Promise<F
150
150
 
151
151
  const result = await withTimeout(sqlStatement.execute());
152
152
  await saveMetaDataToContext(result.metadata as ForgeSQLMetadata);
153
- if (!result?.rows || (Array.isArray(result.rows) && (result.rows as unknown[]).length === 0)) {
154
- return { rows: [undefined] };
153
+ if (!result?.rows) {
154
+ return { rows: [[]] };
155
155
  }
156
156
 
157
157
  if (isUpdateQueryResponse(result.rows)) {
158
158
  const oneRow = result.rows as any;
159
- return { ...oneRow, rows: [oneRow] };
159
+ return { rows: [oneRow] };
160
160
  }
161
161
 
162
- return { rows: result.rows };
162
+ return { rows: [result.rows] };
163
163
  }
164
164
 
165
165
  /**