sql

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQLConnLintRule = `root = match {this.iam_enabled && this.exists("secret_name") => "both iam_enabled and secret_name cannot be set"}`
)

Variables

View Source
var AWSGetCredentialsGeneratorFn = func(c *service.ParsedConfig) (fn func(dsn, driver string) (password string, err error), err error) {
	awsEnabled, err := IsAWSEnabled(c)
	if err != nil {
		return nil, err
	}
	if awsEnabled {
		return nil, errors.New("unable to configure AWS authentication as this binary does not import components/aws")
	}
	return
}

AWSGetCredentialsGeneratorFn is populated with the child `aws` package when imported.

View Source
var AzureGetCredentialsGeneratorFn = func(pConf *service.ParsedConfig) (fn AzureDSNBuilder, err error) {
	entraEnabled, err := pConf.FieldBool("azure", "entra_enabled")
	if err != nil {
		return nil, err
	}
	if entraEnabled {
		return nil, errors.New("unable to configure Azure Entra authentication as this binary doesn't import components/azure")
	}
	return
}
View Source
var BuildAwsDsn = func(dsn, driver string) (newDsn string, err error) {
	return dsn, nil
}
View Source
var BuildAzureDsn = func(dsn, driver string) (builtDsn string, err error) {
	return dsn, nil
}

Functions

func DeprecatedProcessorConfig

func DeprecatedProcessorConfig() *service.ConfigSpec

DeprecatedProcessorConfig returns a config spec for an sql processor.

func InsertProcessorConfig

func InsertProcessorConfig() *service.ConfigSpec

InsertProcessorConfig returns a config spec for an sql_insert processor.

func IsAWSEnabled added in v1.8.0

func IsAWSEnabled(c *service.ParsedConfig) (enabled bool, err error)

func NewSQLDeprecatedProcessorFromConfig

func NewSQLDeprecatedProcessorFromConfig(conf *service.ParsedConfig, mgr *service.Resources) (*sqlRawProcessor, error)

NewSQLDeprecatedProcessorFromConfig returns an internal sql processor.

func NewSQLInsertProcessorFromConfig

func NewSQLInsertProcessorFromConfig(conf *service.ParsedConfig, mgr *service.Resources) (*sqlInsertProcessor, error)

NewSQLInsertProcessorFromConfig returns an internal sql_insert processor.

func NewSQLRawProcessorFromConfig

func NewSQLRawProcessorFromConfig(conf *service.ParsedConfig, mgr *service.Resources) (*sqlRawProcessor, error)

NewSQLRawProcessorFromConfig returns an internal sql_raw processor.

func NewSQLSelectProcessorFromConfig

func NewSQLSelectProcessorFromConfig(conf *service.ParsedConfig, mgr *service.Resources) (*sqlSelectProcessor, error)

NewSQLSelectProcessorFromConfig returns an internal sql_select processor.

func RawProcessorConfig

func RawProcessorConfig() *service.ConfigSpec

RawProcessorConfig returns a config spec for an sql_raw processor.

func SQLiteBufferConfig

func SQLiteBufferConfig() *service.ConfigSpec

SQLiteBufferConfig returns a config spec for an SQLite buffer.

func SelectProcessorConfig

func SelectProcessorConfig() *service.ConfigSpec

SelectProcessorConfig returns a config spec for an sql_select processor.

Types

type AzureDSNBuilder added in v1.10.0

type AzureDSNBuilder func(dsn, driver string) (builtDSN string, err error)

type SQLiteBuffer

type SQLiteBuffer struct {
	// contains filtered or unexported fields
}

SQLiteBuffer stores messages for consumption through an SQLite DB.

func NewSQLiteBufferFromConfig

func NewSQLiteBufferFromConfig(conf *service.ParsedConfig, res *service.Resources) (*SQLiteBuffer, error)

NewSQLiteBufferFromConfig creates a new SQLite buffer from a parsed config.

func (*SQLiteBuffer) Close

func (m *SQLiteBuffer) Close(ctx context.Context) error

Close the underlying DB connection.

func (*SQLiteBuffer) EndOfInput

func (m *SQLiteBuffer) EndOfInput()

EndOfInput signals to the buffer that the input is finished and therefore once the DB is drained it should close.

func (*SQLiteBuffer) ReadBatch

ReadBatch attempts to pop a row from the DB.

func (*SQLiteBuffer) WriteBatch

func (m *SQLiteBuffer) WriteBatch(ctx context.Context, msgBatch service.MessageBatch, aFn service.AckFunc) error

WriteBatch adds a new message to the DB.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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