Documentation
¶
Index ¶
- func Carry(session Session) contextx.Carrier
- func With(ctx context.Context, session Session) context.Context
- type AdaptorOption
- type AdaptorOptionApplier
- type HasSession
- type ModelWrapper
- type Session
- func For(ctx context.Context, m any) (Session, bool)
- func From(ctx context.Context, name string) (Session, bool)
- func Must(ctx context.Context, name string) Session
- func MustFor(ctx context.Context, m any) Session
- func New(a adaptor.Adaptor, name string) Session
- func NewReadonly(rw adaptor.Adaptor, ro adaptor.Adaptor, name string) Session
- type WithSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdaptorOption ¶ added in v0.1.18
type AdaptorOption struct {
ReadOnly bool
}
type AdaptorOptionApplier ¶ added in v0.2.1
type AdaptorOptionApplier func(*AdaptorOption)
func ReadOnly ¶ added in v0.0.3
func ReadOnly() AdaptorOptionApplier
type HasSession ¶ added in v0.2.1
type HasSession interface {
HasSession() Session
}
type ModelWrapper ¶ added in v0.2.1
type Session ¶ added in v0.0.3
type Session interface {
// Schema logically isolation
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(...AdaptorOptionApplier) adaptor.Adaptor
}
Session presents a connection to a rdb logically
type WithSession ¶ added in v0.2.1
type WithSession interface {
WithSession(Session)
}
Click to show internal directories.
Click to hide internal directories.