sqlite

package module
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDriverName = "sqlite"

DefaultDriverName is the default driver name for SQLite.

Variables

View Source
var (
	ErrConstraintsNotImplemented = errors.New("constraints not implemented on sqlite, consider using DisableForeignKeyConstraintWhenMigrating")
)

Functions

func DriverName

func DriverName(name string) dao.Option

func JSONQuery

func JSONQuery(column string) *jsonQueryExpression

func NewDialect

func NewDialect(opts ...dao.Option) dao.Dialect

Types

type Dialect

type Dialect struct {
	DB         *dao.DB
	Opts       dao.Options
	DriverName string
	Conn       dao.ConnPool
	// contains filtered or unexported fields
}

func (*Dialect) BindVarTo

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

func (*Dialect) ClauseBuilders

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

func (*Dialect) DataTypeOf

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

func (*Dialect) DefaultValueOf

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

func (*Dialect) Explain

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

func (*Dialect) Init

func (d *Dialect) Init(opts ...dao.Option) (err error)

func (*Dialect) JSONBuild

func (d *Dialect) JSONBuild(column string) dao.JSONQuery

func (*Dialect) JSONDataType

func (d *Dialect) JSONDataType() string

func (*Dialect) Migrator

func (d *Dialect) Migrator() dao.Migrator

func (*Dialect) NewTx

func (d *Dialect) NewTx() *dao.DB

func (*Dialect) Options

func (d *Dialect) Options() dao.Options

func (*Dialect) QuoteTo

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

func (*Dialect) RollbackTo

func (d *Dialect) RollbackTo(tx *dao.DB, name string) error

func (*Dialect) SavePoint

func (d *Dialect) SavePoint(tx *dao.DB, name string) error

func (*Dialect) String

func (d *Dialect) String() string

type Migrator

type Migrator struct {
	migrator.Migrator
}

func (Migrator) AlterColumn

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

func (Migrator) BuildIndexOptions

func (m Migrator) BuildIndexOptions(opts []schema.IndexOption, stmt *dao.Statement) (results []interface{})

func (Migrator) CreateConstraint

func (m Migrator) CreateConstraint(interface{}, string) error

func (Migrator) CreateIndex

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

func (Migrator) CurrentDatabase

func (m Migrator) CurrentDatabase() (name string)

func (Migrator) DropColumn

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

func (Migrator) DropConstraint

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

func (Migrator) DropIndex

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

func (Migrator) DropTable

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

func (Migrator) HasColumn

func (m Migrator) HasColumn(value interface{}, name string) bool

func (Migrator) HasConstraint

func (m Migrator) HasConstraint(value interface{}, name string) bool

func (Migrator) HasIndex

func (m Migrator) HasIndex(value interface{}, name string) bool

func (Migrator) HasTable

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

func (Migrator) RenameIndex

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

func (*Migrator) RunWithoutForeignKey

func (m *Migrator) RunWithoutForeignKey(fc func() error) error

Jump to

Keyboard shortcuts

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