Skip to content

Commit

Permalink
fix: run metadata storage throwing error for second run (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikatmitra91 authored Apr 17, 2024
1 parent 82739a9 commit a4805df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/cool-plants-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@empiricalrun/core": patch
"@empiricalrun/cli": patch
---

fix: duck db table error creating more than 1 run from web app
4 changes: 2 additions & 2 deletions packages/core/src/store/run-metadata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export class LocalRunMetadataStore {
if (!fs.existsSync(`${fullPath}`)) {
fs.mkdirSync(`${cwd}/${cachePath}`, { recursive: true });
fs.writeFileSync(fullPath, "");
cmd = `create table runs (run JSON)`;
cmd = `create table if not exists runs (run JSON)`;
} else {
cmd = `create table runs as select * from read_json_auto('${cachePath}/${fileName}')`;
cmd = `create table if not exists runs as select * from read_json_auto('${cachePath}/${fileName}')`;
}

if (!this.createTable) {
Expand Down

0 comments on commit a4805df

Please sign in to comment.