Documentation ¶
Index ¶
- type State
- type StateSchema
- func (c *StateSchema) GetState(ctx context.Context, db *sql.DB, stateID string) (*State, error)
- func (c *StateSchema) SaveState(ctx context.Context, db *sql.DB, state *State, stateID string) error
- func (c *StateSchema) SelectState(stateID string) squirrel.SelectBuilder
- func (c *StateSchema) UpsertState(state *State, stateID string) squirrel.InsertBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateSchema ¶
type StateSchema struct { TableName string IDColumnName string DataColumnName string LockColumnName string CreateStatement string }
func DefaultStateSchema ¶
func DefaultStateSchema() *StateSchema
func (*StateSchema) GetState ¶
GetState gets a TerraformState struct from the database if no rows are found then a new row is created
func (*StateSchema) SaveState ¶
func (c *StateSchema) SaveState(ctx context.Context, db *sql.DB, state *State, stateID string) error
SaveState saves a TerraformState struct to a database
func (*StateSchema) SelectState ¶
func (c *StateSchema) SelectState(stateID string) squirrel.SelectBuilder
SelectState generates a squirrel.SelectBuilder suitable for selecting a row
func (*StateSchema) UpsertState ¶
func (c *StateSchema) UpsertState(state *State, stateID string) squirrel.InsertBuilder
UpsertState generates a squirrel.InsertBuilder suitable for inserting a new row or updating if the stateID already exists
Click to show internal directories.
Click to hide internal directories.