database

package
v0.0.0-...-a68ecec Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB) error

func Upsert

func Upsert(db *gorm.DB, entry *Entry) error

Types

type CustomLogger

type CustomLogger struct {
	logger.Interface
}

func (*CustomLogger) LogMode

func (c *CustomLogger) LogMode(level logger.LogLevel) logger.Interface

func (*CustomLogger) Trace

func (c *CustomLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

type Entry

type Entry struct {
	gorm.Model
	Kanji   string
	Kana    string
	English StringArray `gorm:"type:jsonb"`
	Labels  StringArray `gorm:"type:jsonb"`
}

type StringArray

type StringArray []string

func (*StringArray) Scan

func (j *StringArray) Scan(value interface{}) error

func (StringArray) Value

func (j StringArray) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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