postgresql

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm struct {
	ID           int64
	Name         string
	Version      string
	ProcessorID  int64
	WindowTypeID int64
	ResultType   ResultType
	Created      pgtype.Timestamp
	Description  string
}

type AlgorithmDependency

type AlgorithmDependency struct {
	ID                int64
	FromAlgorithmID   int64
	ToAlgorithmID     int64
	FromWindowTypeID  int64
	ToWindowTypeID    int64
	FromProcessorID   int64
	ToProcessorID     int64
	Created           pgtype.Timestamp
	LookbackCount     int64
	LookbackTimedelta int64
}

type AlgorithmExecutionPath

type AlgorithmExecutionPath struct {
	FinalAlgoID           int64
	NumDependencies       int32
	AlgoIDPath            string
	WindowTypeIDPath      string
	ProcIDPath            string
	LookbackCountPath     string
	LookbackTimedeltaPath string
}

type Annotation

type Annotation struct {
	ID int64
	// Start time of the annotation time window
	TimeFrom pgtype.Timestamp
	// End time of the annotation time window
	TimeTo   pgtype.Timestamp
	Metadata []byte
	// Detailed description of the annotation
	Description pgtype.Text
	CreatedAt   pgtype.Timestamp
}

Plot annotations with time ranges and metadata

type AnnotationAlgorithm

type AnnotationAlgorithm struct {
	AnnotationID int64
	AlgorithmID  int64
}

Junction table linking annotations to algorithms

type AnnotationWindowType

type AnnotationWindowType struct {
	AnnotationID int64
	WindowTypeID int64
}

Junction table linking annotations to window types

type CreateAlgorithmDependencyParams

type CreateAlgorithmDependencyParams struct {
	LookbackCount        int64
	LookbackTimedelta    int64
	FromAlgorithmName    string
	FromAlgorithmVersion string
	FromProcessorName    string
	FromProcessorRuntime string
	ToAlgorithmName      string
	ToAlgorithmVersion   string
	ToProcessorName      string
	ToProcessorRuntime   string
}

type CreateAlgorithmParams

type CreateAlgorithmParams struct {
	Name              string
	Version           string
	Description       string
	ResultType        ResultType
	ProcessorName     string
	ProcessorRuntime  string
	WindowTypeName    string
	WindowTypeVersion string
}

type CreateMetadataFieldParams

type CreateMetadataFieldParams struct {
	Name        string
	Description string
}

type CreateProcessorParams

type CreateProcessorParams struct {
	Name             string
	Runtime          string
	ConnectionString string
	ProjectName      pgtype.Text
}

type CreateResultParams

type CreateResultParams struct {
	WindowsID    pgtype.Int8
	WindowTypeID pgtype.Int8
	AlgorithmID  pgtype.Int8
	ResultValue  pgtype.Float8
	ResultArray  []float64
	ResultJson   []byte
}

type CreateWindowTypeMetadataFieldBridgeParams

type CreateWindowTypeMetadataFieldBridgeParams struct {
	WindowTypeID     int64
	MetadataFieldsID int64
}

type CreateWindowTypeParams

type CreateWindowTypeParams struct {
	Name        string
	Version     string
	Description string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Datalayer

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

func NewClient

func NewClient(ctx context.Context, connStr string) (*Datalayer, error)

generate a new client for the postgres datalayer

func (*Datalayer) EmitWindow

func (d *Datalayer) EmitWindow(
	ctx context.Context,
	window *pb.Window,
) (pb.WindowEmitStatus, error)

EmitWindow with Orca core

func (*Datalayer) Expose

func (d *Datalayer) Expose(
	ctx context.Context,
	settings *pb.ExposeSettings,
) (*pb.InternalState, error)

func (*Datalayer) RegisterProcessor

func (d *Datalayer) RegisterProcessor(
	ctx context.Context,
	proc *pb.ProcessorRegistration,
) error

RegisterProcessor with Orca Core

func (*Datalayer) WithTx

func (d *Datalayer) WithTx(ctx context.Context) (types.Tx, error)

type MetadataField

type MetadataField struct {
	ID          int64
	Name        string
	Description string
}

type MetadataFieldsReference

type MetadataFieldsReference struct {
	WindowTypeID     int64
	MetadataFieldsID int64
}

type NullResultType

type NullResultType struct {
	ResultType ResultType
	Valid      bool // Valid is true if ResultType is not NULL
}

func (*NullResultType) Scan

func (ns *NullResultType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullResultType) Value

func (ns NullResultType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type PgTx

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

func (*PgTx) Commit

func (t *PgTx) Commit(ctx context.Context) error

func (*PgTx) Rollback

func (t *PgTx) Rollback(ctx context.Context)

type Processor

type Processor struct {
	ID               int64
	Name             string
	Runtime          string
	ConnectionString string
	Created          pgtype.Timestamp
	ProjectName      pgtype.Text
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAlgorithm

func (q *Queries) CreateAlgorithm(ctx context.Context, arg CreateAlgorithmParams) error

func (*Queries) CreateAlgorithmDependency

func (q *Queries) CreateAlgorithmDependency(ctx context.Context, arg CreateAlgorithmDependencyParams) error

func (*Queries) CreateMetadataField

func (q *Queries) CreateMetadataField(ctx context.Context, arg CreateMetadataFieldParams) (int64, error)

func (*Queries) CreateProcessor

func (q *Queries) CreateProcessor(ctx context.Context, arg CreateProcessorParams) error

-------------------- Core Operations ----------------------

func (*Queries) CreateResult

func (q *Queries) CreateResult(ctx context.Context, arg CreateResultParams) (int64, error)

func (*Queries) CreateWindowType

func (q *Queries) CreateWindowType(ctx context.Context, arg CreateWindowTypeParams) (int64, error)

func (*Queries) CreateWindowTypeMetadataFieldBridge

func (q *Queries) CreateWindowTypeMetadataFieldBridge(ctx context.Context, arg CreateWindowTypeMetadataFieldBridgeParams) error

func (*Queries) ReadAlgorithmExecutionPaths

func (q *Queries) ReadAlgorithmExecutionPaths(ctx context.Context, windowTypeID string) ([]AlgorithmExecutionPath, error)

func (*Queries) ReadAlgorithmExecutionPathsForAlgo

func (q *Queries) ReadAlgorithmExecutionPathsForAlgo(ctx context.Context, algoID int64) ([]AlgorithmExecutionPath, error)

func (*Queries) ReadAlgorithmId

func (q *Queries) ReadAlgorithmId(ctx context.Context, arg ReadAlgorithmIdParams) (int64, error)

func (*Queries) ReadAlgorithms

func (q *Queries) ReadAlgorithms(ctx context.Context) ([]Algorithm, error)

func (*Queries) ReadAlgorithmsForProcessorId

func (q *Queries) ReadAlgorithmsForProcessorId(ctx context.Context, processorID int64) ([]Algorithm, error)

func (*Queries) ReadAlgorithmsForWindow

func (q *Queries) ReadAlgorithmsForWindow(ctx context.Context, arg ReadAlgorithmsForWindowParams) ([]Algorithm, error)

func (*Queries) ReadFromAlgorithmDependencies

func (q *Queries) ReadFromAlgorithmDependencies(ctx context.Context, arg ReadFromAlgorithmDependenciesParams) ([]AlgorithmDependency, error)

func (*Queries) ReadMetadataFields

func (q *Queries) ReadMetadataFields(ctx context.Context) ([]MetadataField, error)

func (*Queries) ReadProcessorExcludeProject

func (q *Queries) ReadProcessorExcludeProject(ctx context.Context, projectName pgtype.Text) ([]Processor, error)

func (*Queries) ReadProcessors

func (q *Queries) ReadProcessors(ctx context.Context) ([]Processor, error)

func (*Queries) ReadProcessorsByIDs

func (q *Queries) ReadProcessorsByIDs(ctx context.Context, processorIds []int64) ([]Processor, error)

func (*Queries) ReadWindowTypeMetadataFields

func (q *Queries) ReadWindowTypeMetadataFields(ctx context.Context) ([]WindowTypeMetadataField, error)

func (*Queries) ReadWindowTypes

func (q *Queries) ReadWindowTypes(ctx context.Context) ([]WindowType, error)

func (*Queries) RegisterWindow

func (q *Queries) RegisterWindow(ctx context.Context, arg RegisterWindowParams) (RegisterWindowRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type ReadAlgorithmIdParams

type ReadAlgorithmIdParams struct {
	AlgorithmName    string
	AlgorithmVersion string
	ProcessorName    string
	ProcessorRuntime string
}

type ReadAlgorithmsForWindowParams

type ReadAlgorithmsForWindowParams struct {
	WindowTypeName    string
	WindowTypeVersion string
}

type ReadFromAlgorithmDependenciesParams

type ReadFromAlgorithmDependenciesParams struct {
	FromAlgorithmName    string
	FromAlgorithmVersion string
	FromProcessorName    string
	FromProcessorRuntime string
}

type ReadMetadataFieldsByWindowTypeParams

type ReadMetadataFieldsByWindowTypeParams struct {
	WindowTypeName    string
	WindowTypeVersion string
}

type ReadMetadataFieldsByWindowTypeRow

type ReadMetadataFieldsByWindowTypeRow struct {
	MetadataFieldID          int64
	MetadataFieldName        string
	MetadataFieldDescription string
}

type ReadResultsForAlgorithmByCountParams

type ReadResultsForAlgorithmByCountParams struct {
	AlgorithmID pgtype.Int8
	SearchTo    pgtype.Timestamp
	Count       int32
}

type ReadResultsForAlgorithmByCountRow

type ReadResultsForAlgorithmByCountRow struct {
	ResultID          int64
	AlgorithmID       pgtype.Int8
	WindowID          int64
	ResultValue       pgtype.Float8
	ResultArray       []float64
	ResultJson        []byte
	WindowTypeName    string
	WindowTypeVersion string
	WindowTimeFrom    pgtype.Timestamp
	WindowTimeTo      pgtype.Timestamp
	WindowOrigin      string
	WindowMetadata    []byte
}

type ReadResultsForAlgorithmByTimedeltaParams

type ReadResultsForAlgorithmByTimedeltaParams struct {
	AlgorithmID pgtype.Int8
	SearchFrom  pgtype.Timestamp
	SearchTo    pgtype.Timestamp
}

type ReadResultsForAlgorithmByTimedeltaRow

type ReadResultsForAlgorithmByTimedeltaRow struct {
	ResultID          int64
	AlgorithmID       pgtype.Int8
	WindowID          int64
	ResultValue       pgtype.Float8
	ResultArray       []float64
	ResultJson        []byte
	WindowTypeName    string
	WindowTypeVersion string
	WindowTimeFrom    pgtype.Timestamp
	WindowTimeTo      pgtype.Timestamp
	WindowOrigin      string
	WindowMetadata    []byte
}

type RegisterWindowParams

type RegisterWindowParams struct {
	TimeFrom          pgtype.Timestamp
	TimeTo            pgtype.Timestamp
	Origin            string
	Metadata          []byte
	WindowTypeName    string
	WindowTypeVersion string
}

type RegisterWindowRow

type RegisterWindowRow struct {
	WindowTypeID int64
	ID           int64
}

type Result

type Result struct {
	ID           int64
	WindowsID    pgtype.Int8
	WindowTypeID pgtype.Int8
	AlgorithmID  pgtype.Int8
	ResultValue  pgtype.Float8
	ResultArray  []float64
	ResultJson   []byte
}

type ResultType

type ResultType string
const (
	ResultTypeStruct ResultType = "struct"
	ResultTypeArray  ResultType = "array"
	ResultTypeValue  ResultType = "value"
	ResultTypeNone   ResultType = "none"
)

func (*ResultType) Scan

func (e *ResultType) Scan(src interface{}) error

type Window

type Window struct {
	ID           int64
	WindowTypeID int64
	TimeFrom     pgtype.Timestamp
	TimeTo       pgtype.Timestamp
	Origin       string
	Metadata     []byte
	Created      pgtype.Timestamp
}

type WindowType

type WindowType struct {
	ID          int64
	Name        string
	Version     string
	Description string
	Created     pgtype.Timestamp
}

type WindowTypeMetadataField

type WindowTypeMetadataField struct {
	WindowTypeName           string
	WindowTypeVersion        string
	MetadataFieldID          int64
	MetadataFieldName        string
	MetadataFieldDescription string
}

Jump to

Keyboard shortcuts

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