Browse Source

Merge pull request #7352 from nocodb/nc-fix/mysql-insert

fix: mysql single insert
pull/7355/head
Mert E 10 months ago committed by GitHub
parent
commit
487c15897c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/nocodb/src/db/BaseModelSqlv2.ts

11
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -2364,8 +2364,10 @@ class BaseModelSqlv2 {
if (response?.length) {
id = response[0];
} else {
const res = await this.execAndParse(query);
id = res?.id ?? res[0]?.insertId;
const res = await this.execAndParse(query, null, {
raw: true,
});
id = res?.id ?? res[0]?.insertId ?? res;
}
if (ai) {
@ -2727,11 +2729,8 @@ class BaseModelSqlv2 {
} else {
rowId = await this.execAndParse(query, null, {
raw: true,
first: true,
});
if (this.isMySQL) {
rowId = rowId?.insertId;
}
rowId = rowId.id ?? rowId[0]?.insertId ?? rowId;
}
if (ai) {

Loading…
Cancel
Save