ent

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type After added in v0.0.2

type After func(ctx context.Context, drv *sql.Driver) (err error)

After is a hook that is executed after closing a database connection.

type Before

type Before func(ctx context.Context, drv *sql.Driver) (err error)

Before is a hook that is executed before opening a database connection.

type Builder

type Builder func(drv *sql.Driver, config orm.Config) (any, error)

Builder is a builder function that returns a driver.

type DB

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

DB is the database client.

func New

func New(config orm.Config) (*DB, error)

New creates a new database instance.

func (*DB) After added in v0.0.2

func (db *DB) After(ctx context.Context, fns ...After) error

After executes the hooks after the database connection.

func (*DB) Before

func (db *DB) Before(ctx context.Context, fns ...Before) error

Before executes the hooks before the database connection.

func (*DB) Close

func (db *DB) Close() error

Close closes the database connection.

func (*DB) Connector

func (db *DB) Connector(builder Builder) orm.Connector

Connector returns a new database connector.

func (*DB) Driver added in v0.0.2

func (db *DB) Driver() *sql.Driver

Driver returns the underlying database driver.

Directories

Path Synopsis
Package mixin is the mixin package
Package mixin is the mixin package

Jump to

Keyboard shortcuts

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