Comparing version 1.1.2 to 1.2.0
@@ -28,2 +28,9 @@ function CafeQueryError(message) { | ||
}, | ||
findFirstOrNull: async (query, ...values) => { | ||
const [rows] = await dataSource.query(query, values) | ||
if (!rows || rows.length === 0) { | ||
return null | ||
} | ||
return rows[0] | ||
}, | ||
findAll: async (query, ...values) => { | ||
@@ -30,0 +37,0 @@ const [rows] = await dataSource.query(query, values) |
{ | ||
"name": "cafe-query", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
2216
59