Add partial import functionality (#812)

This commit is contained in:
WithoutPants
2020-09-20 18:36:02 +10:00
committed by GitHub
parent 7a45943e8e
commit 8866670e53
56 changed files with 5030 additions and 624 deletions

View File

@@ -93,6 +93,19 @@ func (qb *SceneQueryBuilder) Update(updatedScene ScenePartial, tx *sqlx.Tx) (*Sc
return qb.find(updatedScene.ID, tx)
}
func (qb *SceneQueryBuilder) UpdateFull(updatedScene Scene, tx *sqlx.Tx) (*Scene, error) {
ensureTx(tx)
_, err := tx.NamedExec(
`UPDATE scenes SET `+SQLGenKeys(updatedScene)+` WHERE scenes.id = :id`,
updatedScene,
)
if err != nil {
return nil, err
}
return qb.find(updatedScene.ID, tx)
}
func (qb *SceneQueryBuilder) IncrementOCounter(id int, tx *sqlx.Tx) (int, error) {
ensureTx(tx)
_, err := tx.Exec(