Skip to content

Commit

Permalink
Make note about unwind-safety for SQLite custom functions in document…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
z33ky committed Sep 14, 2020
1 parent d47bb60 commit c2f4e7f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions diesel_derives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,17 @@ pub fn derive_valid_grouping(input: TokenStream) -> TokenStream {
/// # }
/// ```
///
/// ## Panics
///
/// If an implementation of the custom function panics and unwinding is enabled, the panic is
/// caught and the function returns to libsqlite with an error. It cannot propagate the panics due
/// to the FFI bounary.
/// The function or closure is internally wrapped in an
/// [`AssertUnwindSafe`](std::panic::AssertUnwindSafe). Its implementation must take care of
/// unwind-safety to avoid logic bugs on panic.
///
/// This also holds for [custom aggregate functions](#custom-aggregate-functions).
///
/// ## Custom Aggregate Functions
///
/// Custom aggregate functions can be created in SQLite by adding an `#[aggregate]`
Expand Down

0 comments on commit c2f4e7f

Please sign in to comment.