Closed arpad-m closed 3 months ago
functions
: 32.5% (6872 of 21175 functions)
lines
: 49.9% (53419 of 107076 lines)
* collected from Rust tests only
I decided against derive tricks because the custom logic in RemoteStorageConfig::from_toml seemed daunting.
yeah tbh serialization derives are poorly documented and it's not very easy to inspect the resulting format/schema. This PR for example (probably) regresses error messages, but I think it's okay as we use derives everywhere so it's a sunken cost.
I filed this PR because I didn't like the additional code that #7743 meant. serde is really not good for writing manual (de)serializations, the code is less maintainable. Now it's way easier to add additional fields.
Does Serialize also work? I need that in https://github.com/neondatabase/neon/pull/7656
Oh that's interesting. Why do you need Serialize there? I think it's easy to add it.
Oh that's interesting. Why do you need Serialize there? I think it's easy to add it.
Ok, I'll add it in https://github.com/neondatabase/neon/pull/7656 then
Adds a
Deserialize
impl toRemoteStorageConfig
. We thus achieve the same as #7743 but with less repetitive code, by derivingDeserialize
impls onS3Config
,AzureConfig
, andRemoteStorageConfig
. The disadvantage is less useful error messages.The git history of this PR contains a state where we go via an intermediate representation, leveraging the serde_json crate.
Also, the PR adds tests.
Alternative to #7743 .