orm

package module
v0.0.0-...-3682e30 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectOptions

type ConnectOptions struct {
	Host     string
	Port     int
	User     string
	Password string
	DBName   string
}

func (ConnectOptions) GetDSN

func (config ConnectOptions) GetDSN() string

type Database

type Database interface {
	Connect() error
}

type Postgres

type Postgres struct {
	ConnectOptions
	*gorm.DB
}

func (*Postgres) Connect

func (p *Postgres) Connect() (err error)

func (Postgres) Count

func (p Postgres) Count(model interface{}) (count int64)

func (Postgres) CreateIfNotExist

func (p Postgres) CreateIfNotExist(model interface{}) bool

func (Postgres) Init

func (p Postgres) Init(models ...interface{}) error

func (Postgres) Truncate

func (p Postgres) Truncate(model interface{})

Jump to

Keyboard shortcuts

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