Skip to content

Commit add1b35

Browse files
feat: Add precision and scale to MysqlColumn (#11507)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 4e7d204 commit add1b35

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ class MysqlColumn(proto.Message):
10281028
data_type (str):
10291029
The MySQL data type. Full data types list can
10301030
be found here:
1031+
10311032
https://dev.mysql.com/doc/refman/8.0/en/data-types.html
10321033
length (int):
10331034
Column length.
@@ -1042,6 +1043,10 @@ class MysqlColumn(proto.Message):
10421043
ordinal_position (int):
10431044
The ordinal position of the column in the
10441045
table.
1046+
precision (int):
1047+
Column precision.
1048+
scale (int):
1049+
Column scale.
10451050
"""
10461051

10471052
column: str = proto.Field(
@@ -1072,6 +1077,14 @@ class MysqlColumn(proto.Message):
10721077
proto.INT32,
10731078
number=7,
10741079
)
1080+
precision: int = proto.Field(
1081+
proto.INT32,
1082+
number=8,
1083+
)
1084+
scale: int = proto.Field(
1085+
proto.INT32,
1086+
number=9,
1087+
)
10751088

10761089

10771090
class MysqlTable(proto.Message):

packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ class MysqlColumn(proto.Message):
766766
data_type (str):
767767
The MySQL data type. Full data types list can
768768
be found here:
769+
769770
https://dev.mysql.com/doc/refman/8.0/en/data-types.html
770771
length (int):
771772
Column length.

packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10420,6 +10420,8 @@ def test_create_stream_rest(request_type):
1042010420
"primary_key": True,
1042110421
"nullable": True,
1042210422
"ordinal_position": 1725,
10423+
"precision": 972,
10424+
"scale": 520,
1042310425
}
1042410426
],
1042510427
}
@@ -10768,6 +10770,8 @@ def test_create_stream_rest_bad_request(
1076810770
"primary_key": True,
1076910771
"nullable": True,
1077010772
"ordinal_position": 1725,
10773+
"precision": 972,
10774+
"scale": 520,
1077110775
}
1077210776
],
1077310777
}
@@ -11001,6 +11005,8 @@ def test_update_stream_rest(request_type):
1100111005
"primary_key": True,
1100211006
"nullable": True,
1100311007
"ordinal_position": 1725,
11008+
"precision": 972,
11009+
"scale": 520,
1100411010
}
1100511011
],
1100611012
}
@@ -11327,6 +11333,8 @@ def test_update_stream_rest_bad_request(
1132711333
"primary_key": True,
1132811334
"nullable": True,
1132911335
"ordinal_position": 1725,
11336+
"precision": 972,
11337+
"scale": 520,
1133011338
}
1133111339
],
1133211340
}

0 commit comments

Comments
 (0)