dao

package
v0.0.0-...-2c8718e Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(ctx context.Context, uri string) (*DB, error)

func (*DB) CopyTable

func (db *DB) CopyTable(old string, new string) error

func (*DB) CreateTable

func (db *DB) CreateTable(target config.Target, fields []Field) error

func (*DB) GetActiveStreams

func (db *DB) GetActiveStreams() (map[config.Target]config.Source, error)

func (*DB) GetStreamLocation

func (db *DB) GetStreamLocation(source config.Source, target config.Target) (lsn string, ts time.Time, err error)

func (*DB) LogNotification

func (db *DB) LogNotification(call string, err error)

func (*DB) PersistMessage

func (db *DB) PersistMessage(message creek.WAL, target string) error

func (*DB) PersistSnapshotData

func (db *DB) PersistSnapshotData(target string, data []creek.SnapRow, pk []string) error

func (*DB) SetActive

func (db *DB) SetActive(target config.Target, active bool) error

func (*DB) SetContext

func (db *DB) SetContext(ctx context.Context)

func (*DB) StartAPI

func (db *DB) StartAPI() <-chan string

func (*DB) SwapAndDropTable

func (db *DB) SwapAndDropTable(namespace string, old string, new string) error

func (*DB) UpdateLocation

func (db *DB) UpdateLocation(source config.Source, target config.Target, lsn string, ts time.Time) error

func (*DB) UpdateLocationWithContext

func (db *DB) UpdateLocationWithContext(ctx context.Context, source config.Source, target config.Target, lsn string, ts time.Time) error

type Field

type Field struct {
	Name     string
	DataType string
	Pk       bool
}

Jump to

Keyboard shortcuts

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