@rdyl/node-mysql 0.0.7 → 0.0.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## 0.0.7 (2025-04-10)
1
+ ## 0.0.8 (2025-04-11)
2
2
 
3
3
 
4
4
 
package/dist/meta.js CHANGED
@@ -36,15 +36,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.DbSchema = void 0;
39
+ exports.MysqlDbSchema = void 0;
40
40
  var helper_1 = require("./helper");
41
41
  var utils_1 = require("./utils");
42
42
  /**
43
43
  * @description
44
44
  * 使用$toMap时 不返回的字段名前面需要加$
45
45
  */
46
- var DbSchema = /** @class */ (function () {
47
- function DbSchema($table, $mapExFields) {
46
+ var MysqlDbSchema = /** @class */ (function () {
47
+ function MysqlDbSchema($table, $mapExFields) {
48
48
  if ($mapExFields === void 0) { $mapExFields = []; }
49
49
  this.$table = $table;
50
50
  this.$mapExFields = $mapExFields;
@@ -52,7 +52,7 @@ var DbSchema = /** @class */ (function () {
52
52
  this.createTime = utils_1.Parser.easyDate();
53
53
  this.updateTime = utils_1.Parser.easyDate();
54
54
  }
55
- Object.defineProperty(DbSchema.prototype, "$toJson", {
55
+ Object.defineProperty(MysqlDbSchema.prototype, "$toJson", {
56
56
  get: function () {
57
57
  var _this = this;
58
58
  return Object.keys(this).reduce(function (obj, key) {
@@ -67,7 +67,7 @@ var DbSchema = /** @class */ (function () {
67
67
  enumerable: false,
68
68
  configurable: true
69
69
  });
70
- Object.defineProperty(DbSchema.prototype, "$toMap", {
70
+ Object.defineProperty(MysqlDbSchema.prototype, "$toMap", {
71
71
  get: function () {
72
72
  var _this = this;
73
73
  var target = this.$toJson;
@@ -80,14 +80,14 @@ var DbSchema = /** @class */ (function () {
80
80
  enumerable: false,
81
81
  configurable: true
82
82
  });
83
- Object.defineProperty(DbSchema.prototype, "$fields", {
83
+ Object.defineProperty(MysqlDbSchema.prototype, "$fields", {
84
84
  get: function () {
85
85
  return Object.keys(this.$toJson);
86
86
  },
87
87
  enumerable: false,
88
88
  configurable: true
89
89
  });
90
- DbSchema.prototype.$formJson = function (json) {
90
+ MysqlDbSchema.prototype.$formJson = function (json) {
91
91
  var _this = this;
92
92
  Object.keys(json).forEach(function (k) {
93
93
  if (Object.prototype.hasOwnProperty.call(_this, k)) {
@@ -96,7 +96,7 @@ var DbSchema = /** @class */ (function () {
96
96
  }
97
97
  });
98
98
  };
99
- DbSchema.prototype.$get = function () {
99
+ MysqlDbSchema.prototype.$get = function () {
100
100
  return __awaiter(this, void 0, void 0, function () {
101
101
  var selector, res;
102
102
  return __generator(this, function (_a) {
@@ -115,7 +115,7 @@ var DbSchema = /** @class */ (function () {
115
115
  });
116
116
  });
117
117
  };
118
- DbSchema.prototype.$insert = function (uniqueKey) {
118
+ MysqlDbSchema.prototype.$insert = function (uniqueKey) {
119
119
  return __awaiter(this, void 0, void 0, function () {
120
120
  var inserter, existing, res;
121
121
  return __generator(this, function (_a) {
@@ -147,7 +147,7 @@ var DbSchema = /** @class */ (function () {
147
147
  });
148
148
  });
149
149
  };
150
- DbSchema.prototype.$remove = function () {
150
+ MysqlDbSchema.prototype.$remove = function () {
151
151
  return __awaiter(this, void 0, void 0, function () {
152
152
  var deleter, user;
153
153
  return __generator(this, function (_a) {
@@ -165,7 +165,7 @@ var DbSchema = /** @class */ (function () {
165
165
  });
166
166
  });
167
167
  };
168
- DbSchema.prototype.$update = function (maps) {
168
+ MysqlDbSchema.prototype.$update = function (maps) {
169
169
  return __awaiter(this, void 0, void 0, function () {
170
170
  var updater, user, values, affected;
171
171
  return __generator(this, function (_a) {
@@ -196,6 +196,6 @@ var DbSchema = /** @class */ (function () {
196
196
  });
197
197
  });
198
198
  };
199
- return DbSchema;
199
+ return MysqlDbSchema;
200
200
  }());
201
- exports.DbSchema = DbSchema;
201
+ exports.MysqlDbSchema = MysqlDbSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdyl/node-mysql",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
package/types/meta.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @description
3
3
  * 使用$toMap时 不返回的字段名前面需要加$
4
4
  */
5
- export declare class DbSchema implements DbBaseType {
5
+ export declare class MysqlDbSchema implements MysqlDbBaseType {
6
6
  $table: string;
7
7
  $mapExFields: string[];
8
8
  id: number | string;
@@ -16,7 +16,7 @@ export declare class DbSchema implements DbBaseType {
16
16
  get $fields(): string[];
17
17
  $formJson(json: Record<string, unknown>): void;
18
18
  $get(): Promise<this | null>;
19
- $insert(uniqueKey?: string): Promise<DbResultStat>;
20
- $remove(): Promise<DbResultStat>;
21
- $update(maps: Record<string, unknown>): Promise<DbResultStat>;
19
+ $insert(uniqueKey?: string): Promise<MysqlDbResultStat>;
20
+ $remove(): Promise<MysqlDbResultStat>;
21
+ $update(maps: Record<string, unknown>): Promise<MysqlDbResultStat>;
22
22
  }
package/types/type.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  type DbId = number | string;
2
2
 
3
- interface DbBaseType {
3
+ interface MysqlDbBaseType {
4
4
  id: DbId;
5
5
  createTime: string;
6
6
  updateTime: string;
7
7
  }
8
8
 
9
- type DbResultStat = "exist" | "ok" | "fail";
9
+ type MysqlDbResultStat = "exist" | "ok" | "fail";