mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-23 19:27:51 -04:00
26 lines
640 B
TypeScript
26 lines
640 B
TypeScript
import { drizzle } from "drizzle-orm/postgres-js";
|
|
import postgres from "postgres";
|
|
import * as schema from "../src/server/db/schema";
|
|
import { eq } from "drizzle-orm";
|
|
|
|
const connectionString = process.env.DATABASE_URL!;
|
|
const connection = postgres(connectionString);
|
|
const db = drizzle(connection, { schema });
|
|
|
|
async function main() {
|
|
const exp = await db.query.experiments.findFirst({
|
|
where: eq(schema.experiments.name, "Control Flow Demo"),
|
|
columns: { id: true },
|
|
});
|
|
|
|
if (exp) {
|
|
console.log(`Experiment ID: ${exp.id}`);
|
|
} else {
|
|
console.error("Experiment not found");
|
|
}
|
|
|
|
await connection.end();
|
|
}
|
|
|
|
main();
|