Documentation
¶
Index ¶
- func Carry(m builder.Model, s Session) contextx.Carrier
- func Register(cats ...builder.Catalog)
- func With(ctx context.Context, m builder.Model, s Session) context.Context
- type AdaptorOption
- type AdaptorOptionApplier
- type SchemaModel
- type Session
- func For(ctx context.Context, m any) (Session, bool)
- func From(ctx context.Context, schema, name string) (Session, bool)
- func FromM(ctx context.Context, m SchemaModel) (Session, bool)
- func Must(ctx context.Context, schema, name string) Session
- func MustFor(ctx context.Context, m any) Session
- func MustM(ctx context.Context, m SchemaModel) Session
- func New(a adaptor.Adaptor, schema string) Session
- func NewReadonly(rw adaptor.Adaptor, ro adaptor.Adaptor, name string) Session
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 SchemaModel ¶
type SchemaModel interface {
builder.HasSchema
builder.HasTableName
}
type Session ¶ added in v0.0.3
type Session interface {
// Schema logically isolation
Schema() 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 is a logical isolation unit and operational handle for database adapters. eg:
a specific MySQL database a specific search_path in same PostgreSQL database a particular SQLite database file.
Click to show internal directories.
Click to hide internal directories.