Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to represent international phone numbers in Cloud Spanner?

What would be the best way to represent international phone numbers in Google Cloud Spanner? I would like it to be consistent with the proto defined here.

The phone numbers we will record are of e164_number format (as in the proto) and I have tried representing  the Extension (as in the proto) as a STRING column. This is a potential fix, but I feel like there could be a more correct solution. Any help would be appreciated.


 
Solved Solved
0 2 294
1 ACCEPTED SOLUTION

You may consider using the JSON type in Cloud Spanner by tailoring the fields to match your requirements. The documentation page titled "Working with JSON data" has more related details. 

View solution in original post

2 REPLIES 2

You may consider using the JSON type in Cloud Spanner by tailoring the fields to match your requirements. The documentation page titled "Working with JSON data" has more related details. 

Thank you for your help here. This ended up solving the problem I was facing.