tdenginegorm

package module
v0.0.0-...-145a3cf Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 9 Imported by: 0

README

TDengine Gorm Dialect

Instructions

Not support migrate, update, deletion and transaction

Add clauses

  • "CREATE TABLE"
  • "FILL"
  • "SLIMIT"
  • "USING"
  • "WINDOW"

EXAMPLE

Check example code example

Documentation

Index

Constants

View Source
const (
	DriverName            = DriverNameTaosRestful
	DriverNameTaosSql     = "taosSql"
	DriverNameTaosRestful = "taosRestful"
	DriverNameTaosWS      = "taosWS"
)

DriverName is the default driver name for TDengine.

Variables

This section is empty.

Functions

func Open

func Open(dsn string) gorm.Dialector

Types

type Column

type Column struct {
	// contains filtered or unexported fields
}

func (Column) DatabaseTypeName

func (c Column) DatabaseTypeName() string

func (Column) DecimalSize

func (c Column) DecimalSize() (precision int64, scale int64, ok bool)

func (Column) Length

func (c Column) Length() (length int64, ok bool)

func (Column) Name

func (c Column) Name() string

func (Column) Nullable

func (c Column) Nullable() (nullable bool, ok bool)

type Dialect

type Dialect struct {
	DriverName string
	DSN        string
	Conn       gorm.ConnPool
}

func (Dialect) BindVarTo

func (dialect Dialect) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{})

func (Dialect) ClauseBuilders

func (dialect Dialect) ClauseBuilders() map[string]clause.ClauseBuilder

func (Dialect) DataTypeOf

func (dialect Dialect) DataTypeOf(field *schema.Field) string

func (Dialect) DefaultValueOf

func (dialect Dialect) DefaultValueOf(field *schema.Field) clause.Expression

func (Dialect) Explain

func (dialect Dialect) Explain(sql string, vars ...interface{}) string

func (Dialect) Initialize

func (dialect Dialect) Initialize(db *gorm.DB) (err error)

func (Dialect) Migrator

func (dialect Dialect) Migrator(db *gorm.DB) gorm.Migrator

func (Dialect) Name

func (dialect Dialect) Name() string

func (Dialect) QuoteTo

func (dialect Dialect) QuoteTo(writer clause.Writer, str string)

func (Dialect) RollbackTo

func (dialect Dialect) RollbackTo(tx *gorm.DB, name string) error

func (Dialect) SavePoint

func (dialect Dialect) SavePoint(tx *gorm.DB, name string) error

type Migrator

type Migrator struct {
	migrator.Migrator
	// contains filtered or unexported fields
}

func (Migrator) AlterColumn

func (m Migrator) AlterColumn(value interface{}, field string) error

func (Migrator) AutoMigrate

func (m Migrator) AutoMigrate(values ...interface{}) error

func (Migrator) DropConstraint

func (m Migrator) DropConstraint(value interface{}, name string) error

func (Migrator) FullDataTypeOf

func (m Migrator) FullDataTypeOf(field *schema.Field) (expr clause.Expr)

func (Migrator) RenameColumn

func (m Migrator) RenameColumn(value interface{}, oldName, newName string) error

func (Migrator) RenameIndex

func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error

Directories

Path Synopsis
clause

Jump to

Keyboard shortcuts

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