Skip to content

Commit

Permalink
Storing dependencies as json
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Dec 9, 2024
1 parent 0c0b090 commit cec3fa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,3 @@ CREATE TABLE IF NOT EXISTS tasks (
exit_code INTEGER,
logs TEXT NOT NULL
);

CREATE TABLE IF NOT EXISTS task_dependencies (
id INTEGER PRIMARY KEY AUTOINCREMENT,
dependent_id INTEGER NOT NULL,
dependency_id INTEGER NOT NULL
);
8 changes: 6 additions & 2 deletions crates/turborepo-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ impl DatabaseHandle {
end_time,
cache_status,
exit_code,
logs
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)",
logs,
dependencies,
dependents
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)",
)
.bind(id.to_string())
.bind(&summary.name)
Expand All @@ -211,6 +213,8 @@ impl DatabaseHandle {
.bind(serde_json::to_string(&summary.cache)?)
.bind(summary.exit_code)
.bind(&summary.logs)
.bind(serde_json::to_string(&summary.dependencies)?)
.bind(serde_json::to_string(&summary.dependents)?)
.execute(&self.pool)
.await?;

Expand Down

0 comments on commit cec3fa9

Please sign in to comment.