mm_dao 1.8.6 → 1.8.8
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.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
/**
|
|
4
|
+
* 主函数, 自定义DAO查询逻辑
|
|
5
|
+
* 注意: 配置 main 指向本脚本后会覆盖内置查询引擎(get/add/set/del等),
|
|
6
|
+
* 仅在需要完全自定义数据操作时使用; 未配置 main 时使用内置引擎。
|
|
7
|
+
* @param {object} params 参数对象 { query: 查询条件, body: 正文参数 }
|
|
8
|
+
* @param {object} db 数据管理器, 如: { next: async function(){}, ret: {} }
|
|
9
|
+
* @returns {object} 返回执行结果
|
|
10
|
+
*/
|
|
11
|
+
async main(params, db) {
|
|
12
|
+
var { query, body } = params;
|
|
13
|
+
// 内置引擎仍可通过 this 调用, 例如:
|
|
14
|
+
// var list = await this.get(db, query, body);
|
|
15
|
+
return await this.get(db, query, body);
|
|
16
|
+
}
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_dao",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.8",
|
|
4
4
|
"description": "一个通用的SQL帮助类,支持通过切换db_type实现对不同数据库的操作,包括MySQL和SQLite等;另提供 manager.js/drive.js 的SQL模板管理器(融合自 mm_os com/sql,基于 mm_corejs,内置管理器池,无全局/原型扩展依赖)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"mm_dbs": "^1.0.1",
|
|
54
54
|
"mm_excel": "^1.2.4",
|
|
55
55
|
"mm_helper": "^1.0.0",
|
|
56
|
-
"mm_machine": "^3.
|
|
56
|
+
"mm_machine": "^3.6.0",
|
|
57
57
|
"mm_ret": "^1.4.8",
|
|
58
58
|
"mm_sql": "^1.8.0"
|
|
59
59
|
},
|