Exception raised when a LibSQL database operation fails.
This exception contains detailed error information from the underlying LibSQL/SQLite database, including constraint violation details.
Fields
:message- Human-readable error message:sqlite- Map containing SQLite-specific error details (:code,:message)
Summary
Functions
Extracts the constraint field name from an error message.
Checks if the error is a constraint violation.
Types
Functions
Extracts the constraint field name from an error message.
Returns the field name if a constraint violation pattern is found,
nil otherwise.
Examples
iex> error = %EctoLibSql.Error{message: "constraint failed: users.email"}
iex> EctoLibSql.Error.constraint_name(error)
"email"
Checks if the error is a constraint violation.
Returns true if the error message indicates a constraint failure,
false otherwise.
Examples
iex> error = %EctoLibSql.Error{message: "constraint failed: users.email"}
iex> EctoLibSql.Error.constraint_violation?(error)
true