stores

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToSql

func ArrayToSql[arrType any](arr []arrType) (sql string)

func ErrFmt

func ErrFmt(err error) error

func GenParams

func GenParams(params map[string]any) (string, string, []any, error)

GenParams 返回占位符?,?,?,? 参数id名:aa,bbb,ccc 参数值列表

func GetCommonConn

func GetCommonConn(in any) *gorm.DB

获取公共连接 传入context或db连接 如果传入的是db连接则直接返回db

func GetTdType

func GetTdType(define schema.Define) string

func GetTenantConn

func GetTenantConn(in any) *gorm.DB

获取租户连接 传入context或db连接 如果传入的是db连接则直接返回db

func InitConn

func InitConn(database conf.Database)

func Scan

func Scan(rows *sql.Rows, Dest any) error

Types

type HubLogStore

type HubLogStore struct {
}

func (*HubLogStore) GetLogStableName

func (h *HubLogStore) GetLogStableName() string

func (*HubLogStore) GetLogTableName

func (h *HubLogStore) GetLogTableName(productID, deviceName string) string

type Int64Arr

type Int64Arr []int64

func (*Int64Arr) Scan

func (p *Int64Arr) Scan(value interface{}) error

func (Int64Arr) Value

func (p Int64Arr) Value() (driver.Value, error)

type Point

type Point struct {
	Longitude float64 `json:"longitude,range=[0:180]"` //经度
	Latitude  float64 `json:"latitude,range=[0:90]"`   //纬度
}

func ToPoint

func ToPoint(p def.Point) Point

func (Point) GormValue

func (p Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr

func (*Point) Scan

func (p *Point) Scan(value interface{}) error

func (Point) ToPo

func (p Point) ToPo() def.Point

type SDKLogStore

type SDKLogStore struct {
}

func (*SDKLogStore) GetSDKLogStableName

func (s *SDKLogStore) GetSDKLogStableName() string

func (*SDKLogStore) GetSDKLogTableName

func (s *SDKLogStore) GetSDKLogTableName(productID, deviceName string) string

type SchemaStore

type SchemaStore struct {
}

func (*SchemaStore) GetEventStableName

func (S *SchemaStore) GetEventStableName() string

func (*SchemaStore) GetEventTableName

func (S *SchemaStore) GetEventTableName(productID, deviceName string) string

func (*SchemaStore) GetPropertyStableName

func (S *SchemaStore) GetPropertyStableName(productID, identifier string) string

func (*SchemaStore) GetPropertyTableName

func (S *SchemaStore) GetPropertyTableName(productID, deviceName, identifier string) string

func (*SchemaStore) GetSpecsColumnWithArgFunc

func (S *SchemaStore) GetSpecsColumnWithArgFunc(s schema.Specs, argFunc string) string

func (*SchemaStore) GetSpecsCreateColumn

func (S *SchemaStore) GetSpecsCreateColumn(s schema.Specs) string

func (*SchemaStore) GetStableNameList

func (S *SchemaStore) GetStableNameList(
	t *schema.Model,
	productID string) (tables []string)

func (*SchemaStore) GetTableNameList

func (S *SchemaStore) GetTableNameList(
	t *schema.Model,
	productID string,
	deviceName string) (tables []string)

type Time

type Time struct {
	CreatedTime time.Time    `gorm:"column:created_time;index:,sort:desc;default:CURRENT_TIMESTAMP;NOT NULL"`
	UpdatedTime time.Time    `gorm:"column:updated_time;autoUpdateTime;default:CURRENT_TIMESTAMP;NOT NULL"`
	DeletedTime sql.NullTime `gorm:"column:deleted_time"`
}

Jump to

Keyboard shortcuts

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