Documentation
¶
Overview ¶
Package backend contains the thin runtime boundary around Apache's official IoTDB Go client.
Index ¶
- Variables
- type Backend
- type Config
- type Measurement
- type ModelMode
- type Official
- func (o *Official) Close() error
- func (o *Official) EnsureTreeSchema(ctx context.Context, device string, measurements []Measurement, aligned bool) error
- func (o *Official) Exec(ctx context.Context, statement string) error
- func (o *Official) InsertTablets(ctx context.Context, tablets []*client.Tablet, aligned bool) error
- func (o *Official) InspectTreeDevice(ctx context.Context, device string) (TreeDeviceSchema, error)
- func (o *Official) Mode() ModelMode
- func (o *Official) Ping(ctx context.Context) error
- func (o *Official) Query(ctx context.Context, statement string) (ResultSet, error)
- type ResultSet
- type TreeDeviceSchema
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("iotdb: backend is closed")
ErrClosed reports use of a backend after its lifecycle has ended.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
Mode() ModelMode
Ping(context.Context) error
Exec(context.Context, string) error
Query(context.Context, string) (ResultSet, error)
InsertTablets(context.Context, []*client.Tablet, bool) error
InspectTreeDevice(context.Context, string) (TreeDeviceSchema, error)
EnsureTreeSchema(context.Context, string, []Measurement, bool) error
Close() error
}
Backend is the model-independent runtime used by the GORM adapter.
type Config ¶
type Config struct {
Mode ModelMode
NodeURLs []string
Username string
Password string
Database string
PoolSize int
ConnectTimeout time.Duration
AcquireTimeout time.Duration
QueryTimeout time.Duration
FetchSize int32
TimeZone string
ConnectRetryMax int
EnableRPCCompression bool
TableInsertConcurrency int
}
Config contains the official-client settings needed by a backend.
type Measurement ¶
type Measurement struct {
Name string
DataType client.TSDataType
Encoding client.TSEncoding
Compression client.TSCompressionType
}
Measurement describes one TreeModel time series.
type Official ¶
type Official struct {
// contains filtered or unexported fields
}
Official implements Backend with official v2 write/Table pools and a v1 TreeModel query pool.
func NewOfficial ¶
NewOfficial creates the official pools required by the configured model compatibility boundary.
func (*Official) Close ¶
Close waits for checked-out result sets and then closes all owned official pools.
func (*Official) EnsureTreeSchema ¶
func (o *Official) EnsureTreeSchema(ctx context.Context, device string, measurements []Measurement, aligned bool) error
EnsureTreeSchema creates only missing measurements and rejects incompatible schema.
func (*Official) InsertTablets ¶
InsertTablets inserts prebuilt official tablets without SQL row fallback.
func (*Official) InspectTreeDevice ¶
InspectTreeDevice returns existing alignment and measurement type metadata.
type ResultSet ¶
type ResultSet interface {
ColumnNames() []string
ColumnTypes() []string
Next() (bool, error)
Value(index int) (any, error)
Close() error
}
ResultSet is the minimal result contract consumed by the database/sql bridge.
type TreeDeviceSchema ¶
type TreeDeviceSchema struct {
Exists bool
Aligned bool
Measurements map[string]client.TSDataType
}
TreeDeviceSchema is the server-side schema currently visible for a device.