Documentation
¶
Overview ¶
Package types defines the small value types lakeorm exposes on its public API: SortableID (KSUID-backed), ObjectURI/Location (typed storage addresses), and SparkTableName. Kept in its own package so downstream code can import types without pulling in the driver/format/backend stack.
Index ¶
- func SortableIDsToStrings(ids []SortableID) []string
- type Location
- type SortableID
- func (id SortableID) Bytes() []byte
- func (id SortableID) Compare(other *SortableID) int
- func (id SortableID) IsNil() bool
- func (id SortableID) KSUID() ksuid.KSUID
- func (id SortableID) MarshalJSON() ([]byte, error)
- func (id SortableID) MarshalText() ([]byte, error)
- func (id *SortableID) Scan(src any) error
- func (id SortableID) String() string
- func (id *SortableID) UnmarshalJSON(data []byte) error
- func (id *SortableID) UnmarshalText(text []byte) error
- func (id SortableID) Value() (driver.Value, error)
- type SparkTableName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortableIDsToStrings ¶
func SortableIDsToStrings(ids []SortableID) []string
SortableIDsToStrings converts a slice of SortableID to a slice of strings.
Types ¶
type Location ¶
type Location struct {
Scheme string // "s3", "gs", "file", "memory"
Bucket string // bucket/container/root — empty for "file" and "memory"
Path string // object key or filesystem path under Bucket
}
Location is a typed storage URI — scheme + bucket + path. It's the coordinate that Client and Driver must agree on at the string level, regardless of whether they resolve to the same physical endpoint via the same credentials. See lakeorm.Verify for the reachability probe that surfaces the mismatch cleanly.
func ParseLocation ¶
ParseLocation parses a canonical URI ("s3://bucket/key", "gs://bucket/key", "file:///abs/path", "memory://name/key") into a Location.
type SortableID ¶
type SortableID string
SortableID is a KSUID stored as its canonical base62 string. KSUIDs sort lexicographically in creation order, which is what makes them suitable for primary keys, idempotency tokens, and ingest IDs on object-storage prefixes (so lexicographic S3 listings match temporal order).
func NewSortableID ¶
func NewSortableID() SortableID
NewSortableID returns a freshly generated KSUID.
func ParseSortableID ¶
func ParseSortableID(s string) (SortableID, error)
ParseSortableID validates and returns a SortableID from a string.
func (SortableID) Bytes ¶
func (id SortableID) Bytes() []byte
Bytes returns the 20 raw KSUID bytes, or nil if the ID is zero.
func (SortableID) Compare ¶
func (id SortableID) Compare(other *SortableID) int
Compare returns -1/0/1 by lexicographic string order (KSUIDs are time-sortable).
func (SortableID) IsNil ¶
func (id SortableID) IsNil() bool
IsNil reports whether the ID is the zero value (empty or ksuid.Nil).
func (SortableID) KSUID ¶
func (id SortableID) KSUID() ksuid.KSUID
KSUID returns the underlying ksuid.KSUID (or ksuid.Nil on error / empty).
func (SortableID) MarshalJSON ¶
func (id SortableID) MarshalJSON() ([]byte, error)
func (SortableID) MarshalText ¶
func (id SortableID) MarshalText() ([]byte, error)
func (*SortableID) Scan ¶
func (id *SortableID) Scan(src any) error
Scan implements sql.Scanner for database/sql. Needed for the reflection scanner in scanner.go to pick SortableID up via its scannerTarget path (nullable SortableID columns become *SortableID fields transparently).
func (SortableID) String ¶
func (id SortableID) String() string
func (*SortableID) UnmarshalJSON ¶
func (id *SortableID) UnmarshalJSON(data []byte) error
func (*SortableID) UnmarshalText ¶
func (id *SortableID) UnmarshalText(text []byte) error
type SparkTableName ¶
SparkTableName is a validated three-part Spark table identifier (catalog.database.table). Catalog is optional; two-part names are normalized to default_catalog.database.table by the Dialect layer.
func ParseSparkTableName ¶
func ParseSparkTableName(s string) (SparkTableName, error)
ParseSparkTableName parses "catalog.database.table", "database.table", or "table". Multi-part names are validated; bare names are returned with empty Catalog/Database for the caller to resolve via defaults.
func (SparkTableName) Qualified ¶
func (n SparkTableName) Qualified(defaultCatalog, defaultDatabase string) string
Qualified returns the full catalog.database.table form, substituting defaults for any empty component. Used by Dialect.PlanQuery when interpolating SQL.
func (SparkTableName) String ¶
func (n SparkTableName) String() string