google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

Align supported Spanner Interval literal formats

Open scotthart opened this issue 8 months ago • 1 comments

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.

scotthart avatar May 06 '25 16:05 scotthart

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 (and Interval::operator std::string()).

devbww avatar May 06 '25 21:05 devbww