Documentation
¶
Overview ¶
Package marshal documents marshaling interfaces.
User defined marshaler/unmarshalers can be defined for any scalar EdgeDB type except arrays. They must implement the interface for their type. For example a custom int64 unmarshaler should implement Int64Unmarshaler.
Optional Fields ¶
When shape fields in a query result are optional (not required) the client requires the out value's optional fields to implement OptionalUnmarshaler. For scalar types, this means that the field value will need to implement a custom marshaler interface i.e. Int64Unmarshaler AND OptionalUnmarshaler. For shapes, only OptionalUnmarshaler needs to be implemented.
Index ¶
- type BigIntMarshaler
- type BigIntUnmarshaler
- type BoolMarshaler
- type BoolUnmarshaler
- type BytesMarshaler
- type BytesUnmarshaler
- type DateDurationMarshaler
- type DateDurationUnmarshaler
- type DateTimeMarshaler
- type DateTimeUnmarshaler
- type DecimalMarshaler
- type DecimalUnmarshaler
- type DurationMarshaler
- type DurationUnmarshaler
- type Float32Marshaler
- type Float32Unmarshaler
- type Float64Marshaler
- type Float64Unmarshaler
- type Int16Marshaler
- type Int16Unmarshaler
- type Int32Marshaler
- type Int32Unmarshaler
- type Int64Marshaler
- type Int64Unmarshaler
- type JSONMarshaler
- type JSONUnmarshaler
- type LocalDateMarshaler
- type LocalDateTimeMarshaler
- type LocalDateTimeUnmarshaler
- type LocalDateUnmarshaler
- type LocalTimeMarshaler
- type LocalTimeUnmarshaler
- type MemoryMarshaler
- type MemoryUnmarshaler
- type OptionalMarshaler
- type OptionalScalarUnmarshaler
- type OptionalUnmarshaler
- type RelativeDurationMarshaler
- type RelativeDurationUnmarshaler
- type StrMarshaler
- type StrUnmarshaler
- type UUIDMarshaler
- type UUIDUnmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigIntMarshaler ¶ added in v0.8.0
BigIntMarshaler is the interface implemented by an object that can marshal itself into the bigint wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bigint
MarshalEdgeDBBigInt encodes the receiver into a binary form and returns the result.
type BigIntUnmarshaler ¶ added in v0.8.0
BigIntUnmarshaler is the interface implemented by an object that can unmarshal the bigint wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bigint
UnmarshalEdgeDBBigInt must be able to decode the bigint wire format. UnmarshalEdgeDBBigInt must copy the data if it wishes to retain the data after returning.
type BoolMarshaler ¶ added in v0.8.0
BoolMarshaler is the interface implemented by an object that can marshal itself into the bool wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bool
MarshalEdgeDBBool encodes the receiver into a binary form and returns the result.
type BoolUnmarshaler ¶ added in v0.8.0
BoolUnmarshaler is the interface implemented by an object that can unmarshal the bool wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bool
UnmarshalEdgeDBBool must be able to decode the bool wire format. UnmarshalEdgeDBBool must copy the data if it wishes to retain the data after returning.
type BytesMarshaler ¶ added in v0.8.0
BytesMarshaler is the interface implemented by an object that can marshal itself into the bytes wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bytes
MarshalEdgeDBBytes encodes the receiver into a binary form and returns the result.
type BytesUnmarshaler ¶ added in v0.8.0
BytesUnmarshaler is the interface implemented by an object that can unmarshal the bytes wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bytes
UnmarshalEdgeDBBytes must be able to decode the bytes wire format. UnmarshalEdgeDBBytes must copy the data if it wishes to retain the data after returning.
type DateDurationMarshaler ¶ added in v0.12.0
DateDurationMarshaler is the interface implemented by an object that can marshal itself into the cal::relative_duration wire format. https://www.edgedb.com/docs/internals/protocol/dataformats
MarshalEdgeDBDateDuration encodes the receiver into a binary form and returns the result.
type DateDurationUnmarshaler ¶ added in v0.12.0
DateDurationUnmarshaler is the interface implemented by an object that can unmarshal the cal::relative_duration wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration
UnmarshalEdgeDBDateDuration must be able to decode the cal::relative_duration wire format. UnmarshalEdgeDBDateDuration must copy the data if it wishes to retain the data after returning.
type DateTimeMarshaler ¶ added in v0.8.0
DateTimeMarshaler is the interface implemented by an object that can marshal itself into the datetime wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-datetime
MarshalEdgeDBDateTime encodes the receiver into a binary form and returns the result.
type DateTimeUnmarshaler ¶ added in v0.8.0
DateTimeUnmarshaler is the interface implemented by an object that can unmarshal the datetime wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-datetime
UnmarshalEdgeDBDateTime must be able to decode the datetime wire format. UnmarshalEdgeDBDateTime must copy the data if it wishes to retain the data after returning.
type DecimalMarshaler ¶ added in v0.8.0
DecimalMarshaler is the interface implemented by an object that can marshal itself into the decimal wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-decimal
MarshalEdgeDBDecimal encodes the receiver into a binary form and returns the result.
type DecimalUnmarshaler ¶ added in v0.8.0
DecimalUnmarshaler is the interface implemented by an object that can unmarshal the decimal wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-decimal
UnmarshalEdgeDBDecimal must be able to decode the decimal wire format. UnmarshalEdgeDBDecimal must copy the data if it wishes to retain the data after returning.
type DurationMarshaler ¶ added in v0.8.0
DurationMarshaler is the interface implemented by an object that can marshal itself into the duration wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration
MarshalEdgeDBDuration encodes the receiver into a binary form and returns the result.
type DurationUnmarshaler ¶ added in v0.8.0
DurationUnmarshaler is the interface implemented by an object that can unmarshal the duration wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration
UnmarshalEdgeDBDuration must be able to decode the duration wire format. UnmarshalEdgeDBDuration must copy the data if it wishes to retain the data after returning.
type Float32Marshaler ¶ added in v0.8.0
Float32Marshaler is the interface implemented by an object that can marshal itself into the float32 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float32
MarshalEdgeDBFloat32 encodes the receiver into a binary form and returns the result.
type Float32Unmarshaler ¶ added in v0.8.0
Float32Unmarshaler is the interface implemented by an object that can unmarshal the float32 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float32
UnmarshalEdgeDBFloat32 must be able to decode the float32 wire format. UnmarshalEdgeDBFloat32 must copy the data if it wishes to retain the data after returning.
type Float64Marshaler ¶ added in v0.8.0
Float64Marshaler is the interface implemented by an object that can marshal itself into the float64 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float64
MarshalEdgeDBFloat64 encodes the receiver into a binary form and returns the result.
type Float64Unmarshaler ¶ added in v0.8.0
Float64Unmarshaler is the interface implemented by an object that can unmarshal the float64 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float64
UnmarshalEdgeDBFloat64 must be able to decode the float64 wire format. UnmarshalEdgeDBFloat64 must copy the data if it wishes to retain the data after returning.
type Int16Marshaler ¶ added in v0.8.0
Int16Marshaler is the interface implemented by an object that can marshal itself into the int16 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int16
MarshalEdgeDBInt16 encodes the receiver into a binary form and returns the result.
type Int16Unmarshaler ¶ added in v0.8.0
Int16Unmarshaler is the interface implemented by an object that can unmarshal the int16 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int16
UnmarshalEdgeDBInt16 must be able to decode the int16 wire format. UnmarshalEdgeDBInt16 must copy the data if it wishes to retain the data after returning.
type Int32Marshaler ¶ added in v0.8.0
Int32Marshaler is the interface implemented by an object that can marshal itself into the int32 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int32
MarshalEdgeDBInt32 encodes the receiver into a binary form and returns the result.
type Int32Unmarshaler ¶ added in v0.8.0
Int32Unmarshaler is the interface implemented by an object that can unmarshal the int32 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int32
UnmarshalEdgeDBInt32 must be able to decode the int32 wire format. UnmarshalEdgeDBInt32 must copy the data if it wishes to retain the data after returning.
type Int64Marshaler ¶ added in v0.8.0
Int64Marshaler is the interface implemented by an object that can marshal itself into the int64 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int64
MarshalEdgeDBInt64 encodes the receiver into a binary form and returns the result.
type Int64Unmarshaler ¶ added in v0.8.0
Int64Unmarshaler is the interface implemented by an object that can unmarshal the int64 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int64
UnmarshalEdgeDBInt64 must be able to decode the int64 wire format. UnmarshalEdgeDBInt64 must copy the data if it wishes to retain the data after returning.
type JSONMarshaler ¶ added in v0.8.0
JSONMarshaler is the interface implemented by an object that can marshal itself into the json wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-json
MarshalEdgeDBJSON encodes the receiver into a binary form and returns the result.
type JSONUnmarshaler ¶ added in v0.8.0
JSONUnmarshaler is the interface implemented by an object that can unmarshal the json wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-json
UnmarshalEdgeDBJSON must be able to decode the json wire format. UnmarshalEdgeDBJSON must copy the data if it wishes to retain the data after returning.
type LocalDateMarshaler ¶ added in v0.8.0
LocalDateMarshaler is the interface implemented by an object that can marshal itself into the local_date wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-date
MarshalEdgeDBLocalDate encodes the receiver into a binary form and returns the result.
type LocalDateTimeMarshaler ¶ added in v0.8.0
LocalDateTimeMarshaler is the interface implemented by an object that can marshal itself into the local_datetime wire format. https://www.edgedb.com/docs/internals/protocol/dataformats
MarshalEdgeDBLocalDateTime encodes the receiver into a binary form and returns the result.
type LocalDateTimeUnmarshaler ¶ added in v0.8.0
LocalDateTimeUnmarshaler is the interface implemented by an object that can unmarshal the local_datetime wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats
UnmarshalEdgeDBLocalDateTime must be able to decode the local_datetime wire format. UnmarshalEdgeDBLocalDateTime must copy the data if it wishes to retain the data after returning.
type LocalDateUnmarshaler ¶ added in v0.8.0
LocalDateUnmarshaler is the interface implemented by an object that can unmarshal the local_date wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-date
UnmarshalEdgeDBLocalDate must be able to decode the local_date wire format. UnmarshalEdgeDBLocalDate must copy the data if it wishes to retain the data after returning.
type LocalTimeMarshaler ¶ added in v0.8.0
LocalTimeMarshaler is the interface implemented by an object that can marshal itself into the local_time wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-time
MarshalEdgeDBLocalTime encodes the receiver into a binary form and returns the result.
type LocalTimeUnmarshaler ¶ added in v0.8.0
LocalTimeUnmarshaler is the interface implemented by an object that can unmarshal the local_time wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-time
UnmarshalEdgeDBLocalTime must be able to decode the local_time wire format. UnmarshalEdgeDBLocalTime must copy the data if it wishes to retain the data after returning.
type MemoryMarshaler ¶ added in v0.9.0
MemoryMarshaler is the interface implemented by an object that can marshal itself into the memory wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-memory
MarshalEdgeDBMemory encodes the receiver into a binary form and returns the result.
type MemoryUnmarshaler ¶ added in v0.9.0
MemoryUnmarshaler is the interface implemented by an object that can unmarshal the memory wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-memory
UnmarshalEdgeDBMemory must be able to decode the memory wire format. UnmarshalEdgeDBMemory must copy the data if it wishes to retain the data after returning.
type OptionalMarshaler ¶ added in v0.8.2
type OptionalMarshaler interface {
// Missing returns true when the value is missing.
Missing() bool
}
OptionalMarshaler is used for optional (not required) shape field values.
type OptionalScalarUnmarshaler ¶ added in v0.11.0
type OptionalScalarUnmarshaler interface {
Unset()
}
OptionalScalarUnmarshaler is implemented by optional scalar types.
type OptionalUnmarshaler ¶ added in v0.8.0
type OptionalUnmarshaler interface {
// SetMissing is call with true when the value is missing and false when
// the value is present.
SetMissing(bool)
}
OptionalUnmarshaler is used for optional (not required) shape field values.
type RelativeDurationMarshaler ¶ added in v0.8.0
RelativeDurationMarshaler is the interface implemented by an object that can marshal itself into the cal::relative_duration wire format. https://www.edgedb.com/docs/internals/protocol/dataformats
MarshalEdgeDBRelativeDuration encodes the receiver into a binary form and returns the result.
type RelativeDurationUnmarshaler ¶ added in v0.8.0
RelativeDurationUnmarshaler is the interface implemented by an object that can unmarshal the cal::relative_duration wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration
UnmarshalEdgeDBRelativeDuration must be able to decode the cal::relative_duration wire format. UnmarshalEdgeDBRelativeDuration must copy the data if it wishes to retain the data after returning.
type StrMarshaler ¶ added in v0.8.0
StrMarshaler is the interface implemented by an object that can marshal itself into the str wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-str
MarshalEdgeDBStr encodes the receiver into a binary form and returns the result.
type StrUnmarshaler ¶ added in v0.8.0
StrUnmarshaler is the interface implemented by an object that can unmarshal the str wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-str
UnmarshalEdgeDBStr must be able to decode the str wire format. UnmarshalEdgeDBStr must copy the data if it wishes to retain the data after returning.
type UUIDMarshaler ¶ added in v0.8.0
UUIDMarshaler is the interface implemented by an object that can marshal itself into the uuid wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-uuid
MarshalEdgeDBUUID encodes the receiver into a binary form and returns the result.
type UUIDUnmarshaler ¶ added in v0.8.0
UUIDUnmarshaler is the interface implemented by an object that can unmarshal the uuid wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-uuid
UnmarshalEdgeDBUUID must be able to decode the uuid wire format. UnmarshalEdgeDBUUID must copy the data if it wishes to retain the data after returning.