database

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrNoneDatabaseCode = "test"
	ErrDatabaseOpenCode = "test"

	ErrNoneDatabase = errors.NewDefault(ErrNoneDatabaseCode, "No Database selected")
)

Functions

func ErrDatabaseOpen

func ErrDatabaseOpen(err error) error

Types

type Handler

type Handler struct {
	*gormpkg.DB
}

func New

func New(opts Options) (Handler, 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 {
	Filename string `json:"filename,omitempty"`
	Engine   string `json:"engine,omitempty"`
}

Jump to

Keyboard shortcuts

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