Exception: Sqlx::RecordNotUnique
- Defined in:
- runtime/sqlx/errors.rb,
runtime/sqlx/errors.rbs
Overview
Raised when an INSERT/UPDATE trips a unique index. Apps rescue it to turn a lost race into a redirect rather than a 500.
Raised by each Sqlx::Database, not from here: the driver error
surfaces in Sqlx::Database.exec, the only place holding it. The sqlite
adapter (database/sqlite.rb) maps it in exec, keyed on the engine's
own message text ("UNIQUE constraint failed:
11 |
# File 'runtime/sqlx/errors.rbs', line 11
def initialize: (?String message) -> void
|