Skip to content

Commit

Permalink
Fix SQLx example
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Jun 4, 2024
1 parent 8618df2 commit 1930ceb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqlite-hashes"
version = "0.7.2" # This value is also used in the README.md
version = "0.7.3" # This value is also used in the README.md
description = "Hashing functions for SQLite with aggregation support: MD5, SHA1, SHA256, SHA512, FNV-1a, xxHash"
authors = ["Yuri Astrakhan <YuriAstrakhan@gmail.com>"]
repository = "https://github.com/nyurik/sqlite-hashes"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ fn main() {
To use with [SQLx](https://crates.io/crates/sqlx), you need to get the raw handle from the `SqliteConnection` and pass it to the registration function.

```rust,ignore
use rusqlite::Connection;
use sqlite_hashes::register_hash_functions;
use sqlx::sqlite::SqliteConnection;
async fn register_functions(sqlx_conn: &SqliteConnection) {
async fn register_functions(sqlx_conn: &mut SqliteConnection) {
// SAFETY: No query must be performed on `sqlx_conn` until `handle_lock` is dropped.
let mut handle_lock = sqlx_conn.lock_handle().await.unwrap();
let handle = handle_lock.as_raw_handle().as_ptr();
Expand Down

0 comments on commit 1930ceb

Please sign in to comment.