Documentation
¶
Index ¶
- Constants
- Variables
- func New(cfg Config) gorm.Dialector
- func Open(dsn string) gorm.Dialector
- type Config
- type Dialector
- func (dialector Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v any)
- func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
- func (dialector Dialector) DataTypeOf(field *schema.Field) string
- func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression
- func (dialector Dialector) Explain(sql string, vars ...any) string
- func (dialector Dialector) Initialize(db *gorm.DB) (err error)
- func (dialector Dialector) Migrator(db *gorm.DB) gorm.Migrator
- func (dialector Dialector) Name() string
- func (dialector Dialector) QuoteTo(writer clause.Writer, str string)
- func (dialector Dialector) RollbackTo(tx *gorm.DB, name string) error
- func (dialector Dialector) SavePoint(tx *gorm.DB, name string) error
- func (dialector Dialector) Translate(err error) error
- type Index
- type Migrator
- func (m Migrator) AlterColumn(value any, name string) error
- func (m Migrator) BuildIndexOptions(opts []schema.IndexOption, stmt *gorm.Statement) (results []any)
- func (m Migrator) ColumnTypes(value any) ([]gorm.ColumnType, error)
- func (m Migrator) CreateConstraint(value any, name string) error
- func (m Migrator) CreateIndex(value any, name string) error
- func (m Migrator) CurrentDatabase() (name string)
- func (m Migrator) DropColumn(value any, name string) error
- func (m Migrator) DropConstraint(value any, name string) error
- func (m Migrator) DropIndex(value any, name string) error
- func (m Migrator) DropTable(values ...any) error
- func (m Migrator) GetIndexes(value any) ([]gorm.Index, error)
- func (m Migrator) GetTables() (tableList []string, err error)
- func (m Migrator) HasColumn(value any, name string) bool
- func (m Migrator) HasConstraint(value any, name string) bool
- func (m Migrator) HasIndex(value any, name string) bool
- func (m Migrator) HasTable(value any) bool
- func (m Migrator) RenameIndex(value any, oldName, newName string) error
- func (m *Migrator) RunWithoutForeignKey(fc func() error) error
Constants ¶
View Source
const DriverName = "sqlite"
DriverName is the default driver name for SQLite. Since github.com/go-again/sqlite registers under both "sqlite" (modernc-style) and "sqlite3" (mattn-style), either name resolves to the same singleton.
Variables ¶
View Source
var (
ErrConstraintsNotImplemented = errors.New("constraints not implemented on sqlite, consider using DisableForeignKeyConstraintWhenMigrating, more details https://github.com/go-gorm/gorm/wiki/GORM-V2-Release-Note-Draft#all-new-migrator")
)
Functions ¶
Types ¶
type Config ¶
Config is the configuration object accepted by New. It mirrors the field set of the official go-gorm/sqlite driver so existing code that does sqlite.New(sqlite.Config{DSN: "..."}) continues to compile after switching the import path to github.com/go-again/sqlite/gorm.
type Dialector ¶
func (Dialector) ClauseBuilders ¶
func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
func (Dialector) DefaultValueOf ¶
func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression
type Migrator ¶
func (Migrator) BuildIndexOptions ¶
func (Migrator) ColumnTypes ¶
func (m Migrator) ColumnTypes(value any) ([]gorm.ColumnType, error)
ColumnTypes return columnTypes []gorm.ColumnType and execErr error
func (Migrator) CurrentDatabase ¶
func (Migrator) GetIndexes ¶
GetIndexes return Indexes []gorm.Index and execErr error, See the doc
func (Migrator) RenameIndex ¶
func (*Migrator) RunWithoutForeignKey ¶
Click to show internal directories.
Click to hide internal directories.