Documentation
¶
Index ¶
- func DatabaseNameFromDSN(u *url.URL) string
- func Register(a Adaptor, aliases ...string)
- func WithExecutor(ctx context.Context, e Executor) context.Context
- func WithExecutorX(ctx context.Context, e ExecutorX) context.Context
- type Adaptor
- type Connector
- type DB
- type Dialect
- type Executor
- type ExecutorX
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseNameFromDSN ¶
Types ¶
type Adaptor ¶
type DB ¶
type Dialect ¶
type Dialect interface {
CreateSchema(string) frag.Fragment
SwitchSchema(string) frag.Fragment
CreateTableIfNotExists(t builder.Table) []frag.Fragment
DropTable(t builder.Table) frag.Fragment
TruncateTable(t builder.Table) frag.Fragment
AddColumn(builder.Col) frag.Fragment
DropColumn(builder.Col) frag.Fragment
RenameColumn(builder.Col, builder.Col) frag.Fragment
ModifyColumn(builder.Col, builder.Col) frag.Fragment
AddIndex(key builder.Key) frag.Fragment
DropIndex(key builder.Key) frag.Fragment
DBType(builder.ColumnDef) frag.Fragment
IsUnknownDatabaseError(error) bool
IsConflictError(err error) bool
}
type Executor ¶
type Executor interface {
ExecContext(context.Context, string, ...any) (sql.Result, error)
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
}
func ExecutorFrom ¶
Click to show internal directories.
Click to hide internal directories.