feat(tfstated): implement states versioning
This commit is contained in:
parent
71702002cf
commit
3319e74279
5 changed files with 56 additions and 36 deletions
|
@ -25,11 +25,7 @@ func (db *DB) SetLockOrGetExistingLock(name string, lock any) (bool, error) {
|
|||
if lockData, err = json.Marshal(lock); err != nil {
|
||||
return false, err
|
||||
}
|
||||
_, err = tx.ExecContext(db.ctx,
|
||||
`INSERT INTO states(name, lock) VALUES (:name, json(:lock))`,
|
||||
sql.Named("lock", lockData),
|
||||
sql.Named("name", name),
|
||||
)
|
||||
_, err = tx.ExecContext(db.ctx, `INSERT INTO states(name, lock) VALUES (?, json(?))`, name, lockData)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue