sql

package
v1.2.16 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mysql

type Mysql struct {
	*gorm.DB
}

func NewMysql

func NewMysql(dsn string) (*Mysql, error)

func (*Mysql) AutoMigrate added in v1.0.13

func (m *Mysql) AutoMigrate(table any) error

func (*Mysql) CreateIfNotExist

func (m *Mysql) CreateIfNotExist(table interface{}) error

func (*Mysql) Db

func (m *Mysql) Db() *gorm.DB

func (*Mysql) Kind

func (*Mysql) Kind() storage.StoreKind

func (*Mysql) Type

func (*Mysql) Type() storage.StoreType

type PostgreSql

type PostgreSql struct {
	*gorm.DB
}

func NewPostgreSql

func NewPostgreSql(dsn string) (*PostgreSql, error)

func (*PostgreSql) AutoMigrate added in v1.0.13

func (p *PostgreSql) AutoMigrate(table any) error

func (*PostgreSql) CreateIfNotExist

func (p *PostgreSql) CreateIfNotExist(table interface{}) error

func (*PostgreSql) Db

func (p *PostgreSql) Db() *gorm.DB

func (*PostgreSql) Kind

func (*PostgreSql) Kind() storage.StoreKind

func (*PostgreSql) Type

func (*PostgreSql) Type() storage.StoreType

type SqlDB

type SqlDB interface {
	storage.StorageType
	Db() *gorm.DB
	CreateIfNotExist(table interface{}) error
	AutoMigrate(table any) error
}

func NewSqlDB

func NewSqlDB(cfg *config.SqlDbConf) (SqlDB, error)

type Sqlite

type Sqlite struct {
	*gorm.DB
}

func NewSqlite

func NewSqlite(dsn string) (*Sqlite, error)

func (*Sqlite) AutoMigrate added in v1.0.13

func (s *Sqlite) AutoMigrate(table any) error

func (*Sqlite) CreateIfNotExist

func (s *Sqlite) CreateIfNotExist(table interface{}) error

func (*Sqlite) Db

func (s *Sqlite) Db() *gorm.DB

func (*Sqlite) Kind

func (*Sqlite) Kind() storage.StoreKind

func (*Sqlite) Type

func (*Sqlite) Type() storage.StoreType

Jump to

Keyboard shortcuts

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