Restructure db schema

The "commit_links" table is now called "commit_edges".

There is now a "metrics" table that run measurements have a foreign key
to. This provides canonical metric metadata and will speed up the
initial graph page (before any real data arrives). For now, it will be
overwritten with each new run, but more nuanced config options may be
added later.
This commit is contained in:
Joscha 2023-09-01 11:47:16 +02:00
parent 1bae83d116
commit a525e58211
18 changed files with 77 additions and 71 deletions

View file

@ -96,21 +96,21 @@ async fn save_work(
.await?;
}
for (idx, (source, text)) in run.output.into_iter().enumerate() {
// Hopefully we won't need more than 4294967296 output chunks per run :P
let idx = idx as u32;
for (line, (source, text)) in run.output.into_iter().enumerate() {
// Hopefully we won't need more than 4294967296 lines per run :P
let line = line as u32;
sqlx::query!(
"\
INSERT INTO run_output ( \
id, \
idx, \
line, \
source, \
text \
) \
VALUES (?, ?, ?, ?) \
",
run.id,
idx,
line,
source,
text,
)