badmfck-api-server 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,6 +63,17 @@ class MysqlService extends BaseService_1.BaseService {
63
63
  .replaceAll('@fields', insertFieldNames.join(","))
64
64
  .replaceAll('@values', insertFieldValues.join(","));
65
65
  }
66
+ if (query.indexOf("@insert") !== -1) {
67
+ let oninsertNames = [];
68
+ let oninsertValues = [];
69
+ for (let i of fields) {
70
+ if (i.ignoreInInsert)
71
+ continue;
72
+ oninsertNames.push(i.name);
73
+ oninsertValues.push(i._parsedValue);
74
+ }
75
+ query = query.replaceAll("@oninsert", `(${oninsertNames.join(",")}) VALUES (${oninsertValues.join(",")})`);
76
+ }
66
77
  if (query.indexOf("@onupdate") !== -1) {
67
78
  let onUpdate = [];
68
79
  for (let i of fields) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",