dialect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialector added in v0.1.0

type Dialector struct {
	DSN  string
	Conn gorm.ConnPool
	// contains filtered or unexported fields
}

Dialector is implementation of gorm.Dialector.

func New

func New(dsn string, opts ...Option) *Dialector

New is constructor for Dialector.

func (Dialector) BindVarTo added in v0.1.0

func (d Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, _ interface{})

func (Dialector) ClauseBuilders added in v0.1.0

func (d Dialector) ClauseBuilders() map[string]clause.ClauseBuilder

func (Dialector) DataTypeOf added in v0.1.0

func (d Dialector) DataTypeOf(field *schema.Field) string

func (Dialector) DefaultValueOf added in v0.1.0

func (d Dialector) DefaultValueOf(_ *schema.Field) clause.Expression

func (Dialector) Explain added in v0.1.0

func (d Dialector) Explain(sql string, vars ...interface{}) string

func (Dialector) Initialize added in v0.1.0

func (d Dialector) Initialize(db *gorm.DB) error

func (Dialector) Migrator added in v0.1.0

func (d Dialector) Migrator(db *gorm.DB) gorm.Migrator

func (Dialector) Name added in v0.1.0

func (d Dialector) Name() string

func (Dialector) QuoteTo added in v0.1.0

func (d Dialector) QuoteTo(writer clause.Writer, s string)

type Migrator added in v0.1.0

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

Migrator is wrapper for gorm.Migrator.

func (Migrator) AddColumn added in v0.1.0

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

AddColumn create `name` column for value.

func (Migrator) AlterColumn added in v0.1.0

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

AlterColumn alter value's `field` column type based on schema definition.

func (Migrator) ColumnTypes added in v0.1.0

func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error)

ColumnTypes return columnTypes []gorm.ColumnType and execErr error.

func (Migrator) CreateTable added in v0.1.0

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

CreateTable create table in database for values.

func (Migrator) DropColumn added in v0.1.0

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

DropColumn drop value's `name` column.

func (Migrator) DropTable added in v0.1.0

func (m Migrator) DropTable(models ...interface{}) error

DropTable drop table for values.

func (Migrator) FullDataTypeOf added in v0.1.0

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

FullDataTypeOf returns field's db full data type.

func (Migrator) HasTable added in v0.1.0

func (m Migrator) HasTable(model interface{}) bool

HasTable returns table exists or not for value, value could be a struct or string.

type Option

type Option func(d *Dialector)

Option is option for Dialector New constructor.

func With

func With(opts ...ydb.Option) Option

With apply ydb.Option to Dialector.

func WithConnMaxIdleTime added in v0.1.0

func WithConnMaxIdleTime(connMaxIdleTime time.Duration) Option

WithConnMaxIdleTime apply max idle time to Dialector.

func WithMaxIdleConns added in v0.1.0

func WithMaxIdleConns(maxIdleConns int) Option

WithMaxIdleConns apply max idle conns to Dialector.

func WithMaxOpenConns added in v0.1.0

func WithMaxOpenConns(maxOpenConns int) Option

WithMaxOpenConns apply max open conns to Dialector.

func WithTablePathPrefix

func WithTablePathPrefix(tablePathPrefix string) Option

WithTablePathPrefix apply table path prefix to Dialector.

Jump to

Keyboard shortcuts

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