database

package
v0.5.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POSTGRES = "postgres"
	SQLITE   = "sqlite"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GORMHandler

type GORMHandler struct {
	*gorm.DB
	*sync.Mutex
}

func NewGormEngine

func NewGormEngine(opts Options) (GORMHandler, error)

func (*GORMHandler) DBClose

func (h *GORMHandler) DBClose() error

type Model

type Model struct {
	ID        string `json:"id,omitempty" gorm:"primarykey"`
	CreatedAt string `json:"created_at,omitempty" gorm:"index"`
	UpdatedAt string `json:"updated_at,omitempty" gorm:"index"`
	DeletedAt string `json:"deleted_at,omitempty" gorm:"index"`
}

type Options

type Options struct {
	Engine   string
	Host     string
	Port     string
	Username string
	Password string
	Filename string
	Logger   meshlogger.Logger
}

type XORMHandler

type XORMHandler struct {
	// contains filtered or unexported fields
}

func NewXormEngine

func NewXormEngine(opts Options) (*XORMHandler, error)

Source Files

  • common.go
  • gorm_database.go
  • xorm_database.go

Jump to

Keyboard shortcuts

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