Skip to content

How can i use pattern matching in postgres #3249

Closed Answered by newholder
newholder asked this question in Q&A
Discussion options

You must be logged in to vote

Human error, Just put the percentage in the bind, so

let name = "%hy%"
sqlx::query_as(r#"SELECT * FROM namelist WHERE name LIKE $1"#)
    .bind(name)
    .fetch_all(pool)
    .await;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by newholder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant