Repodb.Error

repodb · API reference

type db_error = 
  | Connection_failed of string
  | Query_failed of string
  | Constraint_violation of {
    constraint_name : string;
    message : string;
  }
  | Not_found
  | Multiple_results_found
  | Transaction_failed of string
  | Migration_failed of {
    version : int64;
    message : string;
  }
  | Validation_failed of string list
  | Pool_exhausted
  | Timeout
exception Unsupported_dialect_feature of {
  feature : string;
  dialect : string;
  suggestion : string option;
}

Exception raised when using a feature not supported by the current dialect. For example, PostgreSQL-only JSON containment and key operators on SQLite.

type validation_error = {
  field : string;
  message : string;
  validation : string;
}
type 'a db_result = ('a, db_error) result
type 'a changeset_result = ('a, validation_error list) result
val pp_db_error : Format.formatter -> db_error -> unit
val pp_validation_error : Format.formatter -> validation_error -> unit
val show_db_error : db_error -> string
val show_validation_error : validation_error -> string
val unsupported_dialect_feature : 
  feature:string ->
  dialect:string ->
  ?suggestion:string ->
  unit ->
  'a