DateDuration represents the elapsed time between two dates in a fuzzy human way.
type DateDuration struct {
// contains filtered or unexported fields
}
func NewDateDuration(months int32, days int32) DateDuration
NewDateDuration returns a new DateDuration
func (dd DateDuration) MarshalText() ([]byte, error)
MarshalText returns rd marshaled as text.
Duration represents the elapsed time between two instants as an int64 microsecond count.
type Duration int64
func ParseDuration(s string) (Duration, error)
ParseDuration parses an EdgeDB duration string.
LocalDate is a date without a time zone. docs/stdlib/datetime#type::cal::local_date
type LocalDate struct {
// contains filtered or unexported fields
}
func NewLocalDate(year int, month time.Month, day int) LocalDate
NewLocalDate returns a new LocalDate
func (d LocalDate) MarshalText() ([]byte, error)
MarshalText returns d marshaled as text.
LocalDateTime is a date and time without timezone. docs/stdlib/datetime#type::cal::local_datetime
type LocalDateTime struct {
// contains filtered or unexported fields
}
func NewLocalDateTime(
year int, month time.Month, day, hour, minute, second, microsecond int,
) LocalDateTime
NewLocalDateTime returns a new LocalDateTime
func (dt LocalDateTime) MarshalText() ([]byte, error)
MarshalText returns dt marshaled as text.
LocalTime is a time without a time zone. docs/stdlib/datetime#type::cal::local_time
type LocalTime struct {
// contains filtered or unexported fields
}
func NewLocalTime(hour, minute, second, microsecond int) LocalTime
NewLocalTime returns a new LocalTime
func (t LocalTime) MarshalText() ([]byte, error)
MarshalText returns t marshaled as text.
Memory represents memory in bytes.
type Memory int64
func (m Memory) MarshalText() ([]byte, error)
MarshalText returns m marshaled as text.
Optional represents a shape field that is not required. Optional is embedded in structs to make them optional. For example:
type User struct {
edgedb.Optional
Name string `edgedb:"name"`
}
type Optional struct {
// contains filtered or unexported fields
}
func (o *Optional) SetMissing(missing bool)
SetMissing sets the structs missing status. true means missing and false means present.
OptionalBigInt is an optional *big.Int. Optional types must be used for out parameters when a shape field is not required.
type OptionalBigInt struct {
// contains filtered or unexported fields
}
func NewOptionalBigInt(v *big.Int) OptionalBigInt
NewOptionalBigInt is a convenience function for creating an OptionalBigInt with its value set to v.
func (o OptionalBigInt) Get() (*big.Int, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalBigInt) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalBigInt) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalBool is an optional bool. Optional types must be used for out parameters when a shape field is not required.
type OptionalBool struct {
// contains filtered or unexported fields
}
func NewOptionalBool(v bool) OptionalBool
NewOptionalBool is a convenience function for creating an OptionalBool with its value set to v.
func (o OptionalBool) Get() (bool, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalBool) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalBool) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalBytes is an optional []byte. Optional types must be used for out parameters when a shape field is not required.
type OptionalBytes struct {
// contains filtered or unexported fields
}
func NewOptionalBytes(v []byte) OptionalBytes
NewOptionalBytes is a convenience function for creating an OptionalBytes with its value set to v.
func (o OptionalBytes) Get() ([]byte, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalBytes) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalBytes) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalDateDuration is an optional DateDuration. Optional types must be used for out parameters when a shape field is not required.
type OptionalDateDuration struct {
// contains filtered or unexported fields
}
func NewOptionalDateDuration(v DateDuration) OptionalDateDuration
NewOptionalDateDuration is a convenience function for creating an OptionalDateDuration with its value set to v.
func (o *OptionalDateDuration) Get() (DateDuration, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalDateDuration) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalDateDuration) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalDateTime is an optional time.Time. Optional types must be used for out parameters when a shape field is not required.
type OptionalDateTime struct {
// contains filtered or unexported fields
}
func NewOptionalDateTime(v time.Time) OptionalDateTime
NewOptionalDateTime is a convenience function for creating an OptionalDateTime with its value set to v.
func (o OptionalDateTime) Get() (time.Time, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalDateTime) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalDateTime) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalDuration is an optional Duration. Optional types must be used for out parameters when a shape field is not required.
type OptionalDuration struct {
// contains filtered or unexported fields
}
func NewOptionalDuration(v Duration) OptionalDuration
NewOptionalDuration is a convenience function for creating an OptionalDuration with its value set to v.
func (o OptionalDuration) Get() (Duration, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalDuration) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalDuration) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalFloat32 is an optional float32. Optional types must be used for out parameters when a shape field is not required.
type OptionalFloat32 struct {
// contains filtered or unexported fields
}
func NewOptionalFloat32(v float32) OptionalFloat32
NewOptionalFloat32 is a convenience function for creating an OptionalFloat32 with its value set to v.
func (o OptionalFloat32) Get() (float32, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalFloat32) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalFloat32) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalFloat64 is an optional float64. Optional types must be used for out parameters when a shape field is not required.
type OptionalFloat64 struct {
// contains filtered or unexported fields
}
func NewOptionalFloat64(v float64) OptionalFloat64
NewOptionalFloat64 is a convenience function for creating an OptionalFloat64 with its value set to v.
func (o OptionalFloat64) Get() (float64, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalFloat64) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalFloat64) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalInt16 is an optional int16. Optional types must be used for out parameters when a shape field is not required.
type OptionalInt16 struct {
// contains filtered or unexported fields
}
func NewOptionalInt16(v int16) OptionalInt16
NewOptionalInt16 is a convenience function for creating an OptionalInt16 with its value set to v.
func (o OptionalInt16) Get() (int16, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalInt16) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalInt16) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalInt32 is an optional int32. Optional types must be used for out parameters when a shape field is not required.
type OptionalInt32 struct {
// contains filtered or unexported fields
}
func NewOptionalInt32(v int32) OptionalInt32
NewOptionalInt32 is a convenience function for creating an OptionalInt32 with its value set to v.
func (o OptionalInt32) Get() (int32, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalInt32) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalInt32) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalInt64 is an optional int64. Optional types must be used for out parameters when a shape field is not required.
type OptionalInt64 struct {
// contains filtered or unexported fields
}
func NewOptionalInt64(v int64) OptionalInt64
NewOptionalInt64 is a convenience function for creating an OptionalInt64 with its value set to v.
func (o OptionalInt64) Get() (int64, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalInt64) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalInt64) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalLocalDate is an optional LocalDate. Optional types must be used for out parameters when a shape field is not required.
type OptionalLocalDate struct {
// contains filtered or unexported fields
}
func NewOptionalLocalDate(v LocalDate) OptionalLocalDate
NewOptionalLocalDate is a convenience function for creating an OptionalLocalDate with its value set to v.
func (o OptionalLocalDate) Get() (LocalDate, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalLocalDate) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalLocalDate) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalLocalDateTime is an optional LocalDateTime. Optional types must be used for out parameters when a shape field is not required.
type OptionalLocalDateTime struct {
// contains filtered or unexported fields
}
func NewOptionalLocalDateTime(v LocalDateTime) OptionalLocalDateTime
NewOptionalLocalDateTime is a convenience function for creating an OptionalLocalDateTime with its value set to v.
func (o OptionalLocalDateTime) Get() (LocalDateTime, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalLocalDateTime) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalLocalDateTime) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalLocalTime is an optional LocalTime. Optional types must be used for out parameters when a shape field is not required.
type OptionalLocalTime struct {
// contains filtered or unexported fields
}
func NewOptionalLocalTime(v LocalTime) OptionalLocalTime
NewOptionalLocalTime is a convenience function for creating an OptionalLocalTime with its value set to v.
func (o OptionalLocalTime) Get() (LocalTime, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalLocalTime) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalLocalTime) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalMemory is an optional Memory. Optional types must be used for out parameters when a shape field is not required.
type OptionalMemory struct {
// contains filtered or unexported fields
}
func NewOptionalMemory(v Memory) OptionalMemory
NewOptionalMemory is a convenience function for creating an OptionalMemory with its value set to v.
func (o OptionalMemory) Get() (Memory, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalMemory) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalMemory) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeDateTime is an optional RangeDateTime. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeDateTime struct {
// contains filtered or unexported fields
}
func NewOptionalRangeDateTime(v RangeDateTime) OptionalRangeDateTime
NewOptionalRangeDateTime is a convenience function for creating an OptionalRangeDateTime with its value set to v.
func (o OptionalRangeDateTime) Get() (RangeDateTime, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeDateTime) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeDateTime) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeFloat32 is an optional RangeFloat32. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeFloat32 struct {
// contains filtered or unexported fields
}
func NewOptionalRangeFloat32(v RangeFloat32) OptionalRangeFloat32
NewOptionalRangeFloat32 is a convenience function for creating an OptionalRangeFloat32 with its value set to v.
func (o OptionalRangeFloat32) Get() (RangeFloat32, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeFloat32) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeFloat32) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeFloat64 is an optional RangeFloat64. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeFloat64 struct {
// contains filtered or unexported fields
}
func NewOptionalRangeFloat64(v RangeFloat64) OptionalRangeFloat64
NewOptionalRangeFloat64 is a convenience function for creating an OptionalRangeFloat64 with its value set to v.
func (o OptionalRangeFloat64) Get() (RangeFloat64, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeFloat64) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeFloat64) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeInt32 is an optional RangeInt32. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeInt32 struct {
// contains filtered or unexported fields
}
func NewOptionalRangeInt32(v RangeInt32) OptionalRangeInt32
NewOptionalRangeInt32 is a convenience function for creating an OptionalRangeInt32 with its value set to v.
func (o OptionalRangeInt32) Get() (RangeInt32, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeInt32) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeInt32) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeInt64 is an optional RangeInt64. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeInt64 struct {
// contains filtered or unexported fields
}
func NewOptionalRangeInt64(v RangeInt64) OptionalRangeInt64
NewOptionalRangeInt64 is a convenience function for creating an OptionalRangeInt64 with its value set to v.
func (o OptionalRangeInt64) Get() (RangeInt64, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeInt64) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeInt64) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeLocalDate is an optional RangeLocalDate. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeLocalDate struct {
// contains filtered or unexported fields
}
func NewOptionalRangeLocalDate(v RangeLocalDate) OptionalRangeLocalDate
NewOptionalRangeLocalDate is a convenience function for creating an OptionalRangeLocalDate with its value set to v.
func (o OptionalRangeLocalDate) Get() (RangeLocalDate, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeLocalDate) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeLocalDate) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRangeLocalDateTime is an optional RangeLocalDateTime. Optional types must be used for out parameters when a shape field is not required.
type OptionalRangeLocalDateTime struct {
// contains filtered or unexported fields
}
func NewOptionalRangeLocalDateTime(
v RangeLocalDateTime,
) OptionalRangeLocalDateTime
NewOptionalRangeLocalDateTime is a convenience function for creating an OptionalRangeLocalDateTime with its value set to v.
func (o OptionalRangeLocalDateTime) Get() (RangeLocalDateTime, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRangeLocalDateTime) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRangeLocalDateTime) Set(val RangeLocalDateTime)
Set sets the value.
func (o *OptionalRangeLocalDateTime) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalRelativeDuration is an optional RelativeDuration. Optional types must be used for out parameters when a shape field is not required.
type OptionalRelativeDuration struct {
// contains filtered or unexported fields
}
func NewOptionalRelativeDuration(v RelativeDuration) OptionalRelativeDuration
NewOptionalRelativeDuration is a convenience function for creating an OptionalRelativeDuration with its value set to v.
func (o OptionalRelativeDuration) Get() (RelativeDuration, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalRelativeDuration) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalRelativeDuration) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalStr is an optional string. Optional types must be used for out parameters when a shape field is not required.
type OptionalStr struct {
// contains filtered or unexported fields
}
func NewOptionalStr(v string) OptionalStr
NewOptionalStr is a convenience function for creating an OptionalStr with its value set to v.
func (o OptionalStr) Get() (string, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalStr) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalStr) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o.
OptionalUUID is an optional UUID. Optional types must be used for out parameters when a shape field is not required.
type OptionalUUID struct {
// contains filtered or unexported fields
}
func NewOptionalUUID(v UUID) OptionalUUID
NewOptionalUUID is a convenience function for creating an OptionalUUID with its value set to v.
func (o OptionalUUID) Get() (UUID, bool)
Get returns the value and a boolean indicating if the value is present.
func (o OptionalUUID) MarshalJSON() ([]byte, error)
MarshalJSON returns o marshaled as json.
func (o *OptionalUUID) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals bytes into *o
RangeDateTime is an interval of time.Time values.
type RangeDateTime struct {
// contains filtered or unexported fields
}
func NewRangeDateTime(
lower, upper OptionalDateTime,
incLower, incUpper bool,
) RangeDateTime
NewRangeDateTime creates a new RangeDateTime value.
func (r RangeDateTime) IncLower() bool
IncLower returns true if the lower bound is inclusive.
func (r RangeDateTime) IncUpper() bool
IncUpper returns true if the upper bound is inclusive.
func (r RangeDateTime) MarshalJSON() ([]byte, error)
MarshalJSON returns r marshaled as json.
func (r *RangeDateTime) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals bytes into *r.
RangeFloat32 is an interval of float32 values.
type RangeFloat32 struct {
// contains filtered or unexported fields
}
func NewRangeFloat32(
lower, upper OptionalFloat32,
incLower, incUpper bool,
) RangeFloat32
NewRangeFloat32 creates a new RangeFloat32 value.
func (r RangeFloat32) IncLower() bool
IncLower returns true if the lower bound is inclusive.
func (r RangeFloat32) IncUpper() bool
IncUpper returns true if the upper bound is inclusive.
func (r RangeFloat32) MarshalJSON() ([]byte, error)
MarshalJSON returns r marshaled as json.
func (r *RangeFloat32) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals bytes into *r.
RangeFloat64 is an interval of float64 values.
type RangeFloat64 struct {
// contains filtered or unexported fields
}
func NewRangeFloat64(
lower, upper OptionalFloat64,
incLower, incUpper bool,
) RangeFloat64
NewRangeFloat64 creates a new RangeFloat64 value.
func (r RangeFloat64) IncLower() bool
IncLower returns true if the lower bound is inclusive.
func (r RangeFloat64) IncUpper() bool
IncUpper returns true if the upper bound is inclusive.
func (r RangeFloat64) MarshalJSON() ([]byte, error)
MarshalJSON returns r marshaled as json.
func (r *RangeFloat64) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals bytes into *r.
RangeInt32 is an interval of int32 values.
type RangeInt32 struct {
// contains filtered or unexported fields
}
func NewRangeInt32(
lower, upper OptionalInt32,
incLower, incUpper bool,
) RangeInt32
NewRangeInt32 creates a new RangeInt32 value.
func (r RangeInt32) IncLower() bool
IncLower returns true if the lower bound is inclusive.
func (r RangeInt32) IncUpper() bool
IncUpper returns true if the upper bound is inclusive.