orm

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Context      context.Context
	Debug        bool
	Connector    Connector            // use for single database
	Once         bool                 // use once for close db,when connector used same driver
	Connectors   map[string]Connector // use for multi database, if needed
	Dialect      string               // mysql/postgres/sqlite3/...
	ORM          string               // gorm,ent,xorm,...
	DSN          string
	MaxLifetime  int
	MaxIdleTime  int
	MaxOpenConns int
	MaxIdleConns int
	Names        []string
}

type Connector

type Connector interface {
	Open(config Config) (any, error)
	Close() error
}

type Hook

type Hook interface {
}

type ORM

type ORM struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(config Config) *ORM

func (*ORM) Close

func (o *ORM) Close() error

func (*ORM) Config

func (o *ORM) Config() Config

func (*ORM) DB

func (o *ORM) DB(name string) any

func (*ORM) Open

func (o *ORM) Open(name string) error

Directories

Path Synopsis
ent
mixin
Package mixin is the mixin package
Package mixin is the mixin package
internal

Jump to

Keyboard shortcuts

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