tencent cloud

All product documents
TencentDB for TcaplusDB
Data Types
Last updated: 2024-12-04 10:12:05
Data Types
Last updated: 2024-12-04 10:12:05
TencentDB for TcaplusDB supports Protocol Buffers data types.

Mapping between proto3 and Data Types in Programing Languages

.proto
C++
Java
Python
Go
Ruby
C#
PHP
Dart
Notes
double
double
double
float
float64
float
double
float
double
-
float
float
float
float
float32
float
float
float
double
-
int32
int32
int
int
int32
fixnum/
bignum
(as required)
int
integer
int
Uses variable-length encoding.
Inefficient for encoding negative numbers. If your field is likely to have negative values, use sint32 instead.
int64
int64
long
int/
long
int64
bignum
long
integer/string
Int64
Uses variable-length encoding.
Inefficient for encoding negative numbers. If your field is likely to have negative values, use sint64 instead.
uint32
uint32
int
int/
long
uint32
fixnum/
bignum
(as required)
uint
integer
int
Uses variable-length encoding.
uint64
uint64
long
int/
long
uint64
bignum
ulong
integer/string
Int64
Uses variable-length encoding.
sint32
int32
int
int
int32
fixnum/
bignum
(as required)
int
integer
int
Uses variable-length encoding.
sint64
int64
long
int/
long
int64
bignum
long
integer/string
Int64
Uses variable-length encoding.
Signed int value. These more efficiently encode negative numbers than regular int32s.
fixed32
uint32
int
int/
long
uint32
fixnum/
bignum
(as required)
uint
integer
int
Always four bytes.
More efficient than uint32 if values are generally greater than 2^28.
fixed64
uint64
long
int/
long
uint64
bignum
ulong
integer/string
Int64
Always eight bytes.
More efficient than uint64 if values are generally greater than 2^56.
sfixed32
int32
int
int
int32
fixnum/
bignum
(as required)
int
integer
int
Always four bytes.
sfixed64
int64
long
int/
long
int64
bignum
long
integer/string
Int64
Always eight bytes.
bool
bool
boolean
bool
bool
trueClass/
falseClass
bool
boolean
bool
-
string
string
String
str/
unicode
string
string
(UTF -8)
string
string
string
A string must always contain UTF-8 encoded or 7-bit ASCII text, and cannot be longer than 2^32.
bytes
string
ByteString
str
byte
string
(ASCII-8BIT)
bytestring
string
-
May contain any arbitrary sequence of bytes no longer than 2^32.

Mapping between proto2 and Data Types in Programing Languages

.proto
C++
Java
Python
Go
Notes
double
double
double
float
*float64
-
float
float
float
float
*float32
-
int32
int32
int
int
*int32
Uses variable-length encoding. Inefficient for encoding negative numbers. If your field is likely to have negative values, use sint32 instead.
int64
int64
long
int/long
*int64
Uses variable-length encoding. Inefficient for encoding negative numbers. If your field is likely to have negative values, use sint64 instead.
uint32
uint32
int
int/long
*uint32
Uses variable-length encoding.
uint64
uint64
long
int/long
*uint64
Uses variable-length encoding.
sint32
int32
int
int
*int32
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.
sint64
int64
long
int/long
*int64
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.
fixed32
uint32
int
int/long
*uint32
Always four bytes. More efficient than uint32 if values are generally greater than 2^28.
fixed64
uint64
long
int/long
*uint64
Always eight bytes. More efficient than uint64 if values are generally greater than 2^56.
sfixed32
int32
int
int
*int32
Always four bytes.
sfixed64
int64
long
int/long
*int64
Always eight bytes.
bool
bool
boolean
bool
*bool
-
string
string
String
unicode(Python 2)
or
str(Python 3)
*string
A string must always contain UTF-8 encoded or 7-bit ASCII text.
bytes
string
ByteString
bytes
byte
May contain any arbitrary sequence of bytes.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon