Search for similar Uuid with default ToSql? #1472
-
I have a sqlite database CREATE TABLE IF NOT EXISTS tasks (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
) Where the id is a struct Task {
id: Uuid,
name: String,
} Is it possible to search for similar tasks with the default ToSql for Uuid? conn.execute("
SELECT * FROM tasks
WHERE id LIKE ?1
",
params!["bee5d"]
) I got it working if I saved the Uuid as a string If I use the default ToSql for Uuid it can look like '(`pl>U' in the database. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I don't think so: Line 59 in 30a2110 But you should be able to use the |
Beta Was this translation helpful? Give feedback.
I don't think so:
rusqlite/src/types/value.rs
Line 59 in 30a2110
But you should be able to use the
task.id.as_bytes()[..6]
as parameter (not tested).