mm_dbs 0.0.0-stage → 1.0.0

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ ## 数据库框架(mm_db)
2
+ 用于mysql数据库生成表或生成sql模板,通过设计数据库就可以生成sql模板,或通过db.json配置文件就可以生成mysql数据表
3
+ 可以便捷的实现数据库架构设计和相应业务的API
package/com.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "DB",
3
+ "title": "数据管理器",
4
+ "state": 1
5
+ }
package/index.js ADDED
@@ -0,0 +1,24 @@
1
+ const Manager = require('./lib/manager');
2
+ const Admin = require('mm_corejs').Admin;
3
+
4
+ const admin = new Admin();
5
+ admin.setClass(Manager);
6
+
7
+ module.exports = {
8
+ Drive: require('./lib/drive'),
9
+ Manager,
10
+ admin,
11
+ /**
12
+ * 获取数据库管理器实例
13
+ * @param {String} scope 作用域名称
14
+ * @param {Object} config 配置参数
15
+ * @param {Object} os 操作系统实例
16
+ * @returns {Manager} 数据库管理器实例
17
+ */
18
+ dbAdmin(scope, config = {}, os) {
19
+ if (!scope) {
20
+ scope = 'os';
21
+ }
22
+ return admin.get(scope, { name: scope, ...config }, os);
23
+ }
24
+ };