Documentation
¶
Index ¶
- Constants
- type Any
- type ArrayOf
- type AutoID
- type AutoIDFunc
- type BasicTypes
- type Bool
- type Bytes
- type ComplexTypes
- type DateTime
- type Decimal
- type Duration
- type Float
- type FloatID
- type Geometry
- type IDThings
- type Int
- type IntID
- type Literal
- type NumberTypes
- type Object
- type ObjectID
- type Range
- type RawID
- type Record
- func (r *Record[T]) Get() (*T, bool)
- func (r *Record[T]) GetID() (SurrealDBRecordID, bool)
- func (r *Record[T]) HasData() bool
- func (r *Record[T]) HasID() bool
- func (r *Record[T]) MarshalJSON() ([]byte, error)
- func (r *Record[T]) Scan(src any) error
- func (r *Record[T]) UnmarshalJSON(b []byte) error
- func (r *Record[T]) Value() (driver.Value, error)
- type Records
- type Set
- type String
- type StringArray
- type StringID
- type SurrealDBRecordID
- type SurrealMarshalable
- type TimeTypes
- type Types
- type ULIDID
- type UUIDID
- Bugs
Constants ¶
View Source
const ( // Footgun: Those aren't paranthesis, brackets, or anything alike. // ... they're _unicode_. o.o SRIDOpen rune = '⟨' SRIDClose rune = '⟩' )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Any ¶
type Any = any
TODO: Properly work this out From and with: https://surrealdb.com/docs/surrealql/datamodel ## Simple ### basic
type ArrayOf ¶
type ArrayOf[T any] struct { Values []T }
ArrayOf is a generic type that implements JSON and SQL interfaces.
func (ArrayOf[T]) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*ArrayOf[T]) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type AutoID ¶
type AutoID struct {
Table string
Thing AutoIDFunc
}
TODO: this currently does not retrive the ID.
func (*AutoID) MarshalJSON ¶
func (AutoID) SurrealString ¶
func (*AutoID) UnmarshalJSON ¶
type AutoIDFunc ¶
type AutoIDFunc string
const ( AutoIDRand AutoIDFunc = "rand()" AutoIDUUID AutoIDFunc = "uuid()" AutoIDULID AutoIDFunc = "ulid()" )
type ComplexTypes ¶
type DateTime ¶
func (*DateTime) MarshalSurreal ¶
type FloatID ¶
func (*FloatID) MarshalJSON ¶
func (FloatID) SurrealString ¶
func (*FloatID) UnmarshalJSON ¶
type NumberTypes ¶
type EmptyTypes interface {
Null | None
}
type Object ¶
type Object map[string]interface{}
func (*Object) MarshalJSON ¶
func (*Object) UnmarshalJSON ¶
type ObjectID ¶
func (*ObjectID) MarshalJSON ¶
func (ObjectID) SurrealString ¶
SurrealString implements SurrealDBRecordID.
func (*ObjectID) UnmarshalJSON ¶
type RawID ¶
func (*RawID) MarshalJSON ¶
func (RawID) SurrealString ¶
SurrealString implements SurrealDBRecordID.
func (*RawID) UnmarshalJSON ¶
type Record ¶
type Record[T any] struct { // contains filtered or unexported fields }
func (*Record[T]) GetID ¶
func (r *Record[T]) GetID() (SurrealDBRecordID, bool)
func (*Record[T]) MarshalJSON ¶
func (*Record[T]) UnmarshalJSON ¶
type Records ¶
type Records[T any] struct { // contains filtered or unexported fields }
func NewRecords ¶
func (*Records[T]) MarshalJSON ¶
func (*Records[T]) UnmarshalJSON ¶
type Set ¶
type Set = []interface{} // TODO: User specified, thus technically generic
type Record = Object // TODO: Actually, this isn't true. in json its string, in db its object!
type StringArray ¶
type StringArray = []string
type StringID ¶
func (*StringID) MarshalJSON ¶
func (StringID) SurrealString ¶
SurrealString implements SurrealDBRecordID.
func (*StringID) UnmarshalJSON ¶
type SurrealDBRecordID ¶
type SurrealDBRecordID interface {
SurrealString() string
}
func ParseID ¶
func ParseID(in string) (SurrealDBRecordID, error)
type SurrealMarshalable ¶
type Types ¶
type Types interface {
BasicTypes | NumberTypes | TimeTypes | ComplexTypes
}
type ULIDID ¶
func (*ULIDID) MarshalJSON ¶
func (ULIDID) SurrealString ¶
func (*ULIDID) UnmarshalJSON ¶
type UUIDID ¶
func (*UUIDID) MarshalJSON ¶
func (UUIDID) SurrealString ¶
func (*UUIDID) UnmarshalJSON ¶
Notes ¶
Bugs ¶
%T may result in pretty.formatter from github.com/kr/pretty ... fml.
Click to show internal directories.
Click to hide internal directories.