|
|
@ -1431,7 +1431,15 @@ class BaseModelSqlv2 { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const ai = this.model.columns.find((c) => c.ai); |
|
|
|
const ai = this.model.columns.find((c) => c.ai); |
|
|
|
if ( |
|
|
|
|
|
|
|
|
|
|
|
let ag: Column; |
|
|
|
|
|
|
|
if (!ai) ag = this.model.columns.find((c) => c.meta?.ag); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handle if autogenerated primary key is used
|
|
|
|
|
|
|
|
if (ag) { |
|
|
|
|
|
|
|
if (!response) await this.extractRawQueryAndExec(query); |
|
|
|
|
|
|
|
response = await this.readByPk(data[ag.title]); |
|
|
|
|
|
|
|
} else if ( |
|
|
|
!response || |
|
|
|
!response || |
|
|
|
(typeof response?.[0] !== 'object' && response?.[0] !== null) |
|
|
|
(typeof response?.[0] !== 'object' && response?.[0] !== null) |
|
|
|
) { |
|
|
|
) { |
|
|
|