-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support smartstring #1998
Comments
Hey @gitmalong, if I am not mistaken, you should still be able to use the How is that useful to you? Well, it means that when you write a query, you are able to still use SmartStrings in places where query("INSERT INTO shitty_code_examples(author, code) VALUES ('xfbs', ?)")
.bind(&your_smart_string_here)
.execute(&pool)
.await?; I hope this makes sense. If this didn't answer your question, feel free to give more context and/or show me what code you are trying to run. |
Hi @xfbs . Thanks for your explanation. I'll give that a try tomorrow and report back! |
My response here is the same as #1922 (comment) Every external crate we add is another semver hazard, so it needs to be very compelling to make it worthwhile. |
I just gave sqlx::query(
"
INSERT INTO public.my_table(value, current_value)
SELECT *, $4 FROM UNNEST($1::text[], $2::decimal[])
",
)
.bind(data.values) # of type: Vec<CompactString, Global>
.bind(data.numbers)
.execute(pool)
.await Error:
|
I tried using the https://docs.rs/smartstring/1.0.1/smartstring/ crate together with sqlx but that string type is not supported when binding variables. Are there any plans to support such small string crates as optional feature?
The text was updated successfully, but these errors were encountered: