import { readLiveSchema } from "../functions/live-schema"; /** * Grab a table's schema fields from the loaded (or last synced) schema. */ export default function grabTableFields(tableName) { const dbSchema = global.DB_SCHEMA || readLiveSchema(); const tableSchema = dbSchema?.tables?.find((t) => t.tableName === tableName); return tableSchema?.fields || []; }