Builder_db.Job_tag: provide next to add also an update
Model: if Job_tag.add fails, use Job_tag.update
This commit is contained in:
parent
eb786088e7
commit
1e190e42c7
1 changed files with 4 additions and 1 deletions
|
@ -157,7 +157,10 @@ module Job_tag = struct
|
||||||
let add =
|
let add =
|
||||||
Caqti_request.exec
|
Caqti_request.exec
|
||||||
Caqti_type.(tup3 id string id)
|
Caqti_type.(tup3 id string id)
|
||||||
"INSERT OR REPLACE INTO job_tag (tag, value, job) VALUES (?, ?, ?)"
|
{| INSERT INTO job_tag (tag, value, job)
|
||||||
|
VALUES (?1, ?2, ?3)
|
||||||
|
ON CONFLICT(x) DO UPDATE SET value = ?2 WHERE tag = ?1 AND job = ?3
|
||||||
|
|}
|
||||||
|
|
||||||
let get_value =
|
let get_value =
|
||||||
Caqti_request.find
|
Caqti_request.find
|
||||||
|
|
Loading…
Reference in a new issue