Skip to content

Commit

Permalink
combine dbs for new table
Browse files Browse the repository at this point in the history
  • Loading branch information
fjetter committed May 3, 2024
1 parent 593c2f7 commit c0ff40b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ci/scripts/combine-dbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@ fi
DB_NAME=benchmark.tmp.db alembic upgrade head

# Merge in the individual job dbs into our working copy
for FILE in $(find benchmarks -name "*.db")
for FILE in $(find . -name "*.db")
do
# Skip the output DB if we see it
if [ ${FILE##*/} == $DB_NAME ]; then
echo "Skipping $FILE"
continue
fi
echo "Processing $FILE"
DB_NAME=$FILE alembic upgrade head
# Copy the individual table into the primary one. We make an intermediate
# temp table so that we can null out the primary keys and reset the
# autoincrementing
sqlite3 "$FILE" <<EOF
attach "benchmark.tmp.db" as lead;
create temporary table tmp as select * from main.test_run;
create temporary table tmp as select * from main.tpch_run;
update tmp set id=NULL;
insert into lead.test_run select * from tmp;
insert into lead.tpch_run select * from tmp;
detach database lead;
EOF
done
Expand Down

0 comments on commit c0ff40b

Please sign in to comment.