entutil

package
v0.0.0-...-71f12ce Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(d dialect.Driver, logger ...func(...any)) dialect.Driver

Debug gets a driver and an optional logging function, and returns a new debugged-driver that prints all outgoing operations.

func NewDriver

func NewDriver(c *Config) (*sql.Driver, error)

Types

type Config

type Config struct {
	Dialect     string `yaml:"Dialect"`
	DSN         string `yaml:"DSN"`
	MaxIdle     int    `yaml:"MaxIdle"`
	MaxActive   int    `yaml:"MaxActive"`
	MaxLifetime int    `yaml:"MaxLifetime"`
}

type CreateTime

type CreateTime struct{ ent.Schema }

func (CreateTime) Fields

func (CreateTime) Fields() []ent.Field

Fields of the time mixin.

func (CreateTime) Indexes

func (CreateTime) Indexes() []ent.Index

type DebugDriver

type DebugDriver struct {
	dialect.Driver // underlying driver.
	// contains filtered or unexported fields
}

DebugDriver is a driver that logs all driver operations.

func (*DebugDriver) BeginTx

func (d *DebugDriver) BeginTx(ctx context.Context, opts *sql.TxOptions) (dialect.Tx, error)

BeginTx adds an log-id for the transaction and calls the underlying driver BeginTx command if it is supported.

func (*DebugDriver) Exec

func (d *DebugDriver) Exec(ctx context.Context, query string, args, v any) error

Exec logs its params and calls the underlying driver Exec method.

func (*DebugDriver) ExecContext

func (d *DebugDriver) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

ExecContext logs its params and calls the underlying driver ExecContext method if it is supported.

func (*DebugDriver) Query

func (d *DebugDriver) Query(ctx context.Context, query string, args, v any) error

Query logs its params and calls the underlying driver Query method.

func (*DebugDriver) QueryContext

func (d *DebugDriver) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)

QueryContext logs its params and calls the underlying driver QueryContext method if it is supported.

func (*DebugDriver) Tx

func (d *DebugDriver) Tx(ctx context.Context) (dialect.Tx, error)

Tx adds an log-id for the transaction and calls the underlying driver Tx command.

type DebugTx

type DebugTx struct {
	dialect.Tx // underlying transaction.
	// contains filtered or unexported fields
}

DebugTx is a transaction implementation that logs all transaction operations.

func (*DebugTx) Commit

func (d *DebugTx) Commit() error

Commit logs this step and calls the underlying transaction Commit method.

func (*DebugTx) Exec

func (d *DebugTx) Exec(ctx context.Context, query string, args, v any) error

Exec logs its params and calls the underlying transaction Exec method.

func (*DebugTx) ExecContext

func (d *DebugTx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

ExecContext logs its params and calls the underlying transaction ExecContext method if it is supported.

func (*DebugTx) Query

func (d *DebugTx) Query(ctx context.Context, query string, args, v any) error

Query logs its params and calls the underlying transaction Query method.

func (*DebugTx) QueryContext

func (d *DebugTx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)

QueryContext logs its params and calls the underlying transaction QueryContext method if it is supported.

type Time

type Time struct{ ent.Schema }

func (Time) Fields

func (Time) Fields() []ent.Field

Fields of the time mixin.

func (Time) Indexes

func (Time) Indexes() []ent.Index

type TimeWithDelete

type TimeWithDelete struct{ ent.Schema }

func (TimeWithDelete) Fields

func (TimeWithDelete) Fields() []ent.Field

Fields of the time mixin.

func (TimeWithDelete) Indexes

func (TimeWithDelete) Indexes() []ent.Index

Jump to

Keyboard shortcuts

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