backends

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package backends provides interfaces to write backends for SQL Jobber that take and store results from executed SQL jobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt added in v1.0.0

type Opt struct {
	DBType         string
	ResultsTable   string
	UnloggedTables bool
}

Opt represents SQL DB backend's options.

type ResultBackend

type ResultBackend interface {
	NewResultSet(dbName, taskName string, ttl time.Duration) (ResultSet, error)
}

ResultBackend represents a result backend to which results from an executed SQL job are written.

func NewSQLBackend

func NewSQLBackend(db *sql.DB, opt Opt, l *log.Logger) (ResultBackend, error)

NewSQLBackend returns a new sqlDB result backend instance. It accepts an *sql.DB connection

type ResultSet

type ResultSet interface {
	RegisterColTypes([]string, []*sql.ColumnType) error
	IsColTypesRegistered() bool
	WriteCols([]string) error
	WriteRow([]interface{}) error
	Flush() error
	Close() error
}

ResultSet represents the set of results from an individual job that's executed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL