driver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMysql

func RegisterMysql()

func RegisterSqlite

func RegisterSqlite()

Types

type Mysql

type Mysql struct {
	orm.Execer
}

Mysql m struct

func (*Mysql) AddColumn

func (p *Mysql) AddColumn(field string, o *orm.Options) error

func (*Mysql) AlterColumn

func (p *Mysql) AlterColumn(field string, o *orm.Options) error

func (*Mysql) AutoMigrate

func (p *Mysql) AutoMigrate(sample interface{}, opts ...orm.Option) error

AutoMigrate

func (*Mysql) ColumnTypes

func (p *Mysql) ColumnTypes(o *orm.Options) ([]orm.StructField, error)

ColumnTypes return columnTypes []gorm.ColumnType and execErr error

func (*Mysql) CreateIndex

func (p *Mysql) CreateIndex(name string, o *orm.Options) error

func (*Mysql) CreateTable

func (p *Mysql) CreateTable(o *orm.Options) (err error)

func (*Mysql) CurrentDatabase

func (p *Mysql) CurrentDatabase() (name string)

func (*Mysql) DropColumn

func (p *Mysql) DropColumn(field string, o *orm.Options) error

func (*Mysql) DropIndex

func (p *Mysql) DropIndex(name string, o *orm.Options) error

func (*Mysql) DropTable

func (p *Mysql) DropTable(o *orm.Options) error

func (Mysql) FullDataTypeOf

func (p Mysql) FullDataTypeOf(field *orm.StructField) string

func (*Mysql) GetTables

func (p *Mysql) GetTables() (tableList []string, err error)

func (*Mysql) HasColumn

func (p *Mysql) HasColumn(field string, o *orm.Options) bool

func (*Mysql) HasIndex

func (p *Mysql) HasIndex(name string, o *orm.Options) bool

func (*Mysql) HasTable

func (p *Mysql) HasTable(tableName string) bool

func (*Mysql) MigrateColumn

func (p *Mysql) MigrateColumn(expect, actual *orm.StructField, o *orm.Options) error

field: 1 - expect columntype: 2 - actual

func (*Mysql) ParseField

func (p *Mysql) ParseField(f *orm.StructField)

type Sqlite

type Sqlite struct {
	orm.Execer
}

Sqlite m struct

func (*Sqlite) AddColumn

func (p *Sqlite) AddColumn(field string, o *orm.Options) error

func (*Sqlite) AlterColumn

func (p *Sqlite) AlterColumn(field string, o *orm.Options) error

func (*Sqlite) AutoMigrate

func (p *Sqlite) AutoMigrate(sample interface{}, opts ...orm.Option) error

AutoMigrate

func (*Sqlite) ColumnTypes

func (p *Sqlite) ColumnTypes(o *orm.Options) ([]orm.StructField, error)

ColumnTypes return columnTypes []gorm.ColumnType and execErr error

func (*Sqlite) CreateIndex

func (p *Sqlite) CreateIndex(name string, o *orm.Options) error

func (*Sqlite) CreateTable

func (p *Sqlite) CreateTable(o *orm.Options) (err error)

func (*Sqlite) CurrentDatabase

func (p *Sqlite) CurrentDatabase() (name string)

func (*Sqlite) DropColumn

func (p *Sqlite) DropColumn(field string, o *orm.Options) error

func (*Sqlite) DropIndex

func (p *Sqlite) DropIndex(name string, o *orm.Options) error

func (*Sqlite) DropTable

func (p *Sqlite) DropTable(o *orm.Options) error

func (*Sqlite) FullDataTypeOf

func (p *Sqlite) FullDataTypeOf(field *orm.StructField) string

func (*Sqlite) GetTables

func (p *Sqlite) GetTables() (tableList []string, err error)

func (*Sqlite) HasColumn

func (p *Sqlite) HasColumn(name string, o *orm.Options) bool

func (*Sqlite) HasIndex

func (p *Sqlite) HasIndex(name string, o *orm.Options) bool

func (*Sqlite) HasTable

func (p *Sqlite) HasTable(tableName string) bool

func (*Sqlite) MigrateColumn

func (p *Sqlite) MigrateColumn(expect, actual *orm.StructField, o *orm.Options) error

field: 1 - expect columntype: 2 - actual

func (*Sqlite) ParseField

func (p *Sqlite) ParseField(f *orm.StructField)

TODO

Jump to

Keyboard shortcuts

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