db-crud-api 0.3.12 → 0.3.13
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/CHANGELOG.md +4 -0
- package/lib/mssql.js +1 -0
- package/lib/mysql.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/mssql.js
CHANGED
|
@@ -115,6 +115,7 @@ export async function query(connection, dbOpes) {
|
|
|
115
115
|
const sqlresult = await sqlRequest.query(sqlString);
|
|
116
116
|
|
|
117
117
|
// Return a single object if there is only 1 row
|
|
118
|
+
if (sqlresult.recordset == undefined) return;
|
|
118
119
|
if (sqlresult.recordset.length === 0) return;
|
|
119
120
|
if (sqlresult.recordset.length === 1) return sqlresult.recordset[0];
|
|
120
121
|
else return sqlresult.recordset;
|
package/lib/mysql.js
CHANGED
|
@@ -113,6 +113,8 @@ export async function query(connection, dbOpes) {
|
|
|
113
113
|
finally { if (sqlconn) sqlconn.release(); }
|
|
114
114
|
|
|
115
115
|
// Return single object if there is only 1 row
|
|
116
|
+
if (sqlresult == undefined) return;
|
|
117
|
+
if (sqlresult.length === 0) return;
|
|
116
118
|
if (sqlresult[0].length === 0) return;
|
|
117
119
|
if (sqlresult[0].length === 1) return sqlresult[0][0];
|
|
118
120
|
else return sqlresult[0];
|