Open solwey-wes opened 1 year ago
Changing a serializer is a breaking change so it would have to be optional; I suggest you start with something custom and we can later add it here if there is more interest. Thanks :)
@dave26199 Oki will do. I was gonna ask how this would be breaking ‘cause de/serialization of existing values would function exactly as before, but I think I get it…consumers might be implicitly casting to seconds and relying on systems that assume that exact fidelity without decimals/commas. But if so, it seems those systems function in spite of ISO spec…which exists to minimize these compatibility issues. A strange loop 👀.
Either way I seem to be the only one who has bumped into this so happy to chip away at it and submit a PR so it’s here if more come along :)
It's more the serialization side I was worried about, writing a different string can definitely be breaking :) but different deserialization is also a behavior change even if it seems more correct.
Sounds good, thanks.
Per https://stackoverflow.com/questions/27058529/iso-8601-duration-with-milliseconds
Use case - EdgeDB outputs ISO 8601 duration values with decimal values for millisecond precision (and doesn't currently have a DSL function to convert to milliseconds since epoch). I can address with them or write something custom but I figure an update to the bundled serializer would be the best solution :)
'PT9.977S'
https://www.edgedb.com/docs/stdlib/datetime#function::std::duration_get