session

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Scan = scanner.Scan
	Open = adaptor.Open
)

Functions

func Carry added in v0.0.4

func Carry(session Session) contextx.Carrier

Carry returns context carrier

func With added in v0.0.4

func With(ctx context.Context, session Session) context.Context

With injects Session

Types

type Adaptor added in v0.0.3

type Adaptor = adaptor.Adaptor

type AdaptorOption added in v0.1.18

type AdaptorOption struct {
	ReadOnly bool
}

type Endpoint added in v0.1.13

type Endpoint struct {
	types.Endpoint[EndpointOption]
	Readonly types.Endpoint[EndpointOption]
	// contains filtered or unexported fields
}

func (*Endpoint) ApplyCatalog added in v0.1.18

func (d *Endpoint) ApplyCatalog(name string, catalogs ...builder.Catalog)

ApplyCatalog should do before endpoint initialization

func (*Endpoint) Catalog added in v0.1.18

func (d *Endpoint) Catalog() builder.Catalog

func (*Endpoint) Close added in v0.1.19

func (d *Endpoint) Close() error

func (*Endpoint) Init added in v0.1.18

func (d *Endpoint) Init(ctx context.Context) error

func (*Endpoint) LivenessCheck added in v0.1.20

func (d *Endpoint) LivenessCheck(ctx context.Context) (v types.LivenessData)

func (*Endpoint) Name added in v0.1.18

func (d *Endpoint) Name() string

func (*Endpoint) Run added in v0.1.18

func (d *Endpoint) Run(ctx context.Context) error

func (*Endpoint) Session added in v0.1.18

func (d *Endpoint) Session() Session

type EndpointOption added in v0.1.18

type EndpointOption struct {
	AutoMigration   bool `url:"-"`
	DryRun          bool `url:"-"`
	CreateTableOnly bool `url:"-"`
	MultiStatements bool
}

func (*EndpointOption) SetDefault added in v0.1.22

func (o *EndpointOption) SetDefault()

type OptionFunc added in v0.0.3

type OptionFunc func(*AdaptorOption)

func ReadOnly added in v0.0.3

func ReadOnly() OptionFunc

type Session added in v0.0.3

type Session interface {
	// Database physically endpoint
	Database() string
	// Schema logically
	Schema() string
	// Name returns session name
	Name() string
	// T picks table from session
	T(any) builder.Table
	// Tx exec query
	Tx(context.Context, func(context.Context) error) error
	// Adaptor returns session adaptor
	Adaptor(...OptionFunc) adaptor.Adaptor
}

func For added in v0.0.3

func For(ctx context.Context, m any) Session

For retrieves Session by session name or table

func From added in v0.0.4

func From(ctx context.Context, name string) Session

From retrieve Session from ctx by Session.Name

func New added in v0.0.3

func New(a adaptor.Adaptor, name string) Session

func NewRO added in v0.0.3

func NewRO(rw adaptor.Adaptor, ro adaptor.Adaptor, name string) Session

Jump to

Keyboard shortcuts

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