mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-23 19:27:51 -04:00
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
|
|
import { db } from "../src/server/db";
|
|
import { experiments, steps } from "../src/server/db/schema";
|
|
import { eq } from "drizzle-orm";
|
|
|
|
async function inspectAllSteps() {
|
|
const result = await db.query.experiments.findMany({
|
|
with: {
|
|
steps: {
|
|
orderBy: (steps, { asc }) => [asc(steps.orderIndex)],
|
|
columns: {
|
|
id: true,
|
|
name: true,
|
|
type: true,
|
|
orderIndex: true,
|
|
conditions: true,
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
console.log(`Found ${result.length} experiments.`);
|
|
|
|
for (const exp of result) {
|
|
console.log(`Experiment: ${exp.name} (${exp.id})`);
|
|
for (const step of exp.steps) {
|
|
// Only print conditional steps or the first step
|
|
if (step.type === 'conditional' || step.orderIndex === 0) {
|
|
console.log(` [${step.orderIndex}] ${step.name} (${step.type})`);
|
|
console.log(` Conditions: ${JSON.stringify(step.conditions)}`);
|
|
}
|
|
}
|
|
console.log('---');
|
|
}
|
|
}
|
|
|
|
inspectAllSteps()
|
|
.then(() => process.exit(0))
|
|
.catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|