google-cloud-cpp
google-cloud-cpp copied to clipboard
Align supported Spanner Interval literal formats
The Spanner service currently accepts ISO8601 formatted literals as well as a subset of other formats that are supported in Postgres. The google::cloud::spanner::MakeInterval function accepts both ISO8601 formats as well as a larger subet of Postgres formats. It would be nice if MakeInterval and Spanner (via GoogleSQL) were consistent and accepted and denied the same set of Interval literal formats.
This is a non-issue. It is a feature for MakeInterval() to adhere to the robustness principle and be liberal in what it accepts.
The only things to guarantee are that:
-
Interval::operator std::string()produces a value acceptable to the service, and -
MakeInterval()accepts values produced by the service (andInterval::operator std::string()).