db

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBBackend

func NewDBBackend() states.Backend

func NewDBState

func NewDBState() states.StateStorage

Types

type DBBackend

type DBBackend struct {
	DBState
}

func (*DBBackend) ConfigSchema

func (b *DBBackend) ConfigSchema() cty.Type

ConfigSchema returns a description of the expected configuration structure for the receiving backend.

func (*DBBackend) Configure

func (b *DBBackend) Configure(obj cty.Value) error

Configure uses the provided configuration to set configuration fields within the DBState backend.

func (*DBBackend) StateStorage

func (b *DBBackend) StateStorage() states.StateStorage

StateStorage return a StateStorage to manage State stored in db

type DBState

type DBState struct {
	DB *sql.DB
}

func (*DBState) Apply

func (s *DBState) Apply(state *states.State) error

Apply save state in DB by add-only strategy.

func (*DBState) Delete

func (s *DBState) Delete(id string) error

func (*DBState) GetLatestState

func (s *DBState) GetLatestState(q *states.StateQuery) (*states.State, error)

Jump to

Keyboard shortcuts

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