summaryrefslogtreecommitdiffstats
path: root/src/pipeline/steps.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipeline/steps.rs')
-rw-r--r--src/pipeline/steps.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/pipeline/steps.rs b/src/pipeline/steps.rs
index 6bdf12c..033093b 100644
--- a/src/pipeline/steps.rs
+++ b/src/pipeline/steps.rs
@@ -390,11 +390,17 @@ fn ingest(ctx: &Ctx) -> Result<StepResult> {
let log_path = ctx.log.display().to_string();
ctx.db.writer.tx(move |tx| {
for p in &packages_for_db {
- tx.execute(
- "INSERT INTO artifact (digest, size, path, signature_path, build_log_path, build_id, created_at)
- VALUES (?1,?2,?3,?4,?5,?6,?7)
- ON CONFLICT(digest) DO UPDATE SET build_id=excluded.build_id",
- rusqlite::params![p.digest, p.size as i64, p.path, p.signature_path, log_path, build_id, at],
+ db::insert_artifact_in(
+ tx,
+ &db::NewArtifact {
+ digest: &p.digest,
+ size: p.size as i64,
+ path: &p.path,
+ signature_path: p.signature_path.as_deref(),
+ build_log_path: Some(&log_path),
+ build_id: &build_id,
+ at: &at,
+ },
)?;
}
Ok(())