perf(go): simplify identity binding lookup

This commit is contained in:
lingniu
2026-07-03 08:01:00 +08:00
parent 2af2ba3367
commit 0b9e803139
3 changed files with 26 additions and 1 deletions

View File

@@ -161,7 +161,7 @@ func (r *MySQLResolver) Resolve(ctx context.Context, env envelope.FrameEnvelope)
}
func (r *MySQLResolver) lookup(ctx context.Context, column string, value string) (string, error) {
query := "SELECT vin FROM " + r.table + " WHERE " + column + " = ? AND vin IS NOT NULL AND vin <> '' ORDER BY updated_at DESC LIMIT 1"
query := "SELECT vin FROM " + r.table + " WHERE " + column + " = ? AND vin IS NOT NULL AND vin <> ''"
var vin string
err := r.db.QueryRowContext(ctx, query, value).Scan(&vin)
return vin, err