fix(contrib/drivers/pgsql): Fixed table field call issue in primary key acquisition logic (#4546)

`pgsql driver`中`getPrimaryKeys`未使用现有缓存,导致每次`insert`都会重新查询表字段
This commit is contained in:
Lance Add
2025-12-08 16:27:17 +08:00
committed by GitHub
parent 67a8a28a18
commit 4080452ead

View File

@ -75,7 +75,7 @@ func (d *Driver) DoInsert(
// getPrimaryKeys retrieves the primary key field list of the table.
// This method extracts primary key information from TableFields.
func (d *Driver) getPrimaryKeys(ctx context.Context, table string) ([]string, error) {
tableFields, err := d.TableFields(ctx, table)
tableFields, err := d.GetCore().GetDB().TableFields(ctx, table)
if err != nil {
return nil, err
}