Sqlite: Allow registering an impl for a no-arg sql function #3179
brassy-endomorph
started this conversation in
Ideas
Replies: 1 comment
-
This is not supported using the 1.4.x release. The master branch/2.0.0-rc.0 release allows this with a slightly different syntax: diesel::sql_function!(fn uuidv4() -> Binary);
fn foo(conn: &SqliteConnection) -> Result<(), _> {
uuidv4::register_impl(&conn, || Vec::from(Uuid::new_v4().as_bytes())
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It may be that the docs are missing something clear, but I want to be able to create a no-arg sql function and register a rust function to execute it. For example, this should work:
It is possible to register impls for functions with arguments but not without.
Beta Was this translation helpful? Give feedback.
All reactions