兼容 mariadb add 强制去除id

This commit is contained in:
cool 2024-04-07 18:20:34 +08:00
parent 8f35e571fb
commit b526c75161
3 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@cool-midway/core",
"version": "7.1.15",
"version": "7.1.16",
"description": "",
"main": "dist/index.js",
"typings": "index.d.ts",

View File

@ -1,6 +1,6 @@
{
"name": "@cool-midway/core",
"version": "7.1.15",
"version": "7.1.16",
"description": "",
"main": "index.js",
"typings": "index.d.ts",

View File

@ -58,6 +58,7 @@ export abstract class BaseService {
async init() {
const services = {
mysql: this.baseMysqlService,
mariadb: this.baseMysqlService,
postgres: this.basePgService,
sqlite: this.baseSqliteService,
};
@ -209,6 +210,7 @@ export abstract class BaseService {
*/
async add(param: any | any[]): Promise<Object> {
if (!this.entity) throw new CoolValidateException(ERRINFO.NOENTITY);
delete param.id;
await this.addOrUpdate(param, "add");
return {
id: