ent

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(cfg *conf.Data) (*entsql.Driver, error)

NewDriver creates an ent SQL driver from the shared data configuration. Callers must blank-import the appropriate database/sql driver, e.g.:

_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"

func NewDriverWithTracing added in v0.3.2

func NewDriverWithTracing(cfg *conf.Data, log *zap.Logger) (dialect.Driver, error)

NewDriverWithTracing creates a driver via NewDriver and wraps it with the tracing decorator. Pass the zap logger from your obs/logging.ZapLogger:

drv, err := ent.NewDriverWithTracing(cfg, zapLogger.Zap())

func WrapWithTracing added in v0.3.2

func WrapWithTracing(inner dialect.Driver, log *zap.Logger) dialect.Driver

WrapWithTracing returns a dialect.Driver that delegates to inner and emits trace-correlated logs through log. Pass zap.NewNop() to disable logging.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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