perf(providers): make POST /api/providers O(1) and refuse silent key overwrite (#4350)
Fixes #4311 - Drop full-pool renumber on insert: new row gets MAX(priority)+1 directly, turning an O(pool) rewrite into O(1) per insert. - For apikey connections, query by (provider, authType, name) and count via SQL aggregate instead of reading the entire pool into memory. - Refuse silent apikey overwrite on name collision with 409 PROVIDER_NAME_CONFLICT, unless caller explicitly sets allowOverwrite: true. - Add 8 unit tests covering priority ordering and name collisions.
N
Nikan Wystaf committed
239bcfc568038653ada4bf9b7823f3726450ddfa
Parent: 199173f