@cloudbase/manager-node 5.5.0 → 5.5.1
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/lib/database/index.js +8 -5
- package/package.json +1 -1
package/lib/database/index.js
CHANGED
|
@@ -64,7 +64,8 @@ class DatabaseService {
|
|
|
64
64
|
}
|
|
65
65
|
async createCollection(collectionName) {
|
|
66
66
|
let { Tag } = this.getDatabaseConfig();
|
|
67
|
-
const res = await this.
|
|
67
|
+
const res = await this.dbOpService.request('CreateTable', {
|
|
68
|
+
EnvId: this.envId,
|
|
68
69
|
Tag,
|
|
69
70
|
TableName: collectionName
|
|
70
71
|
});
|
|
@@ -75,7 +76,8 @@ class DatabaseService {
|
|
|
75
76
|
const existRes = await this.checkCollectionExists(collectionName);
|
|
76
77
|
if (existRes.Exists) {
|
|
77
78
|
let { Tag } = this.getDatabaseConfig();
|
|
78
|
-
const res = await this.
|
|
79
|
+
const res = await this.dbOpService.request('DeleteTable', {
|
|
80
|
+
EnvId: this.envId,
|
|
79
81
|
Tag,
|
|
80
82
|
TableName: collectionName
|
|
81
83
|
});
|
|
@@ -87,12 +89,13 @@ class DatabaseService {
|
|
|
87
89
|
}
|
|
88
90
|
async updateCollection(collectionName, indexiesInfo) {
|
|
89
91
|
let { Tag } = this.getDatabaseConfig();
|
|
90
|
-
const res = await this.
|
|
92
|
+
const res = await this.dbOpService.request('UpdateTable', Object.assign({ EnvId: this.envId, Tag, TableName: collectionName }, indexiesInfo));
|
|
91
93
|
return res;
|
|
92
94
|
}
|
|
93
95
|
async describeCollection(collectionName) {
|
|
94
96
|
let { Tag } = this.getDatabaseConfig();
|
|
95
|
-
return this.
|
|
97
|
+
return this.dbOpService.request('DescribeTable', {
|
|
98
|
+
EnvId: this.envId,
|
|
96
99
|
Tag,
|
|
97
100
|
TableName: collectionName
|
|
98
101
|
});
|
|
@@ -109,7 +112,7 @@ class DatabaseService {
|
|
|
109
112
|
if (options.MgoOffset === undefined) {
|
|
110
113
|
options.MgoOffset = this.DEFAULT_MGO_OFFSET;
|
|
111
114
|
}
|
|
112
|
-
const res = await this.
|
|
115
|
+
const res = await this.dbOpService.request('ListTables', Object.assign({ EnvId: this.envId, Tag }, options));
|
|
113
116
|
if (res.Tables === null) {
|
|
114
117
|
// 无集合
|
|
115
118
|
res.Collections = [];
|