在 Cloud Spanner 中表示国际 phone 号码

Represent international phone numbers in Cloud Spanner

在 Google Cloud Spanner 中表示国际 phone 号码的最佳方式是什么?我希望它与定义的原型一致 here.

我要说明的是,我需要捕获的 phone 数字是 e164_number 格式,并且我已将扩展名(如在原型中)表示为 STRING 列。这是一个潜在的解决方案,但我觉得可能有更正确的解决方案。任何帮助将不胜感激。

听起来您的用例非常适合 Cloud Spanner 现在支持的 JSON 类型。您应该能够为 phone_number.proto that you have linked. Please see https://cloud.google.com/spanner/docs/working-with-json 为 how-to 创建相应的 JSON 表示,以及如何在读取期间查询各个字段的示例。