Documentation
¶
Index ¶
- Variables
- func Close()
- func Connection(ctx context.Context, key catalogKey) *sql.Conn
- func Execute(ctx context.Context, id string, sn int, statement string, stdin io.Reader, ...) error
- func ExecuteSourceTask(id string, reqs []string, statement, message string) executeSourceTask
- func ExecuteTask(id string, priority int, reqs []string, statement, message string, ...) dispatch.Task
- func Forget(ctx context.Context, key catalogKey) context.Context
- func SetupExecution(f Executer)
- func WaitReleased()
- func WithConnection(ctx context.Context, key catalogKey) (context.Context, error)
- type Executer
Constants ¶
This section is empty.
Variables ¶
var ( Source = catalogKey("source") Target = catalogKey("target") )
var ( SourceConnect int TargetConnect int )
Functions ¶
func Connection ¶
Connection return SQL connection from context
panics if context does not have a connection.
func Execute ¶
func Execute(ctx context.Context, id string, sn int, statement string, stdin io.Reader, msg string, logArgs ...any) error
Execute immediatly a SQL statement
Uses statement executor to send query to stdout, files or Postgres.
func ExecuteSourceTask ¶ added in v1.0.0
ExecuteSourceTask instanciate a dispatch task for a single statement on source
func ExecuteTask ¶
func ExecuteTask(id string, priority int, reqs []string, statement, message string, logArgs ...any) dispatch.Task
ExecuteTask instanciate a dispatch task for a single statement
Use SetupExecution to globally configure query execution.
func Forget ¶ added in v0.28.0
Forget hides connection from context.
Use WithConnection to create a new connection in returned context.
func WithConnection ¶
WithConnection ensure context has a db connection
Connection is released when context is done. You should defer cancel() func before adding connexion to context.
Use Connection() to get connection on success.
Types ¶
type Executer ¶
type Executer interface {
// contains filtered or unexported methods
}
func PostgresExecutor ¶
func PostgresExecutor() Executer
PostgresExecutor sends queries to Postgres.
Requires a Target connection in context as set by WithConnection.
func StreamExecutor ¶
StreamExecutor writes queries to stream. Prevents concurrent writes.
func TreeExecutor ¶ added in v1.0.0
TreeExecutor writes queries to files.
File order depends on scheduling. Creates directory if not exists. Does not clean directory.