Documentation
¶
Index ¶
- Variables
- func RegisterCatalog(database string, catalog builder.Catalog)
- type Adaptor
- type Database
- func (d *Database) ApplyCatalog(name string, catalogs ...builder.Catalog)
- func (d *Database) Catalog() builder.Catalog
- func (d *Database) Init(ctx context.Context) error
- func (d *Database) Name() string
- func (d *Database) Run(ctx context.Context) error
- func (d *Database) Session() Session
- func (d *Database) SetDefault()
- type OptionFunc
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Scan = scanner.Scan Open = adaptor.Open )
Functions ¶
func RegisterCatalog ¶ added in v0.0.3
Types ¶
type Database ¶ added in v0.0.3
type Database struct {
Endpoint datatypex.Endpoint
Readonly datatypex.Endpoint
AutoMigration bool
DryRun bool
CreateTableOnly bool
// contains filtered or unexported fields
}
func (*Database) ApplyCatalog ¶ added in v0.0.3
func (*Database) SetDefault ¶ added in v0.0.3
func (d *Database) SetDefault()
type OptionFunc ¶ added in v0.0.3
type OptionFunc func(*option)
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
// 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
}
Click to show internal directories.
Click to hide internal directories.