feat: add sequelize with postgres UTC timestamp endpoint

This commit is contained in:
Noah Holt 2026-08-11 00:15:40 -05:00
parent 1365bd7644
commit 8237c6cd2a
8 changed files with 450 additions and 7 deletions

15
src/services/database.ts Normal file
View file

@ -0,0 +1,15 @@
import { sequelize } from "../config/database.js";
export async function getUtcTimestamp(): Promise<string | null> {
if (!sequelize) {
return null;
}
try {
const [results] = await sequelize.query("SELECT NOW() AS utc_time");
const rows = results as { utc_time: string }[];
return rows[0]?.utc_time ?? null;
} catch {
return null;
}
}