Enum google_api_proto::google::spanner::v1::TypeAnnotationCode
source · #[repr(i32)]pub enum TypeAnnotationCode {
Unspecified = 0,
PgNumeric = 2,
PgJsonb = 3,
PgOid = 4,
}
Expand description
TypeAnnotationCode
is used as a part of [Type][google.spanner.v1.Type] to
disambiguate SQL types that should be used for a given Cloud Spanner value.
Disambiguation is needed because the same Cloud Spanner type can be mapped to
different SQL types depending on SQL dialect. TypeAnnotationCode doesn’t
affect the way value is serialized.
Variants§
Unspecified = 0
Not specified.
PgNumeric = 2
PostgreSQL compatible NUMERIC type. This annotation needs to be applied to [Type][google.spanner.v1.Type] instances having [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that values of this type should be treated as PostgreSQL NUMERIC values. Currently this annotation is always needed for [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with PostgreSQL-enabled Spanner databases.
PgJsonb = 3
PostgreSQL compatible JSONB type. This annotation needs to be applied to [Type][google.spanner.v1.Type] instances having [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of this type should be treated as PostgreSQL JSONB values. Currently this annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] when a client interacts with PostgreSQL-enabled Spanner databases.
PgOid = 4
PostgreSQL compatible OID type. This annotation can be used by a client interacting with PostgreSQL-enabled Spanner database to specify that a value should be treated using the semantics of the OID type.
Implementations§
source§impl TypeAnnotationCode
impl TypeAnnotationCode
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for TypeAnnotationCode
impl Clone for TypeAnnotationCode
source§fn clone(&self) -> TypeAnnotationCode
fn clone(&self) -> TypeAnnotationCode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TypeAnnotationCode
impl Debug for TypeAnnotationCode
source§impl Default for TypeAnnotationCode
impl Default for TypeAnnotationCode
source§fn default() -> TypeAnnotationCode
fn default() -> TypeAnnotationCode
source§impl From<TypeAnnotationCode> for i32
impl From<TypeAnnotationCode> for i32
source§fn from(value: TypeAnnotationCode) -> i32
fn from(value: TypeAnnotationCode) -> i32
source§impl Hash for TypeAnnotationCode
impl Hash for TypeAnnotationCode
source§impl Ord for TypeAnnotationCode
impl Ord for TypeAnnotationCode
source§fn cmp(&self, other: &TypeAnnotationCode) -> Ordering
fn cmp(&self, other: &TypeAnnotationCode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for TypeAnnotationCode
impl PartialEq for TypeAnnotationCode
source§fn eq(&self, other: &TypeAnnotationCode) -> bool
fn eq(&self, other: &TypeAnnotationCode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TypeAnnotationCode
impl PartialOrd for TypeAnnotationCode
source§fn partial_cmp(&self, other: &TypeAnnotationCode) -> Option<Ordering>
fn partial_cmp(&self, other: &TypeAnnotationCode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for TypeAnnotationCode
impl TryFrom<i32> for TypeAnnotationCode
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
source§fn try_from(value: i32) -> Result<TypeAnnotationCode, UnknownEnumValue>
fn try_from(value: i32) -> Result<TypeAnnotationCode, UnknownEnumValue>
impl Copy for TypeAnnotationCode
impl Eq for TypeAnnotationCode
impl StructuralPartialEq for TypeAnnotationCode
Auto Trait Implementations§
impl Freeze for TypeAnnotationCode
impl RefUnwindSafe for TypeAnnotationCode
impl Send for TypeAnnotationCode
impl Sync for TypeAnnotationCode
impl Unpin for TypeAnnotationCode
impl UnwindSafe for TypeAnnotationCode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request