model

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package model maps GORM schemas to explicit IoTDB model roles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindField

func FindField(s *schema.Schema, name string) (*schema.Field, error)

FindField resolves a field by Go name or database name.

func TagValueMap

func TagValueMap(s *schema.Schema, value reflect.Value) map[string]any

TagValueMap extracts TableModel tag values for compatibility with the imported API.

Types

type Column

type Column struct {
	Field   *schema.Field
	Role    ColumnRole
	Options map[string]string
}

Column describes one parsed GORM field and its IoTDB role.

func ParseColumns

func ParseColumns(s *schema.Schema) []Column

ParseColumns extracts IoTDB roles from either `iotdb` or legacy GORM tag settings.

func ParseField

func ParseField(field *schema.Field) Column

ParseField extracts one field's IoTDB role and options.

type ColumnRole

type ColumnRole uint8

ColumnRole describes how a field participates in an IoTDB model.

const (
	// ColumnRoleField marks a measurement or table FIELD.
	ColumnRoleField ColumnRole = iota
	// ColumnRoleTag marks a TableModel TAG and is rejected as implicit TreeModel metadata.
	ColumnRoleTag
	// ColumnRoleAttribute marks a TableModel ATTRIBUTE.
	ColumnRoleAttribute
	// ColumnRoleTime marks the row timestamp stored through Tablet.SetTimestamp.
	ColumnRoleTime
	// ColumnRoleDevice marks a per-row TreeModel device path selector.
	ColumnRoleDevice
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL