-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: support json in Any
driver
#3998
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
base: main
Are you sure you want to change the base?
Conversation
Any
driver
Any
driverAny
driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to land this feature, though unfortunately it's a little more complicated than it may have seemed initially.
@abonander thank you for your feedback! I've gone ahead and made your suggested changes. However, when the thorough Postgres test suite starts there appears to be a syntax error or something similar. My knowledge of postgres is fairly limited unfortunately.
The test uses the following queries: sqlx::query("create temporary table json_test (data TEXT)")
sqlx::query("insert into json_test (data) values (?)") should I'll look into spinning up my own postgres server for testing |
That's likely fixed by using Here's an example from #3960: #[cfg(feature = "postgres")]
const SQL: &str =
"SELECT 'Hello, world!' as string where 'Hello, world!' in ($1, $2, $3, $4, $5, $6, $7)";
#[cfg(not(feature = "postgres"))]
const SQL: &str =
"SELECT 'Hello, world!' as string where 'Hello, world!' in (?, ?, ?, ?, ?, ?, ?)"; |
This comment was marked as outdated.
This comment was marked as outdated.
Was the |
@iamjpotts nope! Zed formatting my apologies. I'll revert. |
Reverted and showing no change! Thanks everyone for your help and patience:) |
Does your PR solve an issue?
Fixes: #3997
This PR adds implementations for Decode and Encode for
Json<T>
with support forAny
.Is this a breaking change?
No, this is not a breaking change. It adds new functionality only.