Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: spanner JSON type #1260

Merged
merged 3 commits into from Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -161,6 +161,22 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum {
* <code>NUMERIC = 10;</code>
*/
NUMERIC(10),
/**
*
*
* <pre>
* Encoded as a JSON-formatted 'string' as described in RFC 7159. The
* following rules will be applied when parsing JSON input:
* - Whitespace will be stripped from the document.
* - If a JSON object has duplicate keys, only the first key will be
* preserved.
* - Members of a JSON object are not guaranteed to have their order
* preserved. JSON array elements will have their order preserved.
* </pre>
*
* <code>JSON = 11;</code>
*/
JSON(11),
UNRECOGNIZED(-1),
;

Expand Down Expand Up @@ -292,6 +308,22 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum {
* <code>NUMERIC = 10;</code>
*/
public static final int NUMERIC_VALUE = 10;
/**
*
*
* <pre>
* Encoded as a JSON-formatted 'string' as described in RFC 7159. The
* following rules will be applied when parsing JSON input:
* - Whitespace will be stripped from the document.
* - If a JSON object has duplicate keys, only the first key will be
* preserved.
* - Members of a JSON object are not guaranteed to have their order
* preserved. JSON array elements will have their order preserved.
* </pre>
*
* <code>JSON = 11;</code>
*/
public static final int JSON_VALUE = 11;

public final int getNumber() {
if (this == UNRECOGNIZED) {
Expand Down Expand Up @@ -339,6 +371,8 @@ public static TypeCode forNumber(int value) {
return STRUCT;
case 10:
return NUMERIC;
case 11:
return JSON;
default:
return null;
}
Expand Down
Expand Up @@ -58,15 +58,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "ructType\0223\n\006fields\030\001 \003(\0132#.google.spanne"
+ "r.v1.StructType.Field\032<\n\005Field\022\014\n\004name\030\001"
+ " \001(\t\022%\n\004type\030\002 \001(\0132\027.google.spanner.v1.T"
+ "ype*\233\001\n\010TypeCode\022\031\n\025TYPE_CODE_UNSPECIFIE"
+ "ype*\245\001\n\010TypeCode\022\031\n\025TYPE_CODE_UNSPECIFIE"
+ "D\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64\020\002\022\013\n\007FLOAT64\020\003\022\r\n"
+ "\tTIMESTAMP\020\004\022\010\n\004DATE\020\005\022\n\n\006STRING\020\006\022\t\n\005BY"
+ "TES\020\007\022\t\n\005ARRAY\020\010\022\n\n\006STRUCT\020\t\022\013\n\007NUMERIC\020"
+ "\nB\257\001\n\025com.google.spanner.v1B\tTypeProtoP\001"
+ "Z8google.golang.org/genproto/googleapis/"
+ "spanner/v1;spanner\252\002\027Google.Cloud.Spanne"
+ "r.V1\312\002\027Google\\Cloud\\Spanner\\V1\352\002\032Google:"
+ ":Cloud::Spanner::V1b\006proto3"
+ "\n\022\010\n\004JSON\020\013B\257\001\n\025com.google.spanner.v1B\tT"
+ "ypeProtoP\001Z8google.golang.org/genproto/g"
+ "oogleapis/spanner/v1;spanner\252\002\027Google.Cl"
+ "oud.Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1"
+ "\352\002\032Google::Cloud::Spanner::V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down
Expand Up @@ -128,4 +128,13 @@ enum TypeCode {
// <br>`[+-][Digits].Digits[ExponentIndicator[+-]Digits]`
// <br>(ExponentIndicator is `"e"` or `"E"`)
NUMERIC = 10;

// Encoded as a JSON-formatted 'string' as described in RFC 7159. The
// following rules will be applied when parsing JSON input:
// - Whitespace will be stripped from the document.
// - If a JSON object has duplicate keys, only the first key will be
// preserved.
// - Members of a JSON object are not guaranteed to have their order
// preserved. JSON array elements will have their order preserved.
JSON = 11;
}
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
"sha": "0da851ba875a78c3d50042fe611e6e5204b6ceab"
"sha": "4593395d291f6e9370c2d3df2695cb28b7d27e8d"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "551681f25e36b11829e87e580281350461f4f3f5",
"internalRef": "379784268"
"sha": "fb5c4fbc1ded09e6958d6be7ca36a9221dc7e52f",
"internalRef": "381156241"
}
},
{
Expand Down