googleapis / googleapis/google-cloud-rust
Convert scalar `TableSchema` to `ProtoSchema` AST
- Dominant language
- Rust
- Stars
- 955
- Forks
- 144
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 279
Description
1. Map all 14 BigQuery scalar types (`STRING`, `BYTES`, `INT64`, `DOUBLE`, `BOOL`, `TIMESTAMP`, `DATE`, `TIME`, `DATETIME`, `GEOGRAPHY`, `NUMERIC`, `BIGNUMERIC`, `INTERVAL`, `JSON`) to `proto2` types (`FieldDescriptorProto::Type`).
2. Map `NULLABLE`, `REQUIRED`, and `REPEATED` modes to `proto2` labels (`LABEL_OPTIONAL`, `LABEL_REQUIRED`, `LABEL_REPEATED`). Map unset modes to `LABEL_OPTIONAL`.
3. Construct the root `DescriptorProto` with 1-based sequential field tags.
4. Implement entry point`TryFrom<&TableSchema> for ProtoSchema` and `TryFrom for ProtoSchema` for public conversion.
5. Expose `SchemaError` with typed variants for unsupported and invalid types.
6. Verify that the generated descriptors load correctly into `prost_reflect::DescriptorPool` and roundtrip dynamic messages.
Contributor guide
Assessment
This issue has not been assessed yet.